Team Fortress 2

Team Fortress 2

42 ratings
Using Multiple Custom Hit Sounds At Once
By Whomobile
This guide will show you how you can get multiple hit sounds and kill sounds working in your game at the same time!
   
Award
Favorite
Favorited
Unfavorite
Intro: Unlimited Hit Sounds!

Encase you don’t know, Hit sounds are, well, sounds that play when you hit someone. Normally you can only have 1 hit sound or kill sound at a time unless you hook up your sounds through one of the existing hit sounds that use more than one. But there is a way to have as many as you want using Sound scripts!

Also, this works around sv_pure!

What you will need:

NOTE: Naming is very important for this to work, the majority of errors will come from a single file’s name being incorrect, double check everything and save often!
Step 0: Enable Hit Sounds
I know at least 1 person will ask so here’s how to turn them on so here we go!

If you know what a console is, enter the following commands:

tf_dingalingaling "1" tf_dingalingaling_last "1"

Read this article on the TF2 wiki for more information about what commands to what: https://wiki.teamfortress.com/wiki/Hit_Sound#Hit_sound_commands

For something more User Interface friendly, from the main menu, select advanced options from the bottom right (The Gear with the Plus symbol)


Scroll down the list till you see the options for “Play a hit sound everytime you injure an enemy” and “Play a last hit sound when one of your attacks kills and enemy” and make sure the boxes are ticked.

Leave the both on the “Default” option for this to work. The other options source the sounds from different places.
Step 1: File setup
First off, go to your custom folder, (Should be
“C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf\custom”)
Inside, right click and make a folder, name it whatever the hell you want.


inside that folder, make 2 more folders called “scripts” and “sound”.

Step 2: Getting the sound script file with GCFscape
Open GCFscape, click on file in the top left and navigate to your TF folder again, just the TF folder this time

“C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf”
-


Open the file "tf2_misc_dir.vpk"
-


Use the find option (top left), or navigate to scripts and look for the “game_sounds_weapons.txt” file
-


Copy and paste the file into the scripts folder or drag it in from GCFscape by holding with left click, you should now have a sound script to play around with!
Step 3: The sound part of hit sounds
You have 2 options

Go to a site like GameBanana and download a bunch of hit and kill sounds you like, extract them, and place them in the sounds folder in the custom folder you made, renaming each one differently, even something as simple as “sound1”, “sound2” ect should be fine. I like to name mine in a way I know what each sound is.

OR

Using an audio editor like Audacity, edit some sounds down and save them in a similar way (different names, “sound1”, “sound2” ect will work) in your sounds folder in the custom folder you made.

I’m not doing a tutorial on how to use Audacity, but I will say sharp, snappy, and a little bit loud works the best for hit sounds, long sounds can be funny but easily get annoying and overwhelming. I find kill sounds can be a bit longer.
-


Also keep in mind Source supports uncompressed 8-bit and 16-bit PCM sample rates at 11025 Hz, 22050 Hz, and 44100 Hz. Most hit sounds are WAV files, I think MP3s will work as well but I don’t use them.
Step 4: Time for some sound scripting!
Open up the “game_sounds_weapons” in a plain text editor, I use Notepad++ but stock Notepad is fine too, and I will use it for this tutorial. You can do this by right clicking and opening with Notepad

If you’ve never played with scripts before, this can look scary! But I’ll make it easier to understand, Don’t worry, we’re not exactly hacking into the main frame here.
-

Go to the top left and click “edit”, then from the drop-down menu select “find”. This will bring up a dialog box, tick the box for “wrap around” and search for “HitSoundDefaultDing”. It should scroll you down to the section that finds hit sounds.
-

We want the section underneath "Player.HitSoundDefaultDing":
-

Right now, there’s only one sound, we want more than one! To do this, we are going to use a function called "rndwave" that randomly selects a soundfile to play.

First, remove the part that says:

"wave" "ui/hitsound.wav"

And in it’s place, put:

"rndwave" { "wave" "hitsoundnamehere.wav" }

and one by one, enter in each sound within the rndwave bracket with the “wave” identifier at the start, do this for kill sounds if you want as well by searching for “KillSoundDefaultDing”.
Here’s how mine looks:
-

NOTE: If you saved your sounds in an additional folder in your sounds folder, you need to include its name in the file with a slash afterwards like this:
-

Save it all! Now we test it out!
Step 5: Testing it out!
Here’s the fun part! Boot up TF2 and join a game to try out your new hit sounds! I like to start a map and add some bots to test things out! The more you add the more that will play!

Step 6: Trouble Shooting
If you sounds don’t work, check console to see what sounds are not working, most of the time it’s due to file paths or names being incorrect. Also make sure you are using wav files and not mp3s or another sound format.

If your hit and kill sounds are changing pitch and you don’t like that, go back to advanced options and make the sliders look like this:
-

If you run into scratchy or otherwise broken sounds, go to the sound folder in your custom folder and delete the sound.cache file. I find that to be the cause of most broken sounds.
-

Source supports uncompressed 8-bit and 16-bit PCM sample rates at 11025 Hz, 22050 Hz, and 44100 Hz. Check your wav files match these rates. Rates such as 32000 Hz and 48000 Hz will not play.

If all else fails, Triple check the filename path and cry if it doesn’t. sometimes stuff just doesn’t work .
Now, Off ye Go!
Have fun with this feature, here's how my list is currently looking, I add more when I find noises that I think would work well!


6 Comments
willowwww 4 Mar @ 6:53pm 
On Linux, I've found VPKEdit by craftablescience works great if GCFScape won't run for you. It shouldn't be hard to find on GitHub!
Rouxls Kaard 27 Feb @ 1:58pm 
Tried to set up custom sounds this way, DID work in offline training but DIDN'T work in casual. Am I missing something? Am I stupid?
Whomobile  [author] 9 Feb @ 7:40pm 
Thanks Jase, will fix it up now
The Rapscallion 7 Feb @ 5:14pm 
The sounds work when i kill a bot in a created server but does not work in valve servers
Jase Vendor 4 Feb @ 10:56pm 
Beep beep, your copy and paste rndwave at Step 4 has a issue.
The “hitsoundnamehere.wav” is surrounded with “” and not "" which confuses the pathing system.
Sorry to be a pain if anything chief but your guide is excellent for custom hitsounds and the sorts.
fakeartman 31 Jan @ 9:37am 
Love it. Very well made guide, thank you so much for it :steamhappy: