Evolution Reduction via Destruction


Have you ever wondered how distroying alien spawners ended up helping the aliens evolve? Or have you ever wanted a way to reduce the alien evolution factor? Or do you sometimes want to be left in peace to build your factories, but find peaceful mode a little too easy? This MOD solves these problems :) Destroying alien bases will reduce alien evolution This MOD is designed to introduce a new difficulty level between Peaceful and Normal

Tweaks
7 years ago
0.13 - 0.14
12

i Re: evolution factor below ZERO may have consequences

8 years ago
(updated 8 years ago)

Just include control.lua with checking if this factor below zero and increase it if needed. For example, up to 1%. Something like:

require "util"

global.evolution_factor_minimum = 0.01

script.on_event(defines.events.on_tick, function()
if game.tick % 10 == 0 then
if game.evolution_factor > global.evolution_factor_minimum and global.minimum_evolution_factor_reached == nil then
global.minimum_evolution_factor_reached = true
end
if game.evolution_factor < global.evolution_factor_minimum and global.minimum_evolution_factor_reached ~= nil and global.minimum_evolution_factor_reached == true then
game.evolution_factor = global.evolution_factor_minimum
end
end
end)

8 years ago
(updated 8 years ago)

Thanks for that info and idea :)

I used the script.on_event(defines.events.on_entity_died, function(event) instead of the tick event and it seams to work well.

New response