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

Help changing values

Festro

Refugee
Need help modding food and water values tried using set xpath this is what I've got, basically what I want to do is have food and water regenerate slowly rather than degrade.

<set xpath="/entity_classes/entity_class[contains(@name, 'player')]/effect_group/passive_effect(@name, 'WaterChangeOT')/@operation">base_add</set>
<set xpath="/entity_classes/entity_class[contains(@name, 'player')]/effect_group/passive_effect(@name, 'FoodChangeOT')/@operation">base_add</set>

but debug says that "WaterChangeOT')/@operation has an invalid token" what did do wrong?

 
Last edited by a moderator:
Need help modding food and water values tried using set xpath this is what I've got, basically what I want to do is have food and water regenerate slowly rather than degrade.

<set xpath="/entity_classes/entity_class[contains(@name, 'player')]/effect_group/passive_effect(@name, 'WaterChangeOT')/@operation">base_add</set>
<set xpath="/entity_classes/entity_class[contains(@name, 'player')]/effect_group/passive_effect(@name, 'FoodChangeOT')/@operation">base_add</set>

but debug says that "WaterChangeOT')/@operation has an invalid token" what did do wrong?


Not sure why yours didn't work, exactly, but making your passive_effect node a [contains] worked.  Try this

<set xpath="/entity_classes/entity_class[contains(@name, 'player')]/effect_group/passive_effect[contains(@name,'WaterChangeOT')]/@operation">base_add</set>




Config dump came out like this:

Code:
        <passive_effect name="WaterChangeOT" operation="base_add" value=".0111"><!--Attribute "operation" replaced by: "Regen"--></passive_effect> <!-- water base drain, 40/hour -->
        <passive_effect name="WaterChangeOT" operation="base_add" value="@_vehicleFood" tags="driving"><!--Attribute "operation" replaced by: "Regen"--></passive_effect>
 
Last edited by a moderator:
This issue feels familiar. I had some of my mods that I recently loaded into a19.2 b4? And suddenly some parts were not loading, and the fix for this was similar.  It’s like some xml/xpath commands are not working properly now. I did a similar fix where I changed it to “contains” or something, I forgot what I did though :(, but it should be an easy thing to reproduce for a bug report. I’m on my phone so I can’t easily search bug reports to see if this has been reported already. 

 
Not sure why yours didn't work, exactly, but making your passive_effect node a [contains] worked.  Try this

<set xpath="/entity_classes/entity_class[contains(@name, 'player')]/effect_group/passive_effect[contains(@name,'WaterChangeOT')]/@operation">base_add</set>




Config dump came out like this:

        <passive_effect name="WaterChangeOT" operation="base_add" value=".0111"><!--Attribute "operation" replaced by: "Regen"--></passive_effect> <!-- water base drain, 40/hour -->
        <passive_effect name="WaterChangeOT" operation="base_add" value="@_vehicleFood" tags="driving"><!--Attribute "operation" replaced by: "Regen"--></passive_effect>

will give it a try thanks!

 
For future, when you are targetting a property by name, you use ...passive_effect[@name='WaterChangeOT']... not parenthesis. the [contains] code works cuz it's all wrapped up in brackets, not just parenthesis.

 
Back
Top