"A glowing enigmatic life form was found to inhabit alien forests at night." - general idea of the mod.
Compatibility update and tweaks to Will-o'-the-wisps mod by Betep3akata (forum thread).
Can be installed and updated directly from factorio Mods menu.
Download link, more up-to-date description and images on factorio mod portal: https://mods.factorio.com/mod/Will-o-the-Wisps_updated
Mod code also lives on github, in mk-fg/games repository, where more technical issues and pull requests can be filed.
This thread is for any feedback on the updated mod version, as remaining bugs here are probably mine anyway.
All feedback is welcome, but please do try to attach exact error message - including filename, line number and error itself - when reporting a bug, if any, as well as what was happening in the game at the time (or ideally steps to reproduce the issue).
See mod page for a full and up-to-date mod description and changelog.
Technical info and debug commands
Uncomment "conf.debug_log = true" in config.lua (will need to unpack zip for that) to print mod initialization info and various anomalous conditions to normal factorio log. Should always be disabled by default.
Mod console commands (all restricted to admin player only):
- /wisp - list and info on all mod-related commands.
- /wisp zone update - scan all not-recently-scanned chunks on the map for pollution and forests.
- - This is normally done over multiple steps at day time, and intended to be spread over a game day or two (~7-14 minutes at x1 speed).
- /wisp zone rescan - same as "zone update" above, but force-rescan all chunks, not just fill-in missing ones.
- /wisp zone stats - print statistics about scanned chunks and forests (including pollution level min, max, percentiles, etc) to console.
- /wisp zone labels [n] - add map labels to all chunks where wisps can spawn, with percentage of likelihood as text label.
- - Parameter specifies min percentage to display as text label alongside icon, default = 0.005 (0.5%).
- /wisp zone labels remove - remove map labels added by "zone labels" command.
- /wisp zone spawn [n] - simulate n (default=1) spawn-wisps-on-map cycles.
- - These are normally ran every N game-ticks (113 as of v0.0.28) at night.
- - Prints how long it'd have taken (in game-time/ticks) to run that many cycles normally back to console.
- /wisp incidents - add map labels for last wisp aggression-change incidents.
- /wisp incidents remove - remove map labels for wisp aggression incidents.
- /wisp congregate - spawn group of green wisps to explore players base, same as it occasionally happens at night.
- /wisp attack - make all wisps on the map hostile.
- /wisp radicalize - create fake "wisp died" events in a random wisp spawning area, turning any wisps there hostile.
- /wisp peace - pacify all wisps on the map.
- /wisp stats - print various counts for wisps on the map.
Other console commands useful for testing:
- /clear - to remove all console messages output.
- /c game.player.insert{name='wisp-yellow', count=100} - add stack of wisps to place from inventory for whatever testing.
- - Use with other mod entities to test them out, e.g.: wisp-red, wisp-purple, UV-lamp, wisp-detector, wisp-drone-blue-capsule.
- /c game.forces.player.chart(game.player.surface, {{x = -800, y = -800}, {x = 800, y = 800}}) - chart bunch of stuff around starting position.
- /c game.surfaces.nauvis.pollute(game.player.position, 9000) - create pollution spreading from current position (affects spawns).
Can also heavily recommend using Time Tools mod when debugging this one, as it allows to speed-up/slow-down time, pause it, and enable/disable "always day" mode via small on-screen panel easily.
It's especially useful with /cheat command, which otherwise enables "always day" mode, preventing wisps from spawning under default config.
Wisps currently use two forces, switching between these (unless disabled) on aggression towards them:
- "wisp" - always peaceful, but can be targeted (incl. by defences) if enabled in mod options.
- "wisp_attack" - always hostile towards player factions.
When wisp unit is killed, other units in the area (configurable via mod options) switch to wisp_attack force and thus become hostile and a valid target for turrets as well.
UV lamps deal damage from "wisp" force, which is checked and causes no retaliation.
Purple wisps are not really units, but rather long-lasting "smoke-with-trigger" poison clouds.
Wisps deal "corrosion" damage type, which is added by the mod.
Resistance to it is set for all prototypes in data-final-fixes.lua, depending on their category/name.
There are several separate algos for spawning wisps:
- Near player - finds trees around players and puts wisps there.
- On map - scans map for forested chunks during in-game day and spawns wisps there at night, depending on pollution level.
- Congregations - same as previous, but spawns whole group of green wisps to wander around players buildings.
- Death/mining - trees, rocks have chances to spawn wisps, while dead wisp units spawn purple wisps.
- Damage trigger on red wisps - spawns +1 red with some chance. Chance-check is actually made on spawn to kill or keep spawned wisp.
Mod console commands (all restricted to admin player only):
- /wisp - list and info on all mod-related commands.
- /wisp zone update - scan all not-recently-scanned chunks on the map for pollution and forests.
- - This is normally done over multiple steps at day time, and intended to be spread over a game day or two (~7-14 minutes at x1 speed).
- /wisp zone rescan - same as "zone update" above, but force-rescan all chunks, not just fill-in missing ones.
- /wisp zone stats - print statistics about scanned chunks and forests (including pollution level min, max, percentiles, etc) to console.
- /wisp zone labels [n] - add map labels to all chunks where wisps can spawn, with percentage of likelihood as text label.
- - Parameter specifies min percentage to display as text label alongside icon, default = 0.005 (0.5%).
- /wisp zone labels remove - remove map labels added by "zone labels" command.
- /wisp zone spawn [n] - simulate n (default=1) spawn-wisps-on-map cycles.
- - These are normally ran every N game-ticks (113 as of v0.0.28) at night.
- - Prints how long it'd have taken (in game-time/ticks) to run that many cycles normally back to console.
- /wisp incidents - add map labels for last wisp aggression-change incidents.
- /wisp incidents remove - remove map labels for wisp aggression incidents.
- /wisp congregate - spawn group of green wisps to explore players base, same as it occasionally happens at night.
- /wisp attack - make all wisps on the map hostile.
- /wisp radicalize - create fake "wisp died" events in a random wisp spawning area, turning any wisps there hostile.
- /wisp peace - pacify all wisps on the map.
- /wisp stats - print various counts for wisps on the map.
Other console commands useful for testing:
- /clear - to remove all console messages output.
- /c game.player.insert{name='wisp-yellow', count=100} - add stack of wisps to place from inventory for whatever testing.
- - Use with other mod entities to test them out, e.g.: wisp-red, wisp-purple, UV-lamp, wisp-detector, wisp-drone-blue-capsule.
- /c game.forces.player.chart(game.player.surface, {{x = -800, y = -800}, {x = 800, y = 800}}) - chart bunch of stuff around starting position.
- /c game.surfaces.nauvis.pollute(game.player.position, 9000) - create pollution spreading from current position (affects spawns).
Can also heavily recommend using Time Tools mod when debugging this one, as it allows to speed-up/slow-down time, pause it, and enable/disable "always day" mode via small on-screen panel easily.
It's especially useful with /cheat command, which otherwise enables "always day" mode, preventing wisps from spawning under default config.
Wisps currently use two forces, switching between these (unless disabled) on aggression towards them:
- "wisp" - always peaceful, but can be targeted (incl. by defences) if enabled in mod options.
- "wisp_attack" - always hostile towards player factions.
When wisp unit is killed, other units in the area (configurable via mod options) switch to wisp_attack force and thus become hostile and a valid target for turrets as well.
UV lamps deal damage from "wisp" force, which is checked and causes no retaliation.
Purple wisps are not really units, but rather long-lasting "smoke-with-trigger" poison clouds.
Wisps deal "corrosion" damage type, which is added by the mod.
Resistance to it is set for all prototypes in data-final-fixes.lua, depending on their category/name.
There are several separate algos for spawning wisps:
- Near player - finds trees around players and puts wisps there.
- On map - scans map for forested chunks during in-game day and spawns wisps there at night, depending on pollution level.
- Congregations - same as previous, but spawns whole group of green wisps to wander around players buildings.
- Death/mining - trees, rocks have chances to spawn wisps, while dead wisp units spawn purple wisps.
- Damage trigger on red wisps - spawns +1 red with some chance. Chance-check is actually made on spawn to kill or keep spawned wisp.
LuaRemote interfaces
Any of these interfaces can be used to interact with mechanics of this mod from other mods at any time.
Checks are made to ensure that this mod was initialized when they're called (i.e. if it's done before first game tick), and that all passed entities are valid, as otherwise call shouldn't be relevant anyway and will be ignored. Various numeric value ranges are not checked though, so maybe clamp those before passing through from other calculations.
These interfaces are probably not well-tested, but relatively simple wrappers for mod internals used elsewhere, so should hopefully be relatively bug-free anyway, and any issues should likely be immediately apparent when making the call.
Checks are made to ensure that this mod was initialized when they're called (i.e. if it's done before first game tick), and that all passed entities are valid, as otherwise call shouldn't be relevant anyway and will be ignored. Various numeric value ranges are not checked though, so maybe clamp those before passing through from other calculations.
These interfaces are probably not well-tested, but relatively simple wrappers for mod internals used elsewhere, so should hopefully be relatively bug-free anyway, and any issues should likely be immediately apparent when making the call.
- wisps.uv - interface to control anti-wisp UV lights mechanics.
- emit_start(entity [,range, [, energy_high [, energy_low]]])
Registers entity as a standard UV-lamp, like ones in this mod, to repel wisps.
Effective range value (in tiles) is optional, and will default to UV lamp ranges in this mod, configurable via mod settings.
Optional energy high/low limits are compared to entity.energy value, if specified, and if it's between these, then effectiveness is reduced in a linear fashion - i.e. in the middle = 50%.
If neither limit is specified, effectiveness is always 1 (100%) and entity.energy is not checked in any way.
If only energy_high is specified, energy_low defaults to 0.
There should be no need to call anything else for new/modded UV lamps - just register them via this call when built/created (with optional energy bounds), and if they later get destroyed/removed/invalid, they'll get auto-cleaned-up from tracking in this mod.
Do not use this call multiple times on the same entity - use emit_stop() + emit_start() to change range/energy values.
- emit_stop(entity_or_unit_number)
Unregister entity or unit_number (as in entity.unit_number) from known UV-light sources.
This does not need to be called for removed or destroyed entities, as they're "forgotten" by this mod automatically, only if you want for existing in-game entities to stop having this effect.
- emit_once(entity [, range [, effectiveness]])
Make wisps flee from specified entity and cause damage to them, in the same way as UV lamps in this mod do.
Range defaults to same as UV lamps in the mod (configurable), and effectiveness to 1.0 (=100%).
Can be used to make a custom UV-emitting effect on wisps in the mod, i.e. add this to a weapon, ammunition, any kind of event, etc.
Should be easier to use emit_start() instead for a simple custom lamp entities.
- emit_start(entity [,range, [, energy_high [, energy_low]]])
- wisps.control - misc interfaces to interact with wisp entities from this mod.
- get_entity_names()
Returns a list/table like `{'wisp-red', 'wisp-yellow', 'wisp-green', ...}` with names of all entities currently used by this mod.
- find_units(surface, position, range)
Get list/table of unit-like wisp entities in a range around specified position.
- find_spores(surface, position, range)
Returns list/table of purple wisps in a range around specified position.
Separate from find_units() because these have somewhat different properties from red/yellow/green wisps, i.e. can't be controlled like units, don't have normal attack, cannot be targetted with weapons, etc.
- create(name, surface, position[, angry[, ttl]])
Create a wisp with a specified name (e.g. from get_entity_names() list) at or near specified position.
Any non-nil value for optional "angry" argument will spawn a hostile wisp, if these are allowed by the mod settings.
"ttl" - time to live - is a time in factorio ticks after which wisp will disappear on its own, and defaults to a slightly-randomized value specific to each wisp type.
- get_entity_names()
- remote.call('wisps.uv', 'emit_start', my_mod_entity)
- remote.call('wisps.control', 'create', 'wisp-yellow', player.surface, player.position)