• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Changing recipe ingredients

bloodlust67

New member
I want to change all armor ingredients using resourceLeather to my new resourceTannedLeather that is made with Soap using Soapwort plants.

I added this to my recipes.xml:

<set xpath="/recipes/recipe[@name='armorFarmerHelmet']/ingredient[@name='resourceLeather']">resourceTannedLeather</set>
<set xpath="/recipes/recipe[@name='armorFarmerHelmet']/passive_effect[@name='CraftingIngredientCount']/tags[@name='resourceLeather']">resourceTannedLeather</set>

It did not apply the second line. Can someone tell me why that is?

Here is the original recipe for a Farmer's Hat:

<recipe name="armorFarmerHelmet" count="1" craft_area="workbench" tags="perkMediumArmor,learnable">
    <ingredient name="resourceArmorCraftingKit" count="1"/>
    <ingredient name="resourceLeather" count="5"/>
    <ingredient name="resourceForgedIron" count="0"/>
    <ingredient name="resourceForgedSteel" count="0"/>
    <ingredient name="resourceLegendaryParts" count="0"/>
    <effect_group>
        <passive_effect name="CraftingIngredientCount" level="2,6" operation="base_add" value="1,5" tags="resourceArmorCraftingKit"/>
        <passive_effect name="CraftingIngredientCount" level="2,3,4,5,6" operation="base_add" value="5,10,15,20,20" tags="resourceLeather"/>
        <passive_effect name="CraftingIngredientCount" level="3,4,5,6" operation="base_add" value="5,10,25,25" tags="resourceForgedIron"/>
        <passive_effect name="CraftingIngredientCount" level="5,6" operation="base_add" value="10,25" tags="resourceForgedSteel"/>
        <passive_effect name="CraftingIngredientCount" level="6" operation="base_add" value="1" tags="resourceLegendaryParts"/>
    </effect_group>
</recipe>

Thanks in advance!

just tried this, and it didn't work either:

<set xpath="/recipes/recipe[@name='armorFarmerHelmet']/effect_group/passive_effect[@name='CraftingIngredientCount']/tags[@name='resourceLeather']">resourceTannedLeather</set>

 
Try this for the second one.

<set xpath="/recipes/recipe[@name='armorFarmerHelmet']/effect_group/passive_effect[@tags='resourceLeather']/@tags">resourceTannedLeather</set>




Or this for a slightly shorter version

Code:
<set xpath="//recipe[@name='armorFarmerHelmet']//passive_effect[@tags='resourceLeather']/@tags">resourceTannedLeather</set>
 
Last edited by a moderator:
Try this for the second one.

<set xpath="/recipes/recipe[@name='armorFarmerHelmet']/effect_group/passive_effect[@tags='resourceLeather']/@tags">resourceTannedLeather</set>




Or this for a slightly shorter version

<set xpath="//recipe[@name='armorFarmerHelmet']//passive_effect[@tags='resourceLeather']/@tags">resourceTannedLeather</set>

Nope that didn't work. I didn't get any "did not apply" messages, but it still shows standard Leather for the recipe in the crafting window, and when I click the resourceTannedLeather it does not show a list of recipes for it.... there has to be a way to dynamically change an ingredient without having to remove every armor recipe that uses leather and replace it with a new recipe using the tanned leather. I'm not the best with XML, I'm more C based 😂 trying to learn it though!

 
<set xpath="//recipe[contains(@name,'armor')]/ingredient[@name='resourceLeather']/@name">foodShamSandwich</set>




should change all instances of armor that use leather to Sham Sandwiches when I tested it

<set xpath="//recipe[contains(@name,'armor')]/effect_group/passive_effect[@tags='resourceLeather']/@tags">foodShamSandwich</set>




should change all instances of quantity modifications to Sham Sandwiches when I tested it

I also tested RevenantWit's first line of code and it did change the value to Sham Sandwich when I made that small change in his code (since I don't have tanned leather).

image.png

 
Last edited by a moderator:
<set xpath="//recipe[contains(@name,'armor')]/ingredient[@name='resourceLeather']/@name">foodShamSandwich</set>




should change all instances of armor that use leather to Sham Sandwiches when I tested it

<set xpath="//recipe[contains(@name,'armor')]/effect_group/passive_effect[@tags='resourceLeather']/@tags">foodShamSandwich</set>




should change all instances of quantity modifications to Sham Sandwiches when I tested it

I also tested RevenantWit's first line of code and it did change the value to Sham Sandwich when I made that small change in his code (since I don't have tanned leather).

View attachment 34040


Thank you! Very much appreciated :)

 
Back
Top