PDA

View Full Version : Swapping Sound Assets


Dark Omega
10-04-2007, 09:18 AM
So I'm trying to solve the fairly specific problem of swapping sound assets for weapons. That is, say I wanted to replace the pistol firing noise with something completely new. I am aware that the sounds are defined in the game sounds txt file. However, (correct me if I'm wrong), those point to files that are in the .cache files and I am unable to edit.

So a few questions then:
A. Is my understanding so far correct
B. Can I somehow edit the .cache files if that's where they're stored
C. Can I put the new .wav file somewhere else, and make the game sounds txt aware of it

Thanks a lot

wisemx
10-04-2007, 10:31 AM
I haven't tested it but there is a flush command.
If it works you could create a trigger for it before the sound trigger.
Use the "find" command from the console, see what you find for "flush".

Penumbra
10-04-2007, 11:18 AM
1. Create a sound directory in the directory named as your mod.
2. Create a "game_sounds_mod.txt" in the scripts directory.
3. Make a sound scriot for your sound:
"Victim.Breathe"
{
"channel" "CHAN_BODY"
"volume" "VOL_NORM"
"pitch" "PITCH_NORM"

"soundlevel" "SNDLVL_100dB"

"wave" "../sound/breathe.wav"
}
This should provide Source with enough information to create and call the sound script. Don't forget to precache your sounds whenever needed!

Hope this helps!:cool:

Dark Omega
10-04-2007, 05:05 PM
Many thanks Penumbra. It was really just that simple; my problem was that I didn't know of that '../' which leads to the parent directory. So i made the sound folder there, put my sound, and BAM it works. Thanks again, fare thee well.