Migration Script not working
Posted: Sun May 21, 2017 3:48 pm
Code: Select all
for i, player in ipairs(game.players) do
player.force.reset_recipes()
player.force.reset_technologies()
player.force.recipes["flame-shotgun-shell"].enabled = player.force.technologies["military-4"].researched
player.force.recipes["uranium-cannon-shell"].enabled = false
player.force.recipes["atomic-rocket"].enabled = player.force.technologies["atomic-bomb"].researched
if (player.force.technologies["flamethrower"].researched) then
player.force.recipes["flamethrower-ammo-crude"].enabled = true
player.force.recipes["flamethrower-ammo-petrol"].enabled = true
end
end
The only part of this that works is the flamethrower-ammo-petrol part, the rest seems to do nothing.
I am certain I have the recipe names correct, and the tech names. I cannot understand what exactly is going on here.