prototypes migrations in lua migration

Place to get help with not working mods / modding interface.
xkyouchoux
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon Oct 20, 2025 5:19 pm
Contact:

prototypes migrations in lua migration

Post 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
robot256
Smart Inserter
Smart Inserter
Posts: 1311
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: prototypes migrations in lua migration

Post 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.
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
Post Reply

Return to “Modding help”