Festro Posted October 30, 2020 Share Posted October 30, 2020 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? Link to comment Share on other sites More sharing options...
Festro Posted November 7, 2020 Author Share Posted November 7, 2020 Anybody? Link to comment Share on other sites More sharing options...
stample Posted November 9, 2020 Share Posted November 9, 2020 On 10/30/2020 at 1:51 PM, Festro said: 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: <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> Link to comment Share on other sites More sharing options...
doughphunghus Posted November 9, 2020 Share Posted November 9, 2020 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. Link to comment Share on other sites More sharing options...
Festro Posted November 13, 2020 Author Share Posted November 13, 2020 On 11/9/2020 at 6:59 AM, stample said: 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! Link to comment Share on other sites More sharing options...
Telric Posted November 13, 2020 Share Posted November 13, 2020 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.