Page 33 of 34 FirstFirst ... 2331323334 LastLast
Results 481 to 495 of 506

Thread: XPath Modding Explanation Thread

  1. #481
    Survivor
    Join Date
    Nov 2016
    Posts
    78
    Rep Power
    0
    Now the true challenge begins, now that I know i can target the node, I need to add a new item to drop. So not sure whats better for this, append or insert? I'll try append first..

  2. #482
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,648
    Rep Power
    1
    Quote Originally Posted by sbangs007 View Post
    your orginal suggestion WORKED!!
    Code:
    <set xpath="/blocks/block[@name='treeCactus01']/drop[@name='resourceYuccaFibers']/@count">20</set>
    I was never checking the fibers as i was checking fruit. Also a huge red flag that kept me from troublshooting, was the simple rotation, that even editing the orginal XML file for the game, never worked, so it was a bad red hearing to use for testing.

    I cant believe this.. thank you so much for your time with this issue, but wanted you to know, the your first code was the correct one that worked all this time. Ugh..
    I'm glad you got it sorted out

    - - - Updated - - -

    Quote Originally Posted by sbangs007 View Post
    Now the true challenge begins, now that I know i can target the node, I need to add a new item to drop. So not sure whats better for this, append or insert? I'll try append first..
    I always recommend going with an append, it's less precise and less prone to breaking if your insertBefore or insertAfter conditions change.

  3. #483
    Survivor
    Join Date
    Nov 2016
    Posts
    78
    Rep Power
    0
    Quote Originally Posted by sphereii View Post
    I'm glad you got it sorted out

    - - - Updated - - -



    I always recommend going with an append, it's less precise and less prone to breaking if your insertBefore or insertAfter conditions change.
    Yea i did.. when I finish and release my mod, i'll be giving you credit.. thanks again for your time.

  4. #484
    Survivor
    Join Date
    Nov 2016
    Posts
    78
    Rep Power
    0
    Quote Originally Posted by sphereii View Post
    I'm glad you got it sorted out

    - - - Updated - - -



    I always recommend going with an append, it's less precise and less prone to breaking if your insertBefore or insertAfter conditions change.
    Yea i did.. when I finish and release my mod, i'll be giving you credit.. thanks again for your time.

  5. #485
    Refugee
    Join Date
    Nov 2018
    Posts
    23
    Rep Power
    0
    Halp!
    I'm trying to add the hazmat suit in the yeah science 2 perk requirement, already added the recipes. I want to add it here:
    Code:
    	<perk name="perkYeahScience" parent="skillCraftsmanship" name_key="perkYeahScienceName" desc_key="perkYeahScienceDesc" icon="ui_game_symbol_chemistry">
    		<SNIP>
    		<effect_group>
    		<SNIP>
    		<passive_effect name="RecipeTagUnlocked" operation="base_set" value="1" level="2,5"
    				tags="thrownDynamite,ammo9mmBulletSteel,ammo44MagnumBulletSteel,ammo762mmBulletFMJSteel,ammoShotgunSlug,ammoArrowSteelAP,ammoCrossbowBoltSteelAP,ammoArrowFlaming,mineAirFilter,rScrapIronPlateMine,resourceMilitaryFiber,modMeleeBunkerBuster"/>
    		<SNIP>
    		</effect_group>
    	</perk>
    So I thought I'd just append a new passive effect line that resembles the one above, like this:
    Code:
    <append xpath="/progression/perk[@name='perkYeahScience']/effect_group">
    			<passive_effect name="RecipeTagUnlocked" operation="base_set" value="1" level="2,5"
    				tags="hazmatBoots,hazmatPants,hazmatShirt,hazmatGloves,hazmatMask"/>
    </append>
    However I'm getting an error that this couldn't be applied, I'm guessing I've done an error in the xpath, but I can't figure out what exactly.


    Edit: nvm, think hard enough and the answer will come on it's own
    /perks is missing between progression and perk.....
    doh!
    Last edited by Gornemant; 04-17-2019 at 03:15 PM. Reason: I am an idiot

  6. #486
    Scavenger
    Join Date
    Apr 2019
    Posts
    34
    Rep Power
    0
    Is there a fast way to remove a whole section of code with one line? For example I want to remove an entire quest from the game, how can i do that with one line of code and not have to write a whole bunch of <remove xpath=".... blah blah etc...

  7. #487
    Scavenger
    Join Date
    Apr 2019
    Posts
    34
    Rep Power
    0
    Another question, does anyone know how to add a level requirement to a quest? I have tried a few different ways and have yet to get it working.

  8. #488
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,648
    Rep Power
    1
    Quote Originally Posted by DMC View Post
    Is there a fast way to remove a whole section of code with one line? For example I want to remove an entire quest from the game, how can i do that with one line of code and not have to write a whole bunch of <remove xpath=".... blah blah etc...
    You should be able to use <remove xpath="/quests/quest[@name='whatever']" /> to remove the quest

  9. #489
    Scavenger
    Join Date
    Apr 2019
    Posts
    34
    Rep Power
    0
    Thank you Sphereii, I did not think it would work that way, but it works perfectly. I seriously thought i would have to remove each line of code. Thank you again.

  10. #490
    Scavenger
    Join Date
    Aug 2014
    Posts
    38
    Rep Power
    0
    Quick question...has something changed with <set> and/or <append>? I've been using the following:

    Code:
            <append xpath="recipes/recipe[@name='foodBaconAndEggs']">
    		<ingredient name="resourceAnimalFat" count="1"/>
    	</append>
    	
    	<set xpath="recipes/recipe[@name='foodBoiledMeat']">
    		<ingredient name="foodRawMeat" count="2"/>
    	</set>
    to add Fat to Bacon and Eggs and lower the Meat content in Boiled Meat to 2 instead of 5.

    However...I went to craft some Boiled Meat and noticed that the recipe in game is now ONLY:

    2 Raw Meat and NO Jar of Water

    Also...the Fat ADDED to what was already in the original recipe (was 1 and then 2 with my edits)...that I can understand.

    I did an experiment and changed the APPEND in Bacon and Eggs to SET (no other change) and in game I get that Bacon and Eggs only requires Fat AND NOTHING ELSE...here's what I did:

    Code:
            <set xpath="recipes/recipe[@name='foodBaconAndEggs']">
    		<ingredient name="resourceAnimalFat" count="1"/>
    	</set>
    The top code I've been using for quite a while with no issues. As I understand...SET is used when you want to CHANGE a value and APPEND is used when you want to ADD something. But it seems that SET is ONLY using what it's given and removing everything else. Again...I can understand APPEND adding (from 1 to 2 if the original recipe had 1) so that's not really too much of an issue but this is the first time I've had this happen and I'm confused.

  11. #491
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Enemy for life
    Posts
    20,987
    Rep Power
    1
    May have changed the item names...

  12. #492
    Survivor Zagan's Avatar
    Join Date
    Mar 2018
    Posts
    90
    Rep Power
    0
    I'm having trouble trying to append some recipes. I keep getting and error that says;

    Patch element does not have an xpath attribute. Here is the code I used.

    Code:
    <New_Recipies>
        <append xpath="/recipes">
    		<recipe name="solarCell" count="1">
    			<ingredient name="resourceScrapIron" count="1"/>
    			<ingredient name="resourceScrapPolymers" count="1"/>
    		</recipe>
    		<recipe name="solarbank" count="1">
    			<ingredient name="resourceScrapIron" count="1"/>			
    			<ingredient name="resourceScrapPolymers" count="5"/>
    		</recipe>
    		<recipe name="carBattery" count="1">
    			<ingredient name="resourceScrapIron" count="1"/>			
    			<ingredient name="resourceScrapPolymers" count="5"/>
    		</recipe>
    		<recipe name="resourceElectricParts" count="1">
    			<ingredient name="resourceScrapIron" count="1"/>			
    		</recipe>
    	</append>
    <New_Recipies/>
    Not sure where I went wrong, i followed Buggi's video but it's not working. Any help would be appreciated.

  13. #493
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,648
    Rep Power
    1
    Quote Originally Posted by Zagan View Post
    I'm having trouble trying to append some recipes. I keep getting and error that says;

    Patch element does not have an xpath attribute. Here is the code I used.

    Code:
    <New_Recipies>
        <append xpath="/recipes">
    		<recipe name="solarCell" count="1">
    			<ingredient name="resourceScrapIron" count="1"/>
    			<ingredient name="resourceScrapPolymers" count="1"/>
    		</recipe>
    		<recipe name="solarbank" count="1">
    			<ingredient name="resourceScrapIron" count="1"/>			
    			<ingredient name="resourceScrapPolymers" count="5"/>
    		</recipe>
    		<recipe name="carBattery" count="1">
    			<ingredient name="resourceScrapIron" count="1"/>			
    			<ingredient name="resourceScrapPolymers" count="5"/>
    		</recipe>
    		<recipe name="resourceElectricParts" count="1">
    			<ingredient name="resourceScrapIron" count="1"/>			
    		</recipe>
    	</append>
    <New_Recipies/>
    Not sure where I went wrong, i followed Buggi's video but it's not working. Any help would be appreciated.
    Take a look at your last entry: <New_Recipes/> should be </New_Recipes>, as it's closing the top node.

  14. #494
    Survivor Zagan's Avatar
    Join Date
    Mar 2018
    Posts
    90
    Rep Power
    0
    Thanks, that was like a big DUH on my part...lol

  15. #495
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,648
    Rep Power
    1
    Quote Originally Posted by Zagan View Post
    Thanks, that was like a big DUH on my part...lol
    For better or for worse, the mistakes we make usually aren't big or glamorous

Posting Permissions

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