Page 1 of 1
prototypes migrations in lua migration
Posted: Mon Oct 27, 2025 2:27 pm
by xkyouchoux
I am looking to see if it is possible to do prototype name migrations, like .json migrations inside of .lua migrations file. Specifically, I want to run prototype migrations only if a specific mod is not installed.
It seems .json migrations run even if its newly added to a save
Re: prototypes migrations in lua migration
Posted: Mon Oct 27, 2025 2:53 pm
by robot256
No, this is not possible. You can use Lua code in a Lua migration to destroy the old entities and make new ones depending on what mods are installed.
But migrations generally are supposed to be for things that happen in your mod alone, since you don't really control when they run. When things need to change based on other mods for compatibility, we generally put in the control stage in on_configuration_changed. That way it can also run if the other mod is added after your mod, for example.