Receipt change - Save/Load game

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
TomyTheBest
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Jul 11, 2015 6:21 am
Contact:

Receipt change - Save/Load game

Post by TomyTheBest »

HI all,

I had a newbie question about basic mod changes.
I have a few mods added to my library that give me some fabulous new items. I believe the receipt of one of the new item have some issues about the inputs. I found the way to change the receipt, but i realize even if the factorio load all the mods at the start up, the changes works only in new games.
If i load back my previously saved game (where I already made a few items based on the original - presumably wrong - receipt) the requested inputs for the item is same as before. That means for me the 'save' code contains information about the outdated receipt of the already constructed items. At this point I'm stuck.
Do you know any possibility to make the receipt change active in a previously saved game? It works with only the items I never constructed in the saved game before.

Thank you,

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Receipt change - Save/Load game

Post by Nexela »

You need to reset the recipes. you can do it either in a migration lua file or in the on_configuration_changed event in your control.lua or through the command line. The first 2 options require bumping up your version number.

Code: Select all

script.on_configuration_changed(function(event) 
for _, force in pairs(game.forces) do
force.reset_recipies()
end
end)

User avatar
DedlySpyder
Filter Inserter
Filter Inserter
Posts: 253
Joined: Fri Jun 20, 2014 11:42 am
Contact:

Re: Receipt change - Save/Load game

Post by DedlySpyder »

I believe the game automatically triggers reset recipes and technologies, but only if the mod version number changed. Did you only change the recipe, but not increase the version number?

TomyTheBest
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Jul 11, 2015 6:21 am
Contact:

Re: Receipt change - Save/Load game

Post by TomyTheBest »

DedlySpyder wrote: Did you only change the recipe, but not increase the version number?
That is correct.

The removing and copied back mod files are also solved my issue. Even if it is the most barbarian way. :)
I believe I will need to learn a lot about modding in the future.
Thanks for your help guys.

Post Reply

Return to “Modding discussion”