[0.11.21] Trying to research when game isn't initialised

Bugs that are actually features.
vedrit
Filter Inserter
Filter Inserter
Posts: 293
Joined: Sun Aug 03, 2014 2:25 am
Contact:

[0.11.21] Trying to research when game isn't initialised

Post 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
Last edited by vedrit on Sat Apr 18, 2015 5:47 am, edited 1 time in total.
vedrit
Filter Inserter
Filter Inserter
Posts: 293
Joined: Sun Aug 03, 2014 2:25 am
Contact:

Re: Trying to research when game isn't initialised

Post by vedrit »

Just noticed this was posted in the wrong area
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: [0.11.21] Trying to research when game isn't initialised

Post by cube »

Moved, but i'm not sure this is a real bug :-)
Rseding91
Factorio Staff
Factorio Staff
Posts: 16423
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.11.21] Trying to research when game isn't initialised

Post 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.
If you want to get ahold of me I'm almost always on Discord.
kovarex
Factorio Staff
Factorio Staff
Posts: 8298
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.11.21] Trying to research when game isn't initialised

Post 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.
robertpaulson
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sun Jun 18, 2017 2:21 pm
Contact:

Re: [0.11.21] Trying to research when game isn't initialised

Post 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
Rseding91
Factorio Staff
Factorio Staff
Posts: 16423
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.11.21] Trying to research when game isn't initialised

Post 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.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Not a bug”