Page 1 of 1

[0.17.35] API - Technology on researched state change enables technology

Posted: Fri May 03, 2019 1:31 pm
by Muppet9010
If you change the researched state of a technology via API the technology becomes enabled automatically. Either this is a bug or if intended behaviour please confirm and the API documents need updating as this isn't obvious behaviour.

https://lua-api.factorio.com/latest/Lua ... researched

I have a custom multiple level, upgrade-able technology. So like an infinite tech.

If I do the below pseudo code the tech is enabled still after un-researching it:

Code: Select all

local tech = game.forces["player"].technologies["my-tech"]
tech.enabled = false
tech.level = 1
tech.researched = false
But this pseudo code disables the tech after un-researching it.

Code: Select all

local tech = game.forces["player"].technologies["my-tech"]
tech.level = 1
tech.researched = false
tech.enabled = false

Re: [0.17.35] API - Technology on researched state change enables technology

Posted: Sat May 04, 2019 6:27 am
by Rseding91
Thanks for the report. I can confirm that writing the "level" changes the enabled state to true by design. If you don't want it enabled after setting the level you need to do that first, then write enabled.