Page 1 of 1

[14.22] Minor Migration error, Possible sollutions

Posted: Thu Apr 20, 2017 2:09 am
by Nexela
Error is either a frozen loading save bar, or an actual error message Entity ID is not in dictionary

Reproduction ->

In mod Create an entity of any type
Create a game and place the entity in the world
Save
Change the entity to a different TYPE
Change mod version
Save won't load or loads and errors depending on how you try to migrate, no migration is just a loading bar freeze

*******
The problem is not that it isn't allowed, its that the only way to fix it is to either remove the mod or change the entity name or destroy() all before updating mods.
The solution that would be easiest as my best guess would be allowing us to migrate an entity to nothing (remove it from the save all together) allowing us to keep the same entity name for a different type
******

migration.json
{
"entity":
[
["my-name", ""]
]
}

To reproduce easily if needed
https://mods.factorio.com/mods/Nexela/N ... /downloads
download and install 1.7.0
build and place a roboport-interface
save
update to 1.7.3
Save won't load (stuck on loading bar)

Workaround for now is use a different entity name, internal migration will remove the old one

Re: [14.22] Minor Migration error, Possible sollutions

Posted: Thu Apr 20, 2017 6:18 am
by Rseding91
What? I tested out your steps exactly and it loads perfectly.

We fully support migrating entity types with the same name to something else: the game simply removes the old entity and puts the new one in the same place.

Re: [14.22] Minor Migration error, Possible sollutions

Posted: Thu Apr 20, 2017 9:04 am
by Nexela
Ok you are correct about the migration part it should migrate without a problem,

however there is still a bug here and I think I narrowed it down (I disabled all events in my mod for testing)

I think it has to do with migrating from a NOT logistic_cell to a logistic_cell in an existing network

I changed the entity from a radar (1.7.0) to a roboport (1.7.3)

This is without a migration file
If I JUST place my "radar/combinator" entity the game migrates correctly as you said. However if I Add a roboport and my "radar with combinator" onto the map and upgrade the mod the map won't load

[edit] The only difference between migration 2 save and migration 3 save is the addition of a vanilla roboport.

Re: [14.22] Minor Migration error, Possible sollutions

Posted: Thu May 04, 2017 12:46 am
by Rseding91
Thanks for the detailed steps and saves to reproduce the problem :)

I've reproduced it on my end and fixed it for the next version for 0.15.