modify existing recipe

Place to get help with not working mods / modding interface.
grobyc
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sat Apr 27, 2013 8:49 am
Contact:

modify existing recipe

Post by grobyc »

I have write some mod, create recipe run game, and play with it.
Now I want modify it and add to technology tree. I do this and problem was appeared.
When I start new game item require technology first and recipe is modify.
When I load old save, item doesn't require technology and recipe use old materials.

Any clue what to do with this?
ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: modify existing recipe

Post by ficolas »

the title tells me what you need is this:
https://forums.factorio.com/forum/vie ... =25&t=1221

And with the text I think that what you need to do is to reload the recipes in old saves
To do that you need to use:

game.player.forze.recipes["the recipe name"].reload()
grobyc
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sat Apr 27, 2013 8:49 am
Contact:

Re: modify existing recipe

Post by grobyc »

Already done it by creating migration file in mod, good to knew alternative.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: modify existing recipe

Post by kovarex »

ficolas wrote: And with the text I think that what you need to do is to reload the recipes in old saves
To do that you need to use:

Code: Select all

game.player.force.recipes["the recipe name"].reload()
This is better than

Code: Select all

game.player.force.reloadrecipes();
Because soon(er or later), we will start modifying recipe of players (technology to make some recipes cheaper for example).
This way you would revert all these kind of changes.
Post Reply

Return to “Modding help”