Data Lifecycle - Migrations - called expansion needed

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Data Lifecycle - Migrations - called expansion needed

Post by Nexela »

Firstly Thank you for adding data lifecyle to the the API for quick reference

Can the http://lua-api.factorio.com/latest/Data-Lifecycle.html #2 migrations section be expanded to list when the migration files are run (not scope as that is listed, but when they are called to run). similar to how the on_init and on_config_changed etc events are listed

This is somewhat addressed when you follow the migrations link to http://lua-api.factorio.com/latest/Migrations.html "Migrations are a way to fixup a save file which was used in an older version of the game or mod"

Since I am not in a spot to test tonight and I have the memory of zombie and I am at a point where I will need migrations in a mod.. I am not sure if this means
A. Migrations are run before on_init/configuration_changed - on "new" or "existing" worlds
B. Migrations are run before on_init/configuration_changed - but only on "existing" worlds -- This is my guess as it would be consistent with how on_configuration_changed works
C. Migrations are run before on_configuration_changed - i.e. only if the mod was previously installed
D. Some other option


Also TYPO in http://lua-api.factorio.com/latest/Data-Lifecycle.html "2. Migrations"
migration haves been applied.
should possibly be
migrations have been applied
Danielv123
Inserter
Inserter
Posts: 48
Joined: Sun Jan 03, 2016 10:28 am
Contact:

Re: Data Lifecycle - Migrations - called expansion needed

Post by Danielv123 »

Migrations only run on worlds that was last ran with an older version of the mod. It does not run on newer versions and they only run once.
Post Reply

Return to “Modding interface requests”