Page 1 of 1

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

Posted: Sun Aug 16, 2015 3:10 pm
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?

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

Posted: Sun Aug 16, 2015 3:43 pm
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: )

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

Posted: Sun Aug 16, 2015 4:23 pm
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.