Jump to content

Struggling with xpath structures


Recommended Posts

I am wanting to add some items and amend some items in the loot.xml and cant seem to crack it.

 

I think it's because of my xpath structures.

 

For example I add this to make the demolition Zombies:

 

<!-- Add casinoCoin to Demolitions Zombie -->
<append xpath="/lootcontainers/lootcontainer[@id='73']">
	<item name="casinoCoin" count="1,20" prob="1"/>
</append>

 

This works fine 

 

However when I try to amend the casinoCoin drop rate for the other Zombies it doesnt work with this:

 

<set xpath="/lootcontainers/lootcontainer/item[@name='casinoCoin']" name="count">1,20</set>

 

The drop rate of the coins still seems in the hundreds.  I was hoping the above would affect all other zombies (id's 70 and 71) as I didnt specify it, but I did also try 

 

<set xpath="/lootcontainers/lootcontainer[@id='70']/item[@name='casinoCoin']" name="count">1,20</set>
<set xpath="/lootcontainers/lootcontainer[@id='71']/item[@name='casinoCoin']" name="count">1,20</set>

 

but it didnt work

 

For example when I kill the Demolition Zombie he will drop a very small amount (30ish or so), but any other zombies drop up to 1200 coins

 

Essentially what I would like to achieve is that they drop a small amount of casino coins, which increases as the players lvl/gamestage increase.

Edited by Parzival2020 (see edit history)
Link to comment
Share on other sites

I’m on my phone so I can’t easily check or tes/validate t it, but this line Looks to me to be completely invalid: 

3 hours ago, Parzival2020 said:

<set xpath="/lootcontainers/lootcontainer/item[@name='casinoCoin']" name="count">1,20</set>


as far as I know, all “loot containers” have to be referenced by an ID or “something” like an asterisk * or a name match(at least), you cannot change/add items/append: etc any loot containers with this specific XML. 
 

I don’t know what the loot container ids 70 and 72 are, but if it’s the little bag(s) that’s dropped when you kill a Zed, this would make sense. 
 

my only other guess is that you’re using “set” and not “append” for the XML.  To me, “set” would only work if the entire path in the XML already exists, meaning

3 hours ago, Parzival2020 said:

<set xpath="/lootcontainers/lootcontainer[@id='70']/item[@name='casinoCoin']" name="count">1,20</set>

Would change the existing XML node Count of coins to be 1,20.  If this xml node did not already exist, you would have to add it (via append).

 

Note:  not an expert at this, and I haven’t modded for months. And I’m on my phone so I could be wrong ;)


edit: wait, it may be also how you’re trying to reference the final value to set. Maybe something like this?

3 hours ago, Parzival2020 said:

<set xpath="/lootcontainers/lootcontainer[@id='70']/item[@name='casinoCoin']/count">1,20</set>

Edited by doughphunghus (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...