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

Help with xpath

bdubyah

Hunter
So I'm trying to edit the sounds.xml, and wanna change this node:

<SoundDataNode name="vwheel_bounce"> <AudioSource name="Sounds/AudioSource_Vehicle"/>

<Noise ID="3" range="14" volume="30" time="3" muffled_when_crouched="0.65" heat_map_strength="0.05" heat_map_time="60"/>

<AudioClip ClipName="Sounds/Vehicles/Minibike/minibike_suspension_1"/>

<AudioClip ClipName="Sounds/Vehicles/Minibike/minibike_suspension_2"/>

<AudioClip ClipName="Sounds/Misc/entityhitsground"/>

<MaxVoices value="2"/> <MaxRepeatRate value="0.01"/>

</SoundDataNode>

If I wanted to change the "volume" and "MaxRepeatRate", what would that look like? I've tried searching but I don't see much for sounds. I tried:

<configs>

<set xpath="/Sounds/SoundDataNode[@name=vwheel_bounce]/property[@name=MaxRepeatRate]/@value">10</set>

<set xpath="/Sounds/SoundDataNode[@name=vwheel_bounce]/property[@name=volume]/@value">10</set>

</configs>

in my mod's sounds.xml but it tells me during load that it didn't apply the changes. What am I missing?

 
It looks like the Xpath you have is trying to find a property element when there isn't one.

Try this out and see if it works:

<configs>

<set xpath="/Sounds/SoundDataNode[@name=vwheel_bounce]/MaxRepeatRate/@value">10</set>

<set xpath="/Sounds/SoundDataNode[@name=vwheel_bounce]/Noise[@ID=3]/@volume">10</set>

</configs>

 
I didn't even think about the fact they aren't called "property=" in sounds.xml.

That seems to have done it. Thank you, sir!

 
Back
Top