Page 1 of 1

Need help with my mod (reload recipes and technologies]

Posted: Thu May 05, 2016 8:58 am
by BOFan80
Where is my mistake in this code

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
 
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

Re: Need help with my mod (reload recipes and technologies]

Posted: Thu May 05, 2016 11:51 am
by BOFan80
i found the error.

My misttake was, that i am testing my mod with the same migrations lua. and i never changed the version number, so factorio ignore my migration.

thread can be closed