As in the old map display new recipes, for example a new kind of recipe or technology.
which codes change everything, and output in the old map?
As in the old map display new recipes mod
Re: As in the old map display new recipes mod
Добавляй русский перевод к своим постам. Непонятно же ничего.
Тебе походу вот это нужно.
Тебе походу вот это нужно.
kovarex wrote:To make this mod work correctly for existing saves there needs to be added the migration to it.
This is the migration we will have in 0.9.5 to fix the lubricant problem:The migration is special code that is run only when you load save with your mod, that didn't have it before.Code: Select all
game.player.force.resettechnologies() -- The technology is different now, so we need to update the version player has for index, force in pairs(game.forces) do if force.technologies["oil-processing"].researched then -- When the oil processing is already researched, we need to enable the lubricant force.recipes["lubricant"].enabled = true end end
So you should put file in the mod (put it in the migrations folder) that will contain this:Code: Select all
game.player.force.resettechnologies() -- The technology is different now, so we need to update the version player has for index, force in pairs(game.forces) do if force.technologies["oil-processing"].researched then -- When the oil processing is already researched, we need to enable the the recipes it unlocks force.recipes["fill-water-barrel"].enabled = true force.recipes["empty-water-barrel"].enabled = true force.recipes["fill-heavy-oil-barrel"].enabled = true force.recipes["empty-heavy-oil-barrel"].enabled = true force.recipes["fill-light-oil-barrel"].enabled = true force.recipes["empty-light-oil-barrel"].enabled = true force.recipes["fill-petroleum-gas-barrel"].enabled = true force.recipes["empty-petroleum-gas-barrel"].enabled = true force.recipes["fill-lubricant-barrel"].enabled = true force.recipes["empty-lubricant-barrel"].enabled = true force.recipes["fill-sulfuric-acid-barrel"].enabled = true force.recipes["empty-sulfuric-acid-barrel"].enabled = true force.recipes["liquid-station"].enabled = true end end
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.