A tag on spawner type entities that spawn a variety of units having a tag for enabling a simple 'night only' spawn behaviour, and associated parameter (double data type, or whatever makes most sense for referring to the surface's 'darkness' value) as a threshold.
For example, a spitter spawner that spawns special varieties of spitters when darkness is above 0.5 (out of 1.0 being full night time).
Additionally, a unit entity tag for vulnerability to day time with specified threshold and 'effect' result (which may be damage, or slowness, or explosions etc).
[Bilka] Allow optional "night only" and darkness threshold for spawners and units
Re: Allow optional "night only" and darkness threshold for spawners and units
... and then mod them into zombies to turn Factorio into a sciency survival horror game? ![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Re: Allow optional "night only" and darkness threshold for spawners and units
yeah that's the plan. why is that so funny? should be horrifying!
Re: Allow optional "night only" and darkness threshold for spawners and units
You do already have the means to simlate this behaviour. The darkness of a surface can be read with LuaSurface->darkness. When this value reaches a specified limit (check in on_tick) do two things:
- 1) Loop through every spawner on the surface and set it to active = false
2) And either one of these:- Create a giant invisible poison cloud at the center of the map that has a custom damage type which every entity other than your special spitter has a 100% resistance for.
- Or loop through every special spitter and "fast replace" it with a similar entity what has a negative healing_per_tick parameter. (See create_entity fast_replace)
My mods:
Re: Allow optional "night only" and darkness threshold for spawners and units
This is true, great points there 321freddy.
Re: [Bilka] Allow optional "night only" and darkness threshold for spawners and units
Okay, I added EnemySpawnerPrototype::min_darkness_to_spawn and max_darkness_to_spawn for 0.17.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.