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

How to make a mod to remove an item

Noisy Pants

Refugee
I would like to know what line I need to type to remove an item from the game in a mod file so I won't have redundancies, I think it would start with "<remove property name=...". Anyone know?

- - - Updated - - -

here's my problem, i made a mod to get more out of my lead and now i have two bullet tip options which i don't want.

Code:
<config>
<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>
</config>
 
I would like to know what line I need to type to remove an item from the game in a mod file so I won't have redundancies, I think it would start with "<remove property name=...". Anyone know?
- - - Updated - - -

here's my problem, i made a mod to get more out of my lead and now i have two bullet tip options which i don't want.

Code:
<config>
<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>
</config>
I think maybe you want '<set xpath=' in place of append. That way you can adjust the item directly.

like:

Code:
<set xpath="/recipes/recipe[@name='foodBaconAndEggs']">
<ingredient name="foodEgg" count="2"/>
<ingredient name="foodRawMeat" count="1"/>
</set>
That way it will just override the vanilla one and use your new one.

example for item as well:

Code:
<set xpath="/items/item[@name='foodBaconAndEggs']">
<property name="HoldType" value="31"/>
<property name="DisplayType" value="food"/>
<property name="Meshfile" value="Items/Misc/parcelPrefab"/>
<property name="DropMeshfile" value="Items/Misc/sack_droppedPrefab"/>
<property name="Material" value="Morganic"/>
<property name="Stacknumber" value="50"/> <!-- STK food -->
<property name="EconomicValue" value="72"/>
<property class="Action0">
	<property name="Class" value="Eat"/>
	<property name="Delay" value="2.1"/>
	<property name="Use_time" value="..."/>
	<property name="Sound_start" value="player_eating"/>
</property>
<property name="Smell" value="largeSmell"/>
<property name="Group" value="Food/Cooking"/>

<effect_group tiered="false">
	<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="$foodAmountAdd" operation="add" value="40"/>
	<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="foodHealthAmount" operation="multiply" value="34"/>
	<triggered_effect trigger="onSelfPrimaryActionEnd" action="AddBuff" target="self" buff="buffProcessConsumables"/>
</effect_group>
</set>
 
Last edited by a moderator:
so here is the code i used without errors loading that does not work:

Code:
<set xpath="/recipes/recipe[@name='resourceBulletTip']" count="50" craft_area="forge" craft_tool="toolAndDieSet" material_based="true" tags="learnable">
			<ingredient name="unit_lead" count="1"/>
			<ingredient name="unit_clay" count="1"/>
		</set>
[/CODE]
I'm using this, which works but it shows two bullet tips options:

Code:
<recipe name="resourceBulletTip" count="50" craft_area="forge" craft_tool="toolAndDieSet" material_based="true" tags="learnable">
			<ingredient name="unit_lead" count="1"/>
			<ingredient name="unit_clay" count="1"/>
		</recipe>
modgoof.jpg

 
Give me a bit, Im going to see if I can't get someone on this. I need to learn this more as well lol.

 
Code:
<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>
use that.

Srry I should have tested that out first but I figured it out. the above works.

edit: obviously you can change the other values as you need. ;)

 
Last edited by a moderator:
Okay since nobody is actually answering your question, I will.

The code you want in your recipes.xml is

Code:
<remove xpath="/recipes/recipe[@name='resourceBulletTip']"></remove>
with this BELOW it, anywhere below but this part needs to come after the </remove> bit of the code above:

Code:
       <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>
Some warnings (which come after the spells):

1. If there are multiple recipes (like resourceGlue) you'll need one <remove>*Glue*</remove> code for each one in the base game.

2. If you try to remove something that is not in the game (as in maybe you removed it 3 times and there were only two) it will error out your mod and stop it from loading the rest of whichever XML is messed up.

3. (not for recipes but) If you remove a block or item that "Extends" another item your game will freak out and stop your mod from loading. You need to <remove> and <append> all blocks, sub blocks, and dependent items in a series.

4. This is the WORST way to mod anything that is not a recipe. This is the fastest way to change recipes but will most likely break your game if used in any other XML.

5. This only applies to making changes to existing code. Anything you add is a lot more flexible.

Sorry for the long post

 
The reason I did it that way, is because he didn't need to remove anything, just change values. No reason to be indignant about it. lol

 
I didn't mean to come across indignant. I only meant that the OPs question went unanswered. I gave him the answer to the question he asked. You gave him a solution to a problem. Your contribution is greater than mine but I had to make sure he knew two ways to do it JIC

 
I didn't mean to come across indignant. I only meant that the OPs question went unanswered. I gave him the answer to the question he asked. You gave him a solution to a problem. Your contribution is greater than mine but I had to make sure he knew two ways to do it JIC
haha, it did come across as being such. I was all like :mask:

But your answer was good because you gave him another option to look at.

also, I screwed up my initial response to him... :(

anyhow. Sorry. I sometimes read into thing too much, and sometimes get it wrong. :nevreness:

 
The error is mine. I was in a foul humor when I made the first post. Sometimes I get extra ♥♥♥♥ about things that I don't need to stress over. Thank you for being understanding. I'm still new to forums in general and I forget inflection doesn't translate well in written text.

 
Holy crap folks, it was my fault. I'm practicing to be a sith apprentice and sometimes my sessions go awry.
I agree. It's Guppy's fault. He is a cult leader, by his own admission. :playful:

 
Code:
<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>
use that.

Srry I should have tested that out first but I figured it out. the above works.

edit: obviously you can change the other values as you need. ;)
I tried this and no go, here is the code:

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>

		<recipe name="ammo44MagnumBulletSteel" count="1" craft_area="workbench" tags="learnable">
			<ingredient name="resourceBulletTip" count="1"/>
			<ingredient name="resourceGunPowder" count="1"/>
			<ingredient name="resourceBulletCasingSteel" count="1"/>
		</recipe>

		<recipe name="ammo762mmBulletFMJ" count="1" craft_area="workbench" tags="learnable">
			<ingredient name="resourceBulletTip" count="1"/>
			<ingredient name="resourceGunPowder" count="1"/>
			<ingredient name="resourceBulletCasing" count="1"/>
		</recipe>

		<recipe name="ammo762mmBulletFMJSteel" count="1" craft_area="workbench" tags="learnable">
			<ingredient name="resourceBulletTip" count="1"/>
			<ingredient name="resourceGunPowder" count="1"/>
			<ingredient name="resourceBulletCasingSteel" count="1"/>
		</recipe>

		<recipe name="ammoCrossbowBoltExploding" count="1" craft_area="workbench" tags="learnable">
			<ingredient name="resourceArrowHeadSteelAP" count="1"/>
			<ingredient name="resourceGunPowder" count="2"/>
			<ingredient name="resourceDuctTape" count="1"/>
			<ingredient name="resourceWood" count="1"/>
			<ingredient name="resourceFeather" count="1"/>
		</recipe>

	</append>
</config>
[/CODE]
lead1.jpg

 
I am very appreciative of the information Tin and Belgeranrg provided, thank you. I want to go with Tin's idea after all if the kinks can be ironed out.

 
Last edited by a moderator:
Back
Top