Need help with my mod (reload recipes and technologies]
Posted: Thu May 05, 2016 8:58 am
Where is my mistake in this code
the first recipe are in the game with an savegame, but the second not. The second recipe is only available if i start a new game. pls help i am a beginner in modding for factorio and complex mods
Code: Select all
-- Reload recipes and technologies
for i, player in ipairs(game.players) do
player.force.reset_recipes()
player.force.reset_technologies()
end
for index, force in pairs(game.forces) do
-- Generate technology and recipe tables
local tech = force.technologies
local recipes = force.recipes
if tech["circuit-network"].researched then
if recipes["smart-chest-sam"] then
recipes["smart-chest-sam"].enabled = true
end
end
if tech["logistics-2"].researched then
if recipes["fast-transport-belt-sam"] then
recipes["fast-transport-belt-sam"].enabled = true
end
end
end