game.evolution_factor - 0.15

Place to get help with not working mods / modding interface.
Post Reply
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

game.evolution_factor - 0.15

Post 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!!

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: game.evolution_factor - 0.15

Post 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.
Image

Transport Belt Repair Man

View unread Posts

TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: game.evolution_factor - 0.15

Post by TheSAguy »

Thanks Steinio,

Ironically, I asked for this change.

TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: game.evolution_factor - 0.15

Post 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.

Kaeltis
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat May 10, 2014 1:04 pm
Contact:

Re: game.evolution_factor - 0.15

Post 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

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: game.evolution_factor - 0.15

Post 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.

TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: game.evolution_factor - 0.15

Post 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.

User avatar
Narc
Filter Inserter
Filter Inserter
Posts: 278
Joined: Mon Feb 11, 2013 7:25 am
Contact:

Re: game.evolution_factor - 0.15

Post 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.

Post Reply

Return to “Modding help”