I'm trying to understand how to deal with new mods on an existing map, that aren't my mod, but which have caused my mod to produce new recipes when factorio is initially started, or restarted when players update/add/delete mods.
As I understand it:
- Launch factorio
- Mods can alter data.raw tables in 3 separate phases
- factorio loads data.raw into (mostly) read-only storage
- user starts new game or loads saved game
- If the user has added a mod previously unused in the saved game, or a mod has been updated, then the mod's migration script runs. The migration script can force rebuilding of some data.raw structures, by calling built-in functions like reset_recipes for example.
- How can my mod, which looks for all installed mods at the data stage and builds recycling recipes for those mods, add any new recipes into the saved game if a user has just started using a new mod? My mod hasn't changed, so my migration script won't run.
- It looks as I could use this: http://lua-api.factorio.com/latest/LuaB ... on_changed but if I create a function, when is my function called in the bootstrap please?
- Is it really going to be as easy as having a function that just calls reset_recipes?