Page 1 of 1

[1.0.0][Modding] Ghost Lost in Migration When Changing Entity Type

Posted: Sat Oct 03, 2020 3:41 am
by DedlySpyder
If an entity has a ghost placed, then that entity is migrated to an entity with a different type, the normal entities will be mirgated correctly but the ghosts disappear and are not migrated.

I have attached a sample mod to make this happen. The save is from the original run, where I had a "foo" and a "bar" logistic chest. A ghost and real entity of each was created. I then upgraded the version to 0.2.0, migrated "foo" to "qux", which is a container. When this version of the mod is loaded, the foo ghost is not migrated.

From the output it looks almost like the ghost is migrated, but then removed for some reason.

Image

Re: [1.0.0][Modding] Ghost Lost in Migration When Changing Entity Type

Posted: Sat Oct 03, 2020 6:22 pm
by Rseding91
Thanks for the report however that's working as intended. We decided there are too many complications and edge cases to warrant migration logic for ghost entities when their type changes.

There's this line in the code that specifically destroys ghosts that migrate types:
// simplification: ghost owned items for replacing are deleted instead
// there are too many headaches with the setup - destroy calls, etc.

Re: [1.0.0][Modding] Ghost Lost in Migration When Changing Entity Type

Posted: Sat Oct 03, 2020 6:25 pm
by DedlySpyder
Ok, I figured it might be some quirk. Thanks for the update.