Page 1 of 1

game.evolution_factor - 0.15

Posted: Sat Apr 29, 2017 9:46 pm
by TheSAguy
Hi,

It's been a really long time since I've been doing any Factorio modding.
I'm back now that 0.15 is out and am trying to update my mods.

seems like "game.evolution_factor" has changed.
Can someone please point me where to go look up functions/changes in 0.15?

How should I adjust the below:

Code: Select all

if game.evolution_factor > 0.995 then
and

Code: Select all

Bio_Cannon.surface.set_multi_command{command = {type=defines.command.attack, target=Bio_Cannon, distraction=defines.distraction.by_enemy},unit_count = math.floor(100 * game.evolution_factor), unit_search_distance = 500}
Thanks!!

Re: game.evolution_factor - 0.15

Posted: Sat Apr 29, 2017 10:07 pm
by steinio
Hi,

evolution factor is moved to the corresponding force: http://lua-api.factorio.com/0.15.4/LuaF ... ion_factor

So it's now something like game.forces["enemy"].evolution_factor.

Greetings, steinio.

Re: game.evolution_factor - 0.15

Posted: Sun Apr 30, 2017 1:23 pm
by TheSAguy
Thanks Steinio,

Ironically, I asked for this change.

Re: game.evolution_factor - 0.15

Posted: Tue May 02, 2017 7:57 pm
by TheSAguy
Okay, need a little help again.
With 0.14, I used the below to reduce the evolution factor of the game with my terraforming Stations:

Code: Select all

game.evolution_factor = game.evolution_factor - reduction
Where 'reduction' was a calculated value.

I updated this code to:

Code: Select all

game.forces.enemy.evolution_factor = game.forces.enemy.evolution_factor - reduction
But it does not seem to reduce the evolution. At least not according to EvoGUI.

How should I now reduce the global evolution factor?

Also, how do I adjust the in game evolution factor?
I tried: /c game.forces.enemy.evolution_factor = .4
But according to EvoGUI, that did nothing, though I did not get an error.
Thanks.

Re: game.evolution_factor - 0.15

Posted: Wed May 03, 2017 3:01 pm
by Kaeltis
I never did any modding for factorio, but with a bit of trial and error I found there are evolution factors for all 3 forces "player", "enemy" and "neutral".

/evolution seems to read the "enemy" evolution factor, EvoGUI however reads the evolution factor of "player"

I've just set all factors to the same value and it seems to work, I don't know if that has any other side effects though

Code: Select all

/c for k,v in pairs(game.forces) do v.evolution_factor = .4 end

Re: game.evolution_factor - 0.15

Posted: Wed May 03, 2017 3:50 pm
by orzelek
Kaeltis wrote:I never did any modding for factorio, but with a bit of trial and error I found there are evolution factors for all 3 forces "player", "enemy" and "neutral".

/evolution seems to read the "enemy" evolution factor, EvoGUI however reads the evolution factor of "player"

I've just set all factors to the same value and it seems to work, I don't know if that has any other side effects though

Code: Select all

/c for k,v in pairs(game.forces) do v.evolution_factor = .4 end
Main question would be which one game actually uses when enemies are spawned - I think that EvoGUI might need an update then to use it. Most likely it would be the enemy force one.

Re: game.evolution_factor - 0.15

Posted: Wed May 03, 2017 4:08 pm
by TheSAguy
orzelek wrote:
Kaeltis wrote:I never did any modding for factorio, but with a bit of trial and error I found there are evolution factors for all 3 forces "player", "enemy" and "neutral".

/evolution seems to read the "enemy" evolution factor, EvoGUI however reads the evolution factor of "player"

I've just set all factors to the same value and it seems to work, I don't know if that has any other side effects though

Code: Select all

/c for k,v in pairs(game.forces) do v.evolution_factor = .4 end
Main question would be which one game actually uses when enemies are spawned - I think that EvoGUI might need an update then to use it. Most likely it would be the enemy force one.
Okay, so just doing some quick testing, it does seem like the game uses "enemy" to determine the units to spawn.
But If a player builds a Spawner, or converts a spawner (my mod allows this), then it uses the "Player" value.

No idea what neutral will do.

Now I'm wondering how to use this in my mod...
Do I increase and decrease all, or just enemy...

Also, EvoGUI will probably need to be updated to show enemy, or all 3.

Re: game.evolution_factor - 0.15

Posted: Wed May 03, 2017 8:15 pm
by Narc
TheSAguy wrote:No idea what neutral will do.
Control the spawners owned by the neutral force, of course. You can make your own forces, too. And give entities to other forces as desired.