Page 1 of 1

[Solved]Migrating from an abandoned mod - name changes

Posted: Mon Sep 14, 2020 1:43 am
by gmyx
I am currently writing a mod that replaces an abandoned mod. In the new mod some technology, recipe, entity and item names are changed. I did this since there was no consistency and made it harder to write generic code.

I want to migrate existing saved games but can't find any information on this. I've tried control.lua on_configuration_changed and migrations but neither allow me to access the old mod's info.

Is there any way to read during the save game load the old mod's info?

Thanks for the help!

Re: Migrating from an abandoned mod - name changes

Posted: Mon Sep 14, 2020 1:50 am
by eradicator
What you describe sounds like a standard migration. Why do you need to read the other mods "info"? What "info" are you even talking about?

Also with that kind of inheritance you should declare an "! old_mod_name" incompatibility in info.json to prevent both mods from loading at once - at which point there *is* no old information you could read at all.

Re: Migrating from an abandoned mod - name changes

Posted: Mon Sep 14, 2020 10:43 pm
by gmyx
Thanks. That is what I thought. I tried migration but the code didn't seems to even run. Will try it again, I might of missed something.

For the 'info', I mean the technologies, recipies, etc.

And yes, I did add the '!' dependency. That works nicely.

Re: Migrating from an abandoned mod - name changes

Posted: Mon Sep 14, 2020 11:58 pm
by gmyx
migration JSON is what I needed. It is working now. Thanks!