Page 1 of 1

New Game and Migration Scripts in Data Lifecycle

Posted: Fri Dec 29, 2023 7:32 pm
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 633 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

Re: New Game and Migration Scripts in Data Lifecycle

Posted: Sat Feb 03, 2024 3:19 pm
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 )