Page 1 of 1

Expand ConfigurationChangedData with migrated prototype names

Posted: Mon Apr 21, 2025 7:10 pm
by Stringweasel
What
Expand ConfigurationChangedData with a table containing any prototype migrations that occured due to the json migrations.
Why
This is to support mods that need to save prototype names in `storage` that would need to be migrated. Especially for, things like SignalID. There's no way to migrate these correctly, the only information that's available is that the initial prototype name no longer exists.

The specific use case is in Space Exploration our spaceships behave just like trains, and also have circuit wait conditions. We of course store the signals to use for the condition as SignalID, but that means that when an internal prototype changes name those SignalIDs will no longer be valid. And from 1.1 to 2.0 there are many prototype name changes. K2 decided to prefix all it's prototypes with `kr-`, and SE itself also changes a lot of names, not to even mention vanilla changes, mods being forked into 2.0, etc. That means that when players migrate their 1.1 SE saves to 2.0 there might be many spaceships whose wait conditions are longer valid. And it would be really annoying for the player to track them down, remembering what it's supposed to be, and fixing them all.
How
It can essentially just be the table from the json file in lua form. The prototype type should be there, as well as the name before and the name after.

Re: Expand ConfigurationChangedData with migrated prototype names

Posted: Tue Jul 01, 2025 7:33 pm
by Harag
The same goes for train logistics mods, for example LTN and Cybersyn. Without a way to know what the new names are the only course of action is to purge invalid data, stop affected trains and inform players that they need to deal with those trains manually.

With this interface change it would be possible to rename internal data and silently continue.

Re: Expand ConfigurationChangedData with migrated prototype names

Posted: Tue Jul 01, 2025 8:32 pm
by tetlanesh
This will be super usefull for any mod that need to store item/signall information. Both for current Cybersyn and upcoming Cybersyn2 where the same issues arise with migrations.

Re: Expand ConfigurationChangedData with migrated prototype names

Posted: Tue Jul 01, 2025 9:50 pm
by boskid
Added for 2.0.59.