Tools 'n Tips
     Adding Randomized Environment Sounds to Q2 Maps
Alright, so you wanna liven up your map a little by adding some environment sounds to it?  Some sound effects can really add to the realism of a map, but be careful not to overdo it or they'll be annoying :).  I'll use the crickets in my midnight map as an example.

The first thing you need to do is create a func_timer.  I have the crickets set up to chirp every 30 seconds +/- 10 seconds.  The "wait" is the time between triggers (30 seconds here), the "random" adds or subtracts somewhere in the range of the number given (+/- 10 seconds here).  You will need to add a "spawnflags" "1" in order for the timer to start when the level starts (BSP has a check box for start_on, this does the same thing).  The "target" triggers the sound with the same "targetname" (Note: you can use this for anything you want - doors or whatever, not just sounds).


Next, you need a target_speaker, this is what actually creates the sound.  The "targetname" has to be the same as the "target" in the func_timer.  The "noise" sets what .wav file to play (Note: world/cricket.wav is a sound for the Paintball2 mod and isn't present in regular old quake2, so you'll have to use something else if you aren't making a paintball map).  The "attenuation" sets who can hear it - you can make it so everyone in the level can hear it and some other stuff, but "3" is the best for a background environment sound.  You can also set the "volume" of the sound being played between "0.0" (nothing) and "1.0" (full volume).  The default is "1."


The placement of the func_timer can be anywhere in the level, but the target_speaker has to be at the location you want the sound to come from.  I just put them right next to each other, so I won't have any trouble finding them :)

stuff in map :P

     Adding Continuous Looping Sounds
If you want to have a continuous sound, such as water for a waterfall or something, you won't need a func_timer.  Just create a target_speaker as seen above without a "targetname" and add "spawnflags" "1" (BSP has a looped-on check box that does the same thing).

     Adding Sounds Triggered by Players
To have a sound triggered when a player walks over a certain area, you will need to create a brush and make it a trigger_multiple entity.  If you only want it triggered once, create a trigger_once entity.  Set the "target" to be the same as the "targetname" of your target_speaker.  Adding a "wait" will put delays between the sound triggers.  A "wait" "10" will make the sound go off every 10 seconds while the player is touching the trigger_multiple.  Adding a "delay" will set how long after the player touches the trigger that the sound goes off.  A "delay" "5" will make the sound go off 5 seconds after the player touches it.

I try to make these tutorials as easy to follow as I can, but if there's anything you're unclear about, contact me and let me know.

[Back to the Joint]

Created Apr 26, 2000.
Content on this page is Copyright © 2000 Nathan "jitspoe" Wulf, almost all rights reserved.
I may have forgotten to make reservations for some of the others. ;)
Quake2 is a registered trademark of id Software.