Page 1 of 1
[0.11.21] Trying to research when game isn't initialised
Posted: Sat Apr 18, 2015 5:43 am
by vedrit
I updated from 11.19 to 11.21 and tried to load up a save, when it throws the following error:
__tankwerkz__/control.lua:5: Trying to research technology when the game isn't even initialized. (Wrong script usage)
The script:
Code: Select all
for index, force in pairs(game.forces) do
if force.technologies["tanks"].researched then
force.recipes["ex-cannon-shell"].enabled = true
force.recipes["light-tank"].enabled=true
force.technologies["light-tanks"].researched=true <-- Line 5
force.resettechnologies()
end
end
Has the reason for this script changed since 11.19? As far as I can tell, it just checks for technologies to be researched to enable tech added by the mod
Re: Trying to research when game isn't initialised
Posted: Sat Apr 18, 2015 5:47 am
by vedrit
Just noticed this was posted in the wrong area
Re: [0.11.21] Trying to research when game isn't initialised
Posted: Mon Apr 20, 2015 10:44 am
by cube
Moved, but i'm not sure this is a real bug :-)
Re: [0.11.21] Trying to research when game isn't initialised
Posted: Mon Apr 20, 2015 2:42 pm
by Rseding91
cube wrote:Moved, but i'm not sure this is a real bug

It's not - Kovarex specifically added that check in to prevent other issues. Research unlocks should be done in migration scripts and not in the raw control.lua file.
Re: [0.11.21] Trying to research when game isn't initialised
Posted: Mon Apr 20, 2015 3:44 pm
by kovarex
Rseding91 wrote:cube wrote:Moved, but i'm not sure this is a real bug

It's not - Kovarex specifically added that check in to prevent other issues. Research unlocks should be done in migration scripts and not in the raw control.lua file.
Exactly.
Problem of the mod.
Re: [0.11.21] Trying to research when game isn't initialised
Posted: Sat Aug 05, 2017 5:48 pm
by robertpaulson
kovarex wrote:Rseding91 wrote:cube wrote:Moved, but i'm not sure this is a real bug

It's not - Kovarex specifically added that check in to prevent other issues. Research unlocks should be done in migration scripts and not in the raw control.lua file.
Exactly.
Problem of the mod.
i'm making a mod to insert a tech into the tree and i am running the same script in my migration file and it throws the same error
Re: [0.11.21] Trying to research when game isn't initialised
Posted: Sat Aug 05, 2017 6:49 pm
by Rseding91
robertpaulson wrote:i'm making a mod to insert a tech into the tree and i am running the same script in my migration file and it throws the same error
You need to update your game. That error doesn't even exist in the source code as of 0.15.