Page 1 of 1

[15.31] reset_technology_effects()

Posted: Wed Jul 26, 2017 8:34 am
by DutchTed
I'm not sure if this is intentional or not but reset_technology_effects() is also re-enabling technology that has been disabled.

A group of friends and I play a game where one force's entire tech tree is disabled. Their tech is only enabled once another force has researched it. Its a way of slowing down the more experienced players and works well for us as it prolongs the game and makes it more even for us.

What I have noticed is that whenever a mod is updated and reset_technology_effects() is called (in this case from bobplates using on_configuration_changed), all the techs for the disabled force are re-enabled. I'm not sure why this is necessary when it is just a case of resetting the effects in order to enable or disable recipe changes for each tech. Why would a technology need re-enabling just because recipes have been reset? The researched flag is maintained.

This is possible to show with no mods installed via the console:

Code: Select all

/c for name,tech in pairs(game.players[1].force.technologies) do tech.enabled= false end
-- Tech tree is now empty

/c game.players[1].reset_technology_effects()
-- Tech tree is fully enabled again
Thanks in advance.

Re: [15.31] reset_technology_effects()

Posted: Wed Jul 26, 2017 8:54 am
by Klonan
This is fixed in 0.16