Kubikus Posted November 15, 2018 Share Posted November 15, 2018 A quick and easy solution to the issue is to use two xpath commands: <remove xpath="//property" /> <append xpath="//property/@value>50</append> The remove should fail silently if its not there, and remove if it its there. the append would put it back.Like so? Link to comment Share on other sites More sharing options...
sphereii Posted November 15, 2018 Author Share Posted November 15, 2018 Probably something like this: <remove xpath="/blocks/block[@name='woodFrameWedge']/property[@name='MaxDamage']" /> <append xpath="/blocks/block[@name='woodFrameWedge']"> <property name="MaxDamage" value="75" > </append> If you aren't appending specifically to a value, but rather an entirely new line, it'll be the slightly longer format. Link to comment Share on other sites More sharing options...
Kubikus Posted November 15, 2018 Share Posted November 15, 2018 Probably something like this: <remove xpath="/blocks/block[@name='woodFrameWedge']/property[@name='MaxDamage']" /> <append xpath="/blocks/block[@name='woodFrameWedge']"> <property name="MaxDamage" value="75" > </append> If you aren't appending specifically to a value, but rather an entirely new line, it'll be the slightly longer format.Ah, yes, my mistake, you had explained that already. Thanks. Link to comment Share on other sites More sharing options...
meganoth Posted November 15, 2018 Share Posted November 15, 2018 Exellent intro. Possible bug report: You used append once with and once without comma. I assume only one method is correct. <append xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='9mmBullet']/@value">,NoAmmo</append> <append xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='9mmBullet']/@value">NoAmmo</append> Link to comment Share on other sites More sharing options...
sphereii Posted November 15, 2018 Author Share Posted November 15, 2018 Exellent intro. Possible bug report: You used append once with and once without comma. I assume only one method is correct. <append xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='9mmBullet']/@value">,NoAmmo</append> <append xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='9mmBullet']/@value">NoAmmo</append> yes, the first one is correct. I'll update the post. It appends as a string, so it doesn't know any context on what it's changing. Link to comment Share on other sites More sharing options...
meganoth Posted November 15, 2018 Share Posted November 15, 2018 (edited) <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 <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? Edited November 15, 2018 by meganoth (see edit history) Link to comment Share on other sites More sharing options...
sphereii Posted November 15, 2018 Author Share Posted November 15, 2018 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 <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. <insertAfter xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='9mmBullet']> <...my new stuff....> </insertAfter> Link to comment Share on other sites More sharing options...
Buggi Posted November 17, 2018 Share Posted November 17, 2018 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? Link to comment Share on other sites More sharing options...
sphereii Posted November 17, 2018 Author Share Posted November 17, 2018 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: <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: <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? Link to comment Share on other sites More sharing options...
Buggi Posted November 17, 2018 Share Posted November 17, 2018 Very much! Thanks!! Link to comment Share on other sites More sharing options...
amazombie Posted November 19, 2018 Share Posted November 19, 2018 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! Link to comment Share on other sites More sharing options...
sphereii Posted November 19, 2018 Author Share Posted November 19, 2018 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. Link to comment Share on other sites More sharing options...
Gamida Posted November 19, 2018 Share Posted November 19, 2018 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... Link to comment Share on other sites More sharing options...
sphereii Posted November 19, 2018 Author Share Posted November 19, 2018 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... <append xpath="/bankAccounts/Account[@name='Gamida']/@balance">+$10</append> 1 Link to comment Share on other sites More sharing options...
n2n1 Posted November 19, 2018 Share Posted November 19, 2018 Thank You very much for clarification, sphereii ! Link to comment Share on other sites More sharing options...
zicky Posted November 20, 2018 Share Posted November 20, 2018 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. Link to comment Share on other sites More sharing options...
sphereii Posted November 20, 2018 Author Share Posted November 20, 2018 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. 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: 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. 1 Link to comment Share on other sites More sharing options...
zicky Posted November 20, 2018 Share Posted November 20, 2018 Thank you:smile-new: Link to comment Share on other sites More sharing options...
CyrusBlaze Posted November 20, 2018 Share Posted November 20, 2018 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 Link to comment Share on other sites More sharing options...
sphereii Posted November 20, 2018 Author Share Posted November 20, 2018 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. 1 Link to comment Share on other sites More sharing options...
CyrusBlaze Posted November 21, 2018 Share Posted November 21, 2018 (Have not tested this yet - will attempt to do so when I get home tonight) How about adding/changing things within the text files such as the locilization.txt? Link to comment Share on other sites More sharing options...
sphereii Posted November 21, 2018 Author Share Posted November 21, 2018 (Have not tested this yet - will attempt to do so when I get home tonight) How about adding/changing things within the text files such as the locilization.txt? Not at this point. Maybe layer in A17 or possibly in A18. Link to comment Share on other sites More sharing options...
adreden Posted November 21, 2018 Share Posted November 21, 2018 Wow this is what I have wanted for months. Thank you Sphereii for explaining it. Jittering with excitment Link to comment Share on other sites More sharing options...
Devidian Posted November 21, 2018 Share Posted November 21, 2018 One Question beside this: Has anything changed regarding sprites transfer from server to client? This would be awesome for dedicated servers having custom UI's without the need that everybody has installed the mod them self. Link to comment Share on other sites More sharing options...
Guppycur Posted November 21, 2018 Share Posted November 21, 2018 Nope. Not yet . Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now