How can I mod something to require Leather?

Started by Thundercraft, November 15, 2016, 11:43:21 AM

Previous topic - Next topic

Thundercraft

For personal use, I tried to mod Right Tool For The Job so that the toolbelts required leather as an ingredient.

I do realize that the game has a variety of hides, furs, skins and leathers. But I was under the impression that there may be some way to define a recipe to use any type of leather (or a generic definition of leather). Am I wrong?

I found "Leathers" defined as an <ingredient> in Recipes_loom.xml in the Vegetable Garden mod. And I found "Leathery" referenced several times in the vanilla files, such as between the <stuffCategories> tags for Apparel_Hats.xml.

In RTFTJ-ToolRecipes.xml, I added the following in between the <ingredients> tags:
<li>
<filter>
<thingDefs>
<li>Leathers</li>
</thingDefs>
</filter>
<count>40</count>
</li>


As soon as I enabled the modified RTFTJ mod, it spat out errors:
"Could not resolve cross-reference to Verse.ThingDef named Leathers"

I also tried it with "Leathery", but it gave a very similar result.

skullywag

Category not thingdef in the filter tags, thingdef is singular thing. Check a core recipe theres plenty of examples.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

kaptain_kavern

You can find a commented dummy recipes file here. (And thanks Dingo for that).

Also you can look in Core folder there is a file where category are specified plainly in a file (I don't recall how it's written exactly)

JadedApprentince

You will have to open the actual file and edit the XML code to change the recipe requirements. I've never had to try and use leathers or anything with multiple subitems for modded items, so I don't know how you would put it in, but you will have to add them as a requirement for the recipe cost.
Mods I've made:
Combat Extended Artillery :  https://ludeon.com/forums/index.php?topic=33979.0