loltest

Valve just added the option to have a different hitsound when you kill somebody, which is great. But it's TF2 we're talking about, so let's change the sound to something sillier.

Please note that we're editing game files that change in TF2 updates, so if you do that, weapons sounds added in updates will be glitched until you add them in the files. This method is not perfect, and you will still hear the original hitsound from time to time on sv_pure 1 servers, but it won't be often.
It's also experimental, I didn't run in any problem doing that, but some could have decreased performances or glitches. Just delete the mod to fix every problems.

You will need:
-GCFScape, to explore the .vpk files;
-Audacity to create and tweak the .wav file;
-Notepad++, not essential, but will make things way easier for you;  

First off, you will need to create a .wav audio file, the same way you would create a regular hitsound. You can name it whatever you want, but it will be easier for the next parts if you rename it something simple, like killsound.wav.  

The problem there is that we can't just replace the sound in the files, or it will only work on sv_pure 0 servers (so it won't on Valve servers, for example), so we need to put it in a different folder.
Go in your custom folder (should be there: C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\tf\custom for most users). In it, create a folder with some random name in which we will put all our files. In there, create a sound folder, and a misc folder in it. Put your killsound.wav here.

Nothing new there, it's basically as creating a normal hitsound. But we will now need to tell the game to load that sound, so we need to edit text files, but it's actually pretty easy.

Go into your tf folder (should be located in C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\tf for most users). Find the tf2_sound_misc_dir.vpk file, and open it with GCFScape. In GCFScape, open the scripts folder, and find game_sounds_weapons.txt. Right click on it, and extract it. Then go into your folder in custom, create a scripts folder, and copy game_sounds_weapons.txt in it.  

Open that file in Notepad++. Hit Ctrl+F, and search for "Weapon Kill". You should see a few paragraphs down there, one for each last hit sounds. We're only going to edit the default one, but it works for every other ones too. Under "Player.KillSoundDefaultDing", you should see a bunch of commands, and near the end of this block of code:

"wave"  ")ui/killsound.wav"   

Modify this to:  

    "rndwave"
{
    "wave"  ")misc/killsound.wav"
}   

What we did there was to tell the game to load one sound in a random set of sounds when you kill that maggot. If you hop in a game in a Valve servers, you'll notice that your sound has been added, but the default sound is still here, too. To "fix" this, for lack of a better alternative, just copy a huge amount of "wave" ")misc/killsound.wav" between the brackets. This makes the chance for TF2 to load the original sound really low on sv_pure 1 servers, and null on sv_pure 0 servers.

I get that this is a bit technical, so here's an archive that you can download and directly extract in your custom folder.
This includes my killsound, but you will still have to create a killsound.wav and put it in ~/custom/killsoundmod/sound/misc to have your own.

And don't forget to delete sound.cache in the sound after each manipulation, or you will have glitched sounds.

Hope this works for you.

/r/PostPreview Thread