• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Can someone help with Xpath please

War3zuk

Refugee
I need to add this to the loot table.... but cant get it to work & read the info on it but still failed lol....

<!-- military munitions ammo box -->

<lootcontainer id="40" count="1" size="8,4" sound_open="UseActions/open_chest" sound_close="UseActions/close_chest" open_time="15" loot_quality_template="baseTemplate">

<item group="weaponsMilitaryGuns+ammo" prob="0.35"/>

<item group="militaryAmmo" prob="1"/>

<item group="militaryArmor" prob="0.1"/>

to go here so they can be found ????

</lootcontainer>

xpath="/lootcontainers/lootcontainer[@id=40] (<item name="Generic Ammo Supply">)

Can someone sort this for me & just explain in a few words why & what lol, Thanks

EDIT Ive managed to get all the other code working without errors, BUT if you cant find the Generic Box within the loot then it would never been seen in the world....

 
I need to add this to the loot table.... but cant get it to work & read the info on it but still failed lol....
<!-- military munitions ammo box -->

<lootcontainer id="40" count="1" size="8,4" sound_open="UseActions/open_chest" sound_close="UseActions/close_chest" open_time="15" loot_quality_template="baseTemplate">

<item group="weaponsMilitaryGuns+ammo" prob="0.35"/>

<item group="militaryAmmo" prob="1"/>

<item group="militaryArmor" prob="0.1"/>

to go here so they can be found ????

</lootcontainer>

xpath="/lootcontainers/lootcontainer[@id=40] (<item name="Generic Ammo Supply">)

Can someone sort this for me & just explain in a few words why & what lol, Thanks

EDIT Ive managed to get all the other code working without errors, BUT if you cant find the Generic Box within the loot then it would never been seen in the world....
Probably something like this:

Code:
<append xpath="/lootcontainers/lootcontainer[@id='40']" >
     <item group="GenericAmmoSupply" />
</append>
 
Thanks, Appreciate the time to answer... You know how the old code give a % of if it spawned does that still happen in game now for these or do I need to add the code ?

Something like this ?

<append xpath="/lootcontainers/lootcontainer[@id=40]" >

<item group="GenericAmmoSupply" prob="0.10"/>

</append>

Tried your code & got this error ?



<configs>

<append xpath="/lootcontainers/lootcontainer[@id=40]" >

<item name="Generic Ammo Supply" count="1,2" prob="0.10"/>

</append>

<append xpath="/lootcontainers/lootcontainer[@id=42]" >

<item name="Generic Ammo Supply" count="1,2" prob="0.10"/>

</append>

<append xpath="/lootcontainers/lootcontainer[@id=50]" >

<item name="Generic Ammo Supply" count="1,2" prob="0.10"/>

</append>

</configs>

I figured it was the Group / Item giving the error so used Item as its not a group....

 
Last edited by a moderator:
The error you are getting is because you are using the GenericAmmoSupply in your item name. Possibly from my example. Your examples contains spaces "Generic Ammo Supply". I'm not sure if item names can have spaces in them.

 
Do you have this item group that you're trying to add made? Adding an item will add an item created in items.xml, whereas a lootgroup is a group of items defined in loot.xml before placing it in a container. Paste the code for this "Generic Ammo Supply" item you've made.

 
Back
Top