[Solved]Migrating from an abandoned mod - name changes

Place to get help with not working mods / modding interface.
gmyx
Inserter
Inserter
Posts: 25
Joined: Sun Jul 13, 2014 1:39 pm
Contact:

[Solved]Migrating from an abandoned mod - name changes

Post 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!
Last edited by gmyx on Mon Sep 14, 2020 11:59 pm, edited 1 time in total.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Migrating from an abandoned mod - name changes

Post 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.
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.
gmyx
Inserter
Inserter
Posts: 25
Joined: Sun Jul 13, 2014 1:39 pm
Contact:

Re: Migrating from an abandoned mod - name changes

Post 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.
gmyx
Inserter
Inserter
Posts: 25
Joined: Sun Jul 13, 2014 1:39 pm
Contact:

Re: Migrating from an abandoned mod - name changes

Post by gmyx »

migration JSON is what I needed. It is working now. Thanks!
Post Reply

Return to “Modding help”