Results 1 to 15 of 15

Thread: How to make a mod to remove an item

  1. #1
    Survivor Noisy Pants's Avatar
    Join Date
    May 2018
    Location
    Oklahoma, USA
    Posts
    65
    Rep Power
    0

    How to make a mod to remove an item

    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>

  2. #2
    Leader Tin's Avatar
    Join Date
    Feb 2014
    Location
    In between
    Posts
    5,732
    Rep Power
    1
    Quote Originally Posted by Noisy Pants View Post
    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 Tin; 07-15-2019 at 06:10 PM.

  3. #3
    Survivor Noisy Pants's Avatar
    Join Date
    May 2018
    Location
    Oklahoma, USA
    Posts
    65
    Rep Power
    0
    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>
    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

  4. #4
    Leader Tin's Avatar
    Join Date
    Feb 2014
    Location
    In between
    Posts
    5,732
    Rep Power
    1
    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.

  5. #5
    Leader Tin's Avatar
    Join Date
    Feb 2014
    Location
    In between
    Posts
    5,732
    Rep Power
    1
    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 Tin; 07-15-2019 at 09:36 PM.

  6. #6
    Survivor
    Join Date
    Jul 2019
    Location
    USA
    Posts
    67
    Rep Power
    0
    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

  7. #7
    Leader Tin's Avatar
    Join Date
    Feb 2014
    Location
    In between
    Posts
    5,732
    Rep Power
    1
    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

  8. #8
    Survivor
    Join Date
    Jul 2019
    Location
    USA
    Posts
    67
    Rep Power
    0
    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

  9. #9
    Leader Tin's Avatar
    Join Date
    Feb 2014
    Location
    In between
    Posts
    5,732
    Rep Power
    1
    Quote Originally Posted by Belgeranrg View Post
    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
    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.

  10. #10
    Survivor
    Join Date
    Jul 2019
    Location
    USA
    Posts
    67
    Rep Power
    0
    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.

  11. #11
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Enemy for life
    Posts
    21,496
    Rep Power
    1
    Holy crap folks, it was my fault. I'm practicing to be a sith apprentice and sometimes my sessions go awry.

  12. #12
    Leader Tin's Avatar
    Join Date
    Feb 2014
    Location
    In between
    Posts
    5,732
    Rep Power
    1
    Quote Originally Posted by Guppycur View Post
    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.

  13. #13
    Survivor
    Join Date
    Jul 2019
    Location
    USA
    Posts
    67
    Rep Power
    0
    Well, if you're crazy you can be part of the cult... but if you're deranged... we'll make you our leader.

  14. #14
    Survivor Noisy Pants's Avatar
    Join Date
    May 2018
    Location
    Oklahoma, USA
    Posts
    65
    Rep Power
    0
    Quote Originally Posted by Tin View Post
    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>
    lead1.jpg

  15. #15
    Survivor Noisy Pants's Avatar
    Join Date
    May 2018
    Location
    Oklahoma, USA
    Posts
    65
    Rep Power
    0
    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 Noisy Pants; 07-21-2019 at 12:48 PM. Reason: typo correction

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •