New Game and Migration Scripts in Data Lifecycle

Place to report issues and suggest improvements to the API documentation.
Post Reply
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 278
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

New Game and Migration Scripts in Data Lifecycle

Post by Muppet9010 »

When starting a new game with a mod enabled the mods migration scripts aren't run.
The Data Lifecycle diagram doesn't seem to distinguish the difference between a new game starting with the mod active and the mod being added to a save.
Capture.PNG
Capture.PNG (39.07 KiB) Viewed 301 times
There also isn't any wording to this effect that I can see in the Data Lifecycle page.
https://lua-api.factorio.com/latest/aux ... cycle.html



The Migrations page also mentions what happens when you add a mod to an existing save, but not that when you start a new game all existing migrations are marked as having already run.
https://lua-api.factorio.com/latest/aux ... 20be%20run



This does have appeared to have caused some confusion for someone before as well.
viewtopic.php?f=25&t=108540

Bilka
Factorio Staff
Factorio Staff
Posts: 3139
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: New Game and Migration Scripts in Data Lifecycle

Post by Bilka »

Thank you to justarandomgeek for confirming this. Quoting them:

it collects the list of what exists at the time it makes the Map, so starting a new game from a scenario taht doesnt' have map data in it will grab the current list as baseline, so it won't find any new ones on that load. then after that it will always run any that exist that the saved map doesn't have listed. (see Map::generateData and Scenario::setupLuaContext )
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Documentation Improvement Requests”