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

Using "and" to adjust multiple things in 1 section

Bladestorm Games

New member
Hello, I've run into an issue where when I try to use "and" operator, I seem to get errors.

The goal is to change a few item's passive_effect in 1 section of code, so instead of doing something like this:

<append xpath="/items/item[@name='meleeWpnKnucklesT0LeatherKnuckles']">
<effect_group name="inc_range">
<passive_effect name="MaxRange" operation="base_add" value="1" />
<passive_effect name="BlockRange" operation="base_add" value="1" />
</effect_group>
</append>
<append xpath="/items/item[@name='meleeWpnKnucklesT1IronKnuckles']">
<effect_group name="inc_range">
<passive_effect name="MaxRange" operation="base_add" value="1" />
<passive_effect name="BlockRange" operation="base_add" value="1" />
</effect_group>
</append>
<append xpath="/items/item[@name='meleeWpnKnucklesT3SteelKnuckles']">
<effect_group name="inc_range">
<passive_effect name="MaxRange" operation="base_add" value="1" />
<passive_effect name="BlockRange" operation="base_add" value="1" />
</effect_group>
</append>






I am trying to do something like this:

<append xpath="/items/item[@name='meleeWpnKnucklesT0LeatherKnuckles'
and @name='meleeWpnKnucklesT1IronKnuckles'
and @name='meleeWpnKnucklesT3SteelKnuckles']">
<effect_group name="inc_range">
<passive_effect name="MaxRange" operation="base_add" value="1" />
<passive_effect name="BlockRange" operation="base_add" value="1" />
</effect_group>
</append>




Is that not a valid option? Or am I structuring it wrong?
Thanks!

 
I am trying to do something like this:

<append xpath="/items/item[@name='meleeWpnKnucklesT0LeatherKnuckles'
and @name='meleeWpnKnucklesT1IronKnuckles'
and @name='meleeWpnKnucklesT3SteelKnuckles']">
<effect_group name="inc_range">
<passive_effect name="MaxRange" operation="base_add" value="1" />
<passive_effect name="BlockRange" operation="base_add" value="1" />
</effect_group>
</append>




Is that not a valid option? Or am I structuring it wrong?
Thanks!


Not valid, the and operator in this case is looking for an item that includes all three listed. 

Correct way to use And is to specify a specific node, like

@name='MaxRange' and operation='base_add"




In your case, you should use contains

contains(@name,'meleeWpnKnuckles')


  - This will update any item that has that in the name.

Example

    <remove xpath="//passive_effect[contains(@tags,'T0')]"/>




This is in my progression file for crafting and would remove all code with the tags T0 in it.  Easy way to remove ability to craft any T0 gear past Quality level 1.

 
Last edited by a moderator:
Back
Top