[0.17.35] API - Technology on researched state change enables technology
Posted: Fri May 03, 2019 1:31 pm
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:
But this pseudo code disables the tech after un-researching it.
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
Code: Select all
local tech = game.forces["player"].technologies["my-tech"]
tech.level = 1
tech.researched = false
tech.enabled = false