WiseCustomSound: Custom sounds
This tutorial was originally created by wisemx. It was originally posted on SDKnuts.net.
The sound file formats you can use in your maps are WAV and MP3. Custom MP3 and WAV files are both used in this project.
Notes:
- You can not preview MP3’s in Hammer.
- Keep the overall file size in mind, WAV files can be enormous.
- Use clever names for your sound files. i.e. mapnameWaterFall.wav
- Try to use your own folder to prevent conflicts.
- Please respect copyright laws.
The first thing to do is create the folder for your custom sounds. For this tutorial I’ve used a folder named akilling
. The path under HL2 for my sounds is: \Half-Life 2\hl2\sound\akilling\
. Notice that it’s \sound\
and not \sounds\
. Now place your custom sound files in this folder. It’s important to do this before you load Hammer so the sounds will show in the browser. Because my folder is called \sound\akilling\
I can use the word akilling to filter for my sounds. (Porter's note: In most games, you actually HAVE to put your sound files under another folder in \sound\ or they won't work.)
Make sure when you use the Sound Browser that Raw is your current Sound Type. (Porter's note: You can choose to give your sounds a Soundscript entry to give you extra sound features, but for this you don't need to.)
Once you select the sound filename in your ambient_generic
it should include your folder like this:
Remember you can not preview MP3’s in Hammer but you can preview WAV files.
A few things to consider are:
- How will you play the sound.
- Will it be looped.
- Can/Should the sound be heard everywhere.
In this project I’m playing the sound files from a logic_auto
. When the map loads the lights will come on and the Zombies will begin singing. When the song ends the lights go back out, clapping is heard and the Zombies leave.
The colored Zombies in the image above are not a trick. I simply changed the FX type and color. You can play sounds automatically or with a variety of input methods. The logic_auto
I’ve used here could just as well have been a trigger or button. Once you have your custom sound files playing in your map you will want to embed them into your BSP before distributing it.