World sound effects
In this part we will add some sound effects like crackling fire at the torches and a crowing sound. At the moment a torch in the editor looks like this.
Now press the right mouse button and add a target -> target_speaker right above the torch. In the entity window tick "looped_on" in the spawnflags, use "noise" as a key and the path and the filename of the "torch.wav" as a value.
Looped_on does the same like the music key in the worldspawn. Starting to play when the map is loaded, the sound file repeats itself over and over again afterwards.
If you also tick "global", then everyone in the game will hear the sound, no matter where he stands. If it's inactivated then it behaves like a real tone. The closer you get the louder it plays and if you are further away it softens. We'll need the "activator" flag later.
After testing the map we recognize that the music drowns the fire effect (if the music is on maximum). For tuning-up the sound volume you will just need more target_speakers of the same kind. We move our first speaker some units away, copy it three times and place them around the torch.
Now we copy all four of them and put them around the other fires (don't forget the one in the cave).
For me it's too loud now. So I will just delete some of the sound sources and go back to the "speaker-above-the-torch" position.
For the crow sound we'll do the same. Just put a target_speaker near every origin brush.
Here we tick again the "looped_on" checkbox and set the path and its filename.
When we test the map the crow sound plays consistently. That sounds a bit strange. We mark one speaker with the crow sound and add 2 lines.
The wait key says after how many seconds the sound plays again. When you use the "wait" key, you also must set the "random" key. This key will add or subtract the seconds typed in the value box to/from the wait key randomly. So lets set different wait and random keys for each target_speaker with the crowing effect. If you think there's too much crowing now, just delete some speakers.
Note: You can't use the looped_on or _off flags in combination with global or activator. Both of them have a higher priority and therefore they kind of overwrite the other two. So... no looping and globaling.