Page 3 of 35 FirstFirst 1234513 ... LastLast
Results 31 to 45 of 512

Thread: XPath Modding Explanation Thread

  1. #31
    Colony Founder
    Join Date
    Mar 2017
    Posts
    2,355
    Rep Power
    1
    Quote Originally Posted by sphereii View Post
    Code:
    <items>
    	<item id="40" name="gunPistol">
    		<!-- snip -->
    		<property class="Action0">
    			<!-- snip -->
    			<property name="Magazine_items" value="9mmBullet" />
    		</property>
    	</item>
    </items>
    Lets assume I want to add something OUTSIDE the <property> block for all guns with 9mm Bullets.

    The following will surely not work because inbetween the append and the remove the xml is left with broken syntax with two closing </property>. And the remove surely wouldn't work this way anyway

    Code:
    <append xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='9mmBullet']>
      </property>
      <...my new stuff....>
    </set>
    
    <remove xpath="/items/item//property[2]">
    Is there are way? Maybe a '..' syntax to go outside a block again?
    Last edited by meganoth; 11-15-2018 at 02:58 PM.

  2. #32
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,665
    Rep Power
    1
    Quote Originally Posted by meganoth View Post
    Lets assume I want to add something OUTSIDE the <property> block for all guns with 9mm Bullets.

    The following will surely not work because inbetween the append and the remove the xml is left with broken syntax with two closing </property>. And the remove surely wouldn't work this way anyway

    Code:
    <append xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='9mmBullet']>
      </property>
      <...my new stuff....>
    </set>
    
    <remove xpath="/items/item//property[2]">
    Is there are way? Maybe a '..' syntax to go outside a block again?
    You'd probably want to use <insertAfter>, rather than append.

    Code:
    <insertAfter xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='9mmBullet']>
       <...my new stuff....>
    </insertAfter>

  3. #33
    Tracker
    Join Date
    Aug 2016
    Posts
    204
    Rep Power
    1
    What's the actual full file look like for say items.xml using this system? Most examples don't include any overall structure where some include <configs> ... </configs> with changes inside. Are there tags that were left out?

  4. #34
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,665
    Rep Power
    1
    Quote Originally Posted by Buggi View Post
    What's the actual full file look like for say items.xml using this system? Most examples don't include any overall structure where some include <configs> ... </configs> with changes inside. Are there tags that were left out?
    Simplest Example:

    Mods/Buggi/Config/items.xml:

    Code:
    <configs>
             <!-- this will insert new stuff under the <property name="Magazine_items" value="9mmBullet" />
             <insertAfter xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='9mmBullet']>
                      <...my new stuff....>
              </insertAfter>
    
               <!-- this will change the value of the CreativeMode to false, rather than the default none -->
              <set xpath="/items/item[@name='clubMaster']/property[@name='CreativeMode']/@value">False</set>
    
    </configs>
    The <configs> tags aren't really used at all; they are just there to make a valid XML file, which needs a root node. This is just as valid:

    Code:
    <buggi>
             <insertAfter xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='9mmBullet']>
                      <...my new stuff....>
              </insertAfter>
    </buggi>
    Does this help clear things up?

  5. #35
    Tracker
    Join Date
    Aug 2016
    Posts
    204
    Rep Power
    1
    Very much! Thanks!!

  6. #36
    Colony Founder amazombie's Avatar
    Join Date
    May 2014
    Location
    WA
    Posts
    1,543
    Rep Power
    1
    Thank you for posting this. This should help a lot. tbh i'm terrible at modding and codes, but, I got annoyed with having to edit the xml after updates to get my glass jars back after cooking with them. *cant nobody do the dishes* so once we get it and i can figure this out, it is going to save me so much time and frustration. appreciate ya!

  7. #37
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,665
    Rep Power
    1
    Quote Originally Posted by amazombie View Post
    Thank you for posting this. This should help a lot. tbh i'm terrible at modding and codes, but, I got annoyed with having to edit the xml after updates to get my glass jars back after cooking with them. *cant nobody do the dishes* so once we get it and i can figure this out, it is going to save me so much time and frustration. appreciate ya!
    Looking forward to seeing your work Let us know if you have any issues with generating your xpath.

  8. #38
    Hood Ornament Gamida's Avatar
    Join Date
    May 2015
    Location
    The Rock
    Posts
    4,091
    Rep Power
    1
    I have no idea on what you said. I did manage to pick out some of it....like the words and, the, to, etc. I still think you did a wonderful job though as I imagine it is on par with your other posts. Glad you liked 7 Days enough to be involved like this. We all benefit from that. Thank you.



    ...oh btw, can you loan me $10 til Friday...

  9. #39
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,665
    Rep Power
    1
    Quote Originally Posted by Gamida View Post
    I have no idea on what you said. I did manage to pick out some of it....like the words and, the, to, etc. I still think you did a wonderful job though as I imagine it is on par with your other posts. Glad you liked 7 Days enough to be involved like this. We all benefit from that. Thank you.



    ...oh btw, can you loan me $10 til Friday...
    Code:
    <append xpath="/bankAccounts/Account[@name='Gamida']/@balance">+$10</append>

  10. #40
    Colony Founder n2n1's Avatar
    Join Date
    Oct 2015
    Location
    MotherRussia
    Posts
    2,016
    Rep Power
    1
    Thank You very much for clarification, sphereii !

  11. #41
    Refugee zicky's Avatar
    Join Date
    Apr 2015
    Posts
    19
    Rep Power
    0
    In which folder do you place the mod folder and do you need to specify the mod somewhere for the game to use it? I tried to do a search for this information but I couldn't find it. I would like to try this instead of modifying the source files even though I wrote a program to do the modifying for me because this seems to be a much more elegant solution and safer.

  12. #42
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,665
    Rep Power
    1
    Quote Originally Posted by zicky View Post
    In which folder do you place the mod folder and do you need to specify the mod somewhere for the game to use it? I tried to do a search for this information but I couldn't find it. I would like to try this instead of modifying the source files even though I wrote a program to do the modifying for me because this seems to be a much more elegant solution and safer.
    At the top level of your game folder (C:\Program Files (x86)\Steam\steamapps\common\7 Days To Die), make a Mods folder. Then, under that, make a folder for each of the mods you want to make.

    Code:
    C:\Program Files (x86)\Steam\steamapps\common\7 Days To Die\Mods\BloodMoonTrickle
    C:\Program Files (x86)\Steam\steamapps\common\7 Days To Die\Mods\Zicky\
    Under your Zicky folder, you should have this:

    Code:
    Config/entityclasses.xml  ( if you want to make a change to the entityclasses.xml file )
    ModInfo.xml
    The game will look in the Mods folder for mods automatically; As long as it has a ModInfo.xml, it'll try to load it.

  13. #43
    Refugee zicky's Avatar
    Join Date
    Apr 2015
    Posts
    19
    Rep Power
    0
    Thank you

  14. #44
    Reconstructionist CyrusBlaze's Avatar
    Join Date
    Feb 2015
    Posts
    502
    Rep Power
    1
    Do you know in what order the mods are applied? I'm assuming that it is most likely going to be trying to parse them alphabetically.

    May do some testing later today to see if that seems to be the case

  15. #45
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,665
    Rep Power
    1
    Quote Originally Posted by CyrusBlaze View Post
    Do you know in what order the mods are applied? I'm assuming that it is most likely going to be trying to parse them alphabetically.

    May do some testing later today to see if that seems to be the case
    It's alphabetical

    Changes start from the top and end with the last mod in the folder.

Posting Permissions

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