Expand ConfigurationChangedData with migrated prototype names

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
Stringweasel
Filter Inserter
Filter Inserter
Posts: 449
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

Expand ConfigurationChangedData with migrated prototype names

Post 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.
Alt-F4 Author | Factorio Modder
Probably known for: (Configurable) Valves | Better Victory Screen | Space Spidertron | Fluidic Power
Official Contributor to Space Exploration
Post Reply

Return to “Modding interface requests”