Jump to content
bbh_blocked_dnftl

Help, I don't know why I'm getting duplicate items in crafting menu.


Recommended Posts

I changed how much materials required and how much would be produced then put it in the mod folder. It works but I have two craft options for bullet tips.

<set xpath="/recipes/recipe[@name='resourceBulletTip']/@count">50
<!--<recipe name="resourceBulletTip" count="1" craft_area="forge" craft_tool="toolAndDieSet" material_based="true" tags="learnable">-->
<ingredient name="unit_lead" count="2"/>
<ingredient name="unit_clay" count="1"/>
</set>

<remove xpath="/recipes/recipe[@name='resourceBulletTip']"></remove>
	<append xpath="/recipes">

		<recipe name="resourceBulletTip" count="100" craft_area="forge" craft_tool="toolAndDieSet" material_based="true" tags="learnable">
			<ingredient name="unit_lead" count="1"/>
			<ingredient name="unit_clay" count="1"/>
		</recipe>

	</append>

Link to comment
Share on other sites

This alone works:

 <remove xpath="/recipes/recipe[@name='resourceBulletTip']"></remove>
 <append xpath="/recipes">

   <recipe name="resourceBulletTip" count="100" craft_area="forge" craft_tool="toolAndDieSet" material_based="true" tags="learnable">
     <ingredient name="unit_lead" count="1"/>
     <ingredient name="unit_clay" count="1"/>
   </recipe>

 </append>

 

 

Or this alone:

 <set xpath="/recipes/recipe[@name='resourceBulletTip']/@count">100</set>
 <set xpath="/recipes/recipe[@name='resourceBulletTip']/ingredient[@name='unit_lead']/@count">1</set>

Link to comment
Share on other sites

I see you've already asked here: https://7daystodie.com/forums/showthread.php?121531-How-to-make-a-mod-to-remove-an-item

Beware, it's considered bad practice to post duplicates on a forum. :)

From the other post, I see that the problem comes when you put it all together.

 

<config>
 <set xpath="/recipes/recipe[@name='resourceBulletTip']/@count">100</set>
 <set xpath="/recipes/recipe[@name='resourceBulletTip']/ingredient[@name='unit_lead']/@count">1</set>
</config>

Link to comment
Share on other sites

I see you've already asked here: https://7daystodie.com/forums/showthread.php?121531-How-to-make-a-mod-to-remove-an-item

Beware, it's considered bad practice to post duplicates on a forum. :)

From the other post, I see that the problem comes when you put it all together.

 

<config>
 <set xpath="/recipes/recipe[@name='resourceBulletTip']/@count">100</set>
 <set xpath="/recipes/recipe[@name='resourceBulletTip']/ingredient[@name='unit_lead']/@count">1</set>
</config>

 

My apologies, I thought if I restated the question in a different manner I would get a different answer. As of now, I think the problem lies within all my mods possibly conflicting. I'm beyond angry frustrated and miffed.

Link to comment
Share on other sites

I think your problem is with the use of "set" and "append".

 

1. "set" allows you to change a single value, like this:

<config>
 <set xpath="/recipes/recipe[@name='resourceBulletTip']/ingredient[@name='unit_lead']/@count">1</set>
</config>

or to change the content of the whole node, like this:

 <set xpath="/recipes/recipe[@name='resourceBulletTip']">
     <ingredient name="unit_lead" count="1"/>
     <ingredient name="unit_clay" count="1"/>
 </set>

 

However, you can't do both at once like you tried here:

[...]	
	<set xpath="/recipes/recipe[@name='resourceBulletTip']/@count">2
		<!--<recipe name="resourceBulletTip" count="1" craft_area="forge" craft_tool="toolAndDieSet" material_based="true" tags="learnable">-->
		<ingredient name="unit_lead" count="1"/>
		<ingredient name="unit_clay" count="1"/>
	</set		
	[...]

 

And there's a typo: the first "</set" needs a closing angled bracket: >

 

The correct way to do it would be:

[...]
  <set xpath="/recipes/recipe[@name='resourceBulletTip']/@count">100</set>
  <set xpath="/recipes/recipe[@name='resourceBulletTip']">
     <ingredient name="unit_lead" count="1"/>
     <ingredient name="unit_clay" count="1"/>
 </set>		
[...]

 

Or easier:

<config>
 <set xpath="/recipes/recipe[@name='resourceBulletTip']/@count">100</set>
 <set xpath="/recipes/recipe[@name='resourceBulletTip']/ingredient[@name='unit_lead']/@count">1</set>
</config>

 

2. "append" allows you to add something to a node, like this:

<config>
<append xpath="/recipes">	
	<recipe name="resourceBulletTips" count="100" craft_area="forge" craft_tool="toolAndDieSet" material_based="true" tags="learnable">
		<ingredient name="unit_lead" count="1"/>
		<ingredient name="unit_clay" count="1"/>
	</recipe>	
</append>
</config>

But this would add another recipe to the list, like you saw.

 

3. "remove" allows you to remove a whole node, like this:

<remove xpath="/recipes/recipe[@name='resourceBulletTip']"></remove>

Link to comment
Share on other sites

I tried this and no go, here is the code:

<config>
<append xpath="/recipes">

<set xpath="/recipes/recipe[@name='resourceBulletTip']/@count">2
<!--<recipe name="resourceBulletTip" count="1" craft_area="forge" craft_tool="toolAndDieSet" material_based="true" tags="learnable">-->
<ingredient name="unit_lead" count="1"/>
<ingredient name="unit_clay" count="1"/>
</set

<recipe name="ammo44MagnumBullet" count="1" craft_area="workbench" tags="learnable">
<ingredient name="resourceBulletTip" count="1"/>
<ingredient name="resourceGunPowder" count="1"/>
<ingredient name="resourceBulletCasing" count="1"/>
</recipe>
[...]
</append>
</config>[/Code]

[ATTACH=CONFIG]28820[/ATTACH]

 

Furthermore, you can't put a "set" node into an "append" node, the correct way to do both in the same file would be:

[Code]
<config>
<set xpath="/recipes/recipe[@name='resourceBulletTip']/@count">100</set>
<set xpath="/recipes/recipe[@name='resourceBulletTip']/ingredient[@name='unit_lead']/@count">1</set>
<append xpath="/recipes">
<recipe name="ammo44MagnumBullet" count="1" craft_area="workbench" tags="learnable">
<ingredient name="resourceBulletTip" count="1"/>
<ingredient name="resourceGunPowder" count="1"/>
<ingredient name="resourceBulletCasing" count="1"/>
</recipe>
[...]
</append>
</config>[/Code]

 

I hope this helps.

Link to comment
Share on other sites

Furthermore, you can't put a "set" node into an "append" node, the correct way to do both in the same file would be:


<config>
<set xpath="/recipes/recipe[@name='resourceBulletTip']/@count">100</set>
<set xpath="/recipes/recipe[@name='resourceBulletTip']/ingredient[@name='unit_lead']/@count">1</set>
<append xpath="/recipes">
<recipe name="ammo44MagnumBullet" count="1" craft_area="workbench" tags="learnable">
<ingredient name="resourceBulletTip" count="1"/>
<ingredient name="resourceGunPowder" count="1"/>
<ingredient name="resourceBulletCasing" count="1"/>
</recipe>
[...]
</append>
</config>[/Code]

 

I hope this helps.

 

thank you very much, i followed your advice and everything worked; modding 7DtD is difficult for me, i'm learning through videos, google searches and mostly this forum.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...