Page 1 of 1

Migrating Entity Types

Posted: Thu Dec 18, 2014 4:37 pm
by chriscisco
Hey,

I changed one of the types of my entity from decorative to simple-entity to solve a crash that occurs when placing the entity on top of the player, however this breaks old saves. Is there a way to migrate types like names can be migrated?

Thanks

Re: Migrating Entity Types

Posted: Thu Dec 18, 2014 9:12 pm
by L0771
https://forums.factorio.com/forum/vie ... 749#p21749

No one said the last-entity must be the same type of the first.

Re: Migrating Entity Types

Posted: Thu Dec 18, 2014 9:35 pm
by drs9999
L0771 wrote:No one said the last-entity must be the same type of the first.
Yes afaik you can use migration script to change types, however if I'm not misleading the new entity has to be renamed.
E.g. convert entity "foo"; type "furnace" to entity "bar"; type "chest" is fine, but converting entity "foo"; type "furnace" to entity "foo"; type "chest" is not.

And if i'm also not misleading kovarex said that they use this (to fix this) as a test for the people how applied for a job. So this might be fixed sooner than later...

Re: Migrating Entity Types

Posted: Fri Dec 19, 2014 2:27 am
by chriscisco
Alright, since I am not renaming the entity I will just leave it as is and break old save games, luckily my mod is in very early development so this is a risk people will take, in the future I will not change the type of entity unless I am either renaming the entity or there is a way to do it.

I do not suppose I could do it with data.raw in the migration lua?