Something to help the visual learners out there get started in XPath modding.
Last edited by a moderator:
<?xml version="1.0" encoding="UTF-8"?>
<DWModsAdminMod>
<set xpath="/entity_classes/entity_class/[@name="playerMale"]/property[@name="ItemsOnEnterGame.GameModeSurvival" ]/@valueadminsuperbag</set>
<set xpath="/entity_classes/entity_class/[@name="playerMale"]/property[@name="ItemsOnEnterGame.GameModeSurvivalSP" ]/@valueadminsuperbag</set>
<set xpath="/entity_classes/entity_class/[@name="playerMale"]/property[@name="ItemsOnEnterGame.GameModeSurvivalMP" ]/@valueadminsuperbag</set>
</DWModsAdminMod>
<DWModsAdminMod>
<set xpath="/entity_classes/entity_class[@name='playerMale']/property[@name='ItemsOnEnterGame.GameModeSurvival']/@value">adminsuperbag</set>
<set xpath="/entity_classes/entity_class[@name='playerMale']/property[@name='ItemsOnEnterGame.GameModeSurvivalSP']/@value">adminsuperbag</set>
<set xpath="/entity_classes/entity_class[@name='playerMale']/property[@name='ItemsOnEnterGame.GameModeSurvivalMP']/@value">adminsuperbag</set>
</DWModsAdminMod>
<?xml version="1.0" encoding="UTF-8"?>
<DWModsAdminMod>
<append xpath="/lootcontainers">
<!--small Loot-->
<lootgroup name="adminCoin" count="all">
<item group="meleeBoneShiv" count="4"/>
<item group="modArmorTripleStoragePocket" count="4"/>
<item group="cntSecureStorageChest" count="4"/>
</lootgroup>
<lootgroup name="adminCoin" count="all">
<item name="meleeBoneShiv" count="4"/>
<item name="modArmorTripleStoragePocket" count="4"/>
<item name="cntSecureStorageChest" count="4"/>
</lootgroup>
i fixed that error several hour ago. Thanks!Do you have an item group named meleeBoneShiv ?
I am assuming you want
Code:<lootgroup name="adminCoin" count="all"> <item name="meleeBoneShiv" count="4"/> <item name="modArmorTripleStoragePocket" count="4"/> <item name="cntSecureStorageChest" count="4"/> </lootgroup>
<configs>
<insertAfter xpath="/lootcontainers/lootgroup[@name='BuriedStashChest']">
<lootgroup name="adminCoin" count="all">
<item name="meleeBoneShiv" count="4"/>
<item name="modArmorTripleStoragePocket" count="4"/>
<item name="cntSecureStorageChest" count="4"/>
</lootgroup>
</insertAfter>
<insertAfter xpath="/lootcontainers/lootcontainer[@id='116']">
<lootcontainer id="249" count="1" size="8,9" sound_open="UseActions/open_cardboard" sound_close="UseActions/close_cardboard" loot_quality_template="treasureTemplate" destroy_on_close="true">
<item group="adminCoin"/>
</lootcontainer>
</insertAfter>
</configs>
thank you for upselling your mods.May I suggest you get this mod and make it do what you want. Most of the legwork is already done for you, unless you are just trying to learn.
Here
I think it is a good practice when working with loot to use insertAfter and Before. loot can be tricky sometimes.
This will insert after the last vanilla group and then after the last vanilla container, I used "249". I think 250 is max
Code:<configs> <insertAfter xpath="/lootcontainers/lootgroup[@name='BuriedStashChest']"> <lootgroup name="adminCoin" count="all"> <item name="meleeBoneShiv" count="4"/> <item name="modArmorTripleStoragePocket" count="4"/> <item name="cntSecureStorageChest" count="4"/> </lootgroup> </insertAfter> <insertAfter xpath="/lootcontainers/lootcontainer[@id='116']"> <lootcontainer id="249" count="1" size="8,9" sound_open="UseActions/open_cardboard" sound_close="UseActions/close_cardboard" loot_quality_template="treasureTemplate" destroy_on_close="true"> <item group="adminCoin"/> </lootcontainer> </insertAfter> </configs>
2019-03-25T23:13:02 62.173 ERR XML loader: Patching 'recipes.xml' from mod 'DW Mods - Dyes Mod' failed
2019-03-25T23:13:02 62.174 EXC XML.Patch (/append/recipe): Patch element does not have an 'xpath' attribute
Exception: XML.Patch (/append/recipe): Patch element does not have an 'xpath' attribute
at XmlPatcher.singlePatch (.XmlFile _targetFile, System.Xml.XmlElement _patchElement, System.String _patchName) [0x00000] in <filename unknown>:0
at XmlPatcher.PatchXml (.XmlFile _xmlFile, .XmlFile _patchXml, System.String _patchName) [0x00000] in <filename unknown>:0
at XmlPatcher.LoadAndPatchConfig (System.String _configName) [0x00000] in <filename unknown>:0
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
Logger:masterLogException(Exception)
Logger:Exception(Exception)
Log:Exception(Exception)
XmlPatcher:LoadAndPatchConfig(String)
<loadSingleXml>c__Iterator1:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
<?xml version="1.0" encoding="UTF-8" ?>
<!--recipes-->
<append xpath="/recipes">
blah blah blah
</append>
sadly this github is not longer available.May I suggest you get this mod and make it do what you want. Most of the legwork is already done for you, unless you are just trying to learn.
Here
I think it is a good practice when working with loot to use insertAfter and Before. loot can be tricky sometimes.
This will insert after the last vanilla group and then after the last vanilla container, I used "249". I think 250 is max
Code:<configs> <insertAfter xpath="/lootcontainers/lootgroup[@name='BuriedStashChest']"> <lootgroup name="adminCoin" count="all"> <item name="meleeBoneShiv" count="4"/> <item name="modArmorTripleStoragePocket" count="4"/> <item name="cntSecureStorageChest" count="4"/> </lootgroup> </insertAfter> <insertAfter xpath="/lootcontainers/lootcontainer[@id='116']"> <lootcontainer id="249" count="1" size="8,9" sound_open="UseActions/open_cardboard" sound_close="UseActions/close_cardboard" loot_quality_template="treasureTemplate" destroy_on_close="true"> <item group="adminCoin"/> </lootcontainer> </insertAfter> </configs>
<modSurvivorsKit>
<set xpath="/entity_classes/entity_class[@name=playerMale]/property[@name=ItemsOnEnterGame.GameModeSurvival]/@value">hitMe,meleeTorch,keystoneBlock,meleeToolSt oneAxeTazas</set>
<set xpath="/entity_classes/entity_class[@name=playerMale]/property[@name=ItemsOnEnterGame.GameModeSurvivalSP]/@value">hitMe,meleeTorch,keystoneBlock,meleeToolSt oneAxeTazas</set>
<set xpath="/entity_classes/entity_class[@name=playerMale]/property[@name=ItemsOnEnterGame.GameModeSurvivalMP]/@value">hitMe,meleetorch,keystoneBlock,meleeToolSt oneAxeTazas</set>
</modSurvivorsKit>
discord? how might i findd you there?I haven't, been responding to most questions on my Discord.
And to respond to the first post on this page, he needs an xml tag wrapping the entire mod,
like this
<somenamehere>
<append...>
</append>
</somenamehere>