Jump to content

Xpath Variables?


Xajar

Recommended Posts

You can set your own variables and use those, and there are a few game variables you can pull. Open buffs.xml and do a search for "OPERATIONS AND CVARS", there's a huge commented section at the bottom with all kinds of info about CVars, triggered and passive effects, and a bunch of other stuff. Also XML.txt is very informative.

 

Elaborate some more on what you're trying to do?

Link to comment
Share on other sites

I'm updating some of my modlets and was curious if I could store information in a variable, then use the variable when setting values. This way an end-user could just set the variables at the top of the mod and ignore the rest of the code. Kind of like this..

 

$Tier1Damage = '16'

$Tier2Damage = '32'

 

<set xpath='/items/item[@name=meleeHandZombie01]/effect_group[@name=Base Effects]/passive_effect[@name=BlockDamage" and @value="16]/@value'> $Tier1Damage </set>

<set xpath='/items/item[@name=meleeHandZombieFeral]/property[@class=Action0]/property[@name=DamageBlock" and @value="32]/@value'> $Tier2Damage </set>

<set xpath='/items/item[@name=meleeHandZombieStripperFeral]/property[@class=Action0]/property[@name=DamageBlock" and @value="32]/@value'> $Tier2Damage </set>

Link to comment
Share on other sites

Hm, doing it like that I don't think so but I'd love to be wrong, that would be nice. CVars can be used as passive_effect values (edit: I'm not sure about using them on "property" tags actually, it may also work on those), but as far as I know they can only actually be "set" once in-game through triggered_effects. They will persist in the same save if you log out and back in. I'm also pretty sure through my experimenting that CVars are tied to the entity, eg to have effects modified by a CVar on yourself you have to set the CVar on yourself, but to have them on a zombie the zombie itself has to have a triggered_effect modifying its own CVar, if that makes sense. So you could have a triggered_effect on the base zombie template effect_group in entityclasses.xml that triggers on spawn to "set" the CVar, but that doesn't really achieve what you want which is simplicity of configuration.

 

For what you're trying to do though you can use contains(@name, 'Feral') along with your "DamageBlock" specifier to make the same change to all zombie hands with "Feral" in the name and that have DamageBlock=32 (unfortunately ends-with seems to be broken but starts-with works). Makes things a little simpler.

 

<!-- Set basic zombie damage -->
<set xpath='/items/item[@name="meleeHandZombie01"]/effect_group[@name="Base Effects"]/passive_effect[@name="BlockDamage" and @value="16"]/@value'>16</set>

<!-- Set feral zombie damage -->
<set xpath='/items/item[[color="#FFA500"]contains(@name, 'Feral')[/color]"]/property[@class="Action0"]/property[@name="DamageBlock" and @value="32"]/@value'>32</set>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...