Announcement

Collapse
No announcement yet.

XPath Modding Explanation Thread

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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..

    Comment


      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 - - -

      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.

      Comment


        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.

        Comment


          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.

          Comment


            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, 03:15 PM. Reason: I am an idiot

            Comment


              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...

              Comment


                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.

                Comment


                  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

                  Comment


                    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.

                    Comment


                      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.

                      Comment


                        May have changed the item names...

                        Comment


                          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.

                          Comment


                            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.

                            Comment


                              Thanks, that was like a big DUH on my part...lol

                              Comment


                                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

                                Comment

                                Working...
                                X