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!
[Solved]Migrating from an abandoned mod - name changes
[Solved]Migrating from an abandoned mod - name changes
Last edited by gmyx on Mon Sep 14, 2020 11:59 pm, edited 1 time in total.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Migrating from an abandoned mod - name changes
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.
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.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Migrating from an abandoned mod - name changes
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.
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
migration JSON is what I needed. It is working now. Thanks!