Need help with my mod (reload recipes and technologies]

Place to get help with not working mods / modding interface.
Post Reply
BOFan80
Inserter
Inserter
Posts: 23
Joined: Thu Apr 21, 2016 6:44 pm
Contact:

Need help with my mod (reload recipes and technologies]

Post 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
please notice that my natove language is german, so my english is not so good. Thx

BOFan80
Inserter
Inserter
Posts: 23
Joined: Thu Apr 21, 2016 6:44 pm
Contact:

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

Post 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
please notice that my natove language is german, so my english is not so good. Thx

Post Reply

Return to “Modding help”