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

Silencer Fix Mod - Need Help

This is my first mod that I'm attempting to create from scratch. I have modified other user's mods before, but this is the first.

Quick rundown from my research:

Stealth Values in sounds.xml:

- ID: I just made that one up so it would be easier to use search&massReplace

- (deprecated)volume: volume of the sound which can trigger AI wake

- range: the cumulative range value that goes into the player's stealth meter

- clamp: sound does not add to the stealth bar if the stealth bar is above that value.

- time: game time seconds until noise is removed

- muffled_when_crouched: scales noise range when entity is crouched

- heat_map_strength: how much to add to heat map (once 100 is hit, horde scout is spawned)

- heat_map_time: how long the heat_map_strength will be included in the total heat_map_strength (in game time divided by 10 - for legacy reasons)

Stealth Buckets for ID:

1 - minor sounds, earth/cloth hit

2 - loud steps, trash, hitting stone/wood, silenced mp5

3 - hit glass/metal

4 - auger loop, death screams

5 - gunshot loud explosions

Current game value for sniper_rifle_s_fire (assuming this was for silenced weapon fire):

<Noise ID = "5" range="20" volume="60" time="2" heat_map_strength="0.3" heat_map_time="120"/>

Now I've been beating my head against the wall for the syntax, but everything i do does not seem to actually modify the stealth meter in game. Everything compiles correctly when i load it though.

The one that I expect to work:

<set xpath="/sounds/SoundDataNode[@name=sniperrifle_s_fire]/@range">7</set>

Logic (In sounds.xml, under data node named sniperrifle_s_fire, set range value to be 7) Reason for not specifying Noise is because there are no other ranged variables listed in datanode, so modifying multiples doesnt matter at this point.

My file actually modifies volume, sets heatmap stuff to 0 and other stuff as well to make sure i tested each variable, but nothing seems to actually work. The only thing I can think of is that the base game XML is not referencing the silenced DataNodes anymore.

If you can help that'd be awesome.

Thanks!

 
Just started getting my head into the noise and heat map stuff because I want to add some attachments to my motor tools attachment mod that will reduce noise and/or heat so I am very interested in this data as well.

I am curious if you tried to change the sniper rifle to call to a different ID?

something along the lines of this

Code:
<append xpath="/sound/SOundDataNode[@name='sniperrifle_s_fire']/NetworkAudioSource[@name='Sounds/AudioSource_WeaponFire_Network']/Noise[@ID='5']/@ID">2</append>
I didn't try to see if that would even work but curious if you have went into that area?

Using the append function we could potentially change the whole ID="5" line unless you just want that one specific value changed.

And have you attempted using any of the remove xpath= to affect sound/heatmaps?

 
If you look at for example the bow in sounds xml, that doesnt even have the noise id, range, volume or heatmap entries. MAybe try removing them to se if htat have any effect. Not a permanent solution but could give an indication of how those values work by doing one at a time.

Also, have you run the exportcurrentconfigs command to confirm that your edits are doing what you want them to do?

 
Well, first mod it directly in the game files.

See if it works.

Then you can work on the next step of the xpath replacement shenanigans...

 
But make sure to back up the file and restore it to original before you test your xpathing. Took me a while to realize my modlet wasn't working properly because the values it was modifying weren't the original ones.

 
MAybe try removing them to se if htat have any effect. Not a permanent solution but could give an indication of how those values work by doing one at a time.
This is a great idea. I notice that doing something simliar with my mod would end up completely reseting the character and all the items in personal inventory, any placed blocks were fine, but as soon as the editor pops up with a 'shader not found' error I am guarnteed a character reset. So make sure when doing this its in a test game only so nothing breaks.

Also, have you run the exportcurrentconfigs command to confirm that your edits are doing what you want them to do?
How is this done? Just F1 and type in exportcurrentconfigs?

The way I ended up doing my Motor Tool Silencer was making a new entry in the sounds.xml called "Auger_s_Fire" and in the item_modifiers.xml my attachment for the modMotorToolSilencer overrides the tool sound on firing and instead play the Auger_s_Fire.

- - - Updated - - -

But make sure to back up the file and restore it to original before you test your xpathing. Took me a while to realize my modlet wasn't working properly because the values it was modifying weren't the original ones.
I am curious about using the <remove xpath=...> in order to remove parts one by one so that a modlet could be run that is only meant to remove functions for testing different values rather than going into the data/config and changing stalk values.

 
How is this done? Just F1 and type in exportcurrentconfigs?
Yep. You will then get a version of all the xmls with the edits made by the modlets you have installed. It says in the console where they gat saved, but is in the world save folder under C:\Users\******\AppData\Roaming\7DaysToDie when in a sp game. Then you can see every edits that have been done and which modlet did the edit :)

 
Wow looks like this has gotten alot of views and support. I havent been able to check it in the last week, but i'll be sure to go through and give these suggestions a try over the next few days. Thanks for the suggestions and i'll let you guys know how it goes.

 
Just started getting my head into the noise and heat map stuff because I want to add some attachments to my motor tools attachment mod that will reduce noise and/or heat so I am very interested in this data as well.
I am curious if you tried to change the sniper rifle to call to a different ID?

something along the lines of this

Code:
<append xpath="/sound/SOundDataNode[@name='sniperrifle_s_fire']/NetworkAudioSource[@name='Sounds/AudioSource_WeaponFire_Network']/Noise[@ID='5']/@ID">2</append>
I didn't try to see if that would even work but curious if you have went into that area?

Using the append function we could potentially change the whole ID="5" line unless you just want that one specific value changed.

And have you attempted using any of the remove xpath= to affect sound/heatmaps?
Also so far as I'm aware from reading the code etc, it seems like the ID is nothing more than a placeholder so that the file could be edited wherever ID 5,4,3,2,1 is in bulk. This way if there was a generalized thing (explosions too loud) you could edit all explosion heatmaps.

When i was editing things I try to keep things as neat as I can so I was editing the ID bucket to put silenced weapons in a bucket that makes more sense. EX a silenced sniper rifle shouldn't make as much sound as an explosion which is bucket 5. Nor should it make as much sound as a chainsaw or auger which is in bucket 4.

From reading the commentary on the original files, volume is depracated and no longer goes into calculating noise in the stealthbar, it is now done by range. This seems a bit odd to me as they are simplifying code so that it will just attract zombies in a range and no longer allows multiple sounds of varying degree at a range, but regardless is how the commentary reads.

tl;dr -- the only values that actually affect your stealth currently are range, heatmap strength, heatmap duration, and muffledwhencrouched. (assuming the commentary is actually accurate)

 
Last edited by a moderator:
Back
Top