How to handle a new resource or item (used by other mods) ?

Place to get help with not working mods / modding interface.
Val
Inserter
Inserter
Posts: 29
Joined: Sun Jul 19, 2015 7:59 pm
Contact:

How to handle a new resource or item (used by other mods) ?

Post by Val »

I'm thinking on creating a mod, but there is a dilemma I don't know how to solve.

My mod would require a new resource type and a few new items. However, this new resource type is already used in at least one mod. (Fluorine, used by the Uranium Power mod).

I guess the simplest way would be to just not define the new resource and let the resource be defined by the other mod, but I would like my mod to be independent.

What if I define my own Fluoride resource? Would it be in conflict with other mods also defining Fluoride? What about the map generation? Would there be two fluorides, visually identical, but incompatible with each other?

What would be the best way to make my mod independent, but also make it compatible with another mod if it happens that it uses the same new resource or item type?

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: How to handle a new resource or item (used by other mods) ?

Post by Choumiko »

Define the other mod as an optional dependency in info.json. This will cause your data.lua to be loaded after the one from the mod.
You can then check whether Fluorine exists, if it exists, skip defining your own Fluorine, else define it. For this to work the resource/item name have to be the same. After that you can define recipes with Fluorine in it without having to worry about where it comes frome.
I'm not 100% sure it will work, but pretty sure. (Now that's a helpfull sentence :roll: )

Val
Inserter
Inserter
Posts: 29
Joined: Sun Jul 19, 2015 7:59 pm
Contact:

Re: How to handle a new resource or item (used by other mods) ?

Post by Val »

Thank you for the hint!

I'm still at learning the very basics, so it will take some time to get to the point of implementing it, but now at least I have one less worry about the feasibility of my idea.

Post Reply

Return to “Modding help”