I'm reading conflicting reports. https://lua-api.factorio.com/latest/Migrations.html indicates the entire purpose of the migrations API is to fix things when you do have to change the prototype of an item (in my case, a generator to a burner-generator). But every example I can find is only for prototypes that got renamed, but did NOT have their base type changed. Further more, https://wiki.factorio.com/Tutorial:Modd ... Migrations seems to indicate that changing the type of a prototype (so, type=generator -> type=burner-generator) is not possible.
Which is it? And how would I write a migration for a generator becoming a burner-generator?
[0.17->0.18] Prototype change migration not possible?
Re: [0.17->0.18] Prototype change migration not possible?
Changing type of an entity will do migration implicitly (no need for you to explicitly define migration definition nor migration script).
Re: [0.17->0.18] Prototype change migration not possible?
Ok. Then how do I go about fixing the real problem I have: my reactors are fueled with u238 (I made it a fuel category back in .17) and when I migrate to .18, the reactors all have their fuel removed. How do I get the fuel to move over into the new reactors?
Re: [0.17->0.18] Prototype change migration not possible?
Well, to do that, you need to keep the old prototype, create new one under different name, and add migration script (Lua migration) that finds all entities of the old type, gets whatever info it needs to migrate them and then replace them with entity of the new type.
Re: [0.17->0.18] Prototype change migration not possible?
You should be able to just add a json migration for the old to new entity name and it will fast-replace transfer the contents from the old to the new.
If you want to get ahold of me I'm almost always on Discord.
Re: [0.17->0.18] Prototype change migration not possible?
Implicit cross-type migration does fast-replace transfer too, afaik. But generator and burner-generator are not fast replacable.