Page 1 of 1

Migration file order

Posted: Mon Apr 22, 2019 10:37 am
by badtouchatr
As far as I can tell re: migration scripts, ALL json files are run before ANY lua files, regardless of their filenames or version numbers. Can someone verify this?

Re: Migration file order

Posted: Thu Apr 25, 2019 9:54 am
by bobingabout
This is correct.

This is because a JSON file typically replaces entities that no longer exist with a new version, or replacement, which needs to be done before the game is fully initialised.
LUA is run after initialisation.

Re: Migration file order

Posted: Thu Apr 25, 2019 9:59 am
by badtouchatr
bobingabout wrote: Thu Apr 25, 2019 9:54 am This is correct.

This is because a JSON file typically replaces entities that no longer exist with a new version, or replacement, which needs to be done before the game is fully initialised.
LUA is run after initialisation.
Thanks, Bob.

So, if we delete a recipe/item/technology, then there's no way to avoid the migration message for that, because the .json file only does "renames", right?

Re: Migration file order

Posted: Thu Apr 25, 2019 11:01 am
by bobingabout
badtouchatr wrote: Thu Apr 25, 2019 9:59 am
bobingabout wrote: Thu Apr 25, 2019 9:54 am This is correct.

This is because a JSON file typically replaces entities that no longer exist with a new version, or replacement, which needs to be done before the game is fully initialised.
LUA is run after initialisation.
Thanks, Bob.

So, if we delete a recipe/item/technology, then there's no way to avoid the migration message for that, because the .json file only does "renames", right?
it can migrate those too, not just entities, but yeah, there's no way to avoid the migration message.

Re: Migration file order

Posted: Thu Apr 25, 2019 11:09 am
by badtouchatr
bobingabout wrote: Thu Apr 25, 2019 11:01 am it can migrate those too, not just entities, but yeah, there's no way to avoid the migration message.
Thanks for your help and insight on this.