Tutorials

quake2 - target_speaker


The target_speaker entity is another one that will be used VERY often by a map designer and should be known very well. What it does is spawns all those crazy sounds you here in quake2. Like the humming of a generator, breaking of glass, water flowing, ships flying overhead, etc. I will attempt to show you how to use this entity...hopefully.

Creating the target_speaker

A target_speaker should be placed where you want the sound to originate from. By default a target_speaker will not start on and will have to be triggered by another entity such as a trigger_once, trigger_multiple, func_button, or whatever you want the sound to be triggered by. If you want a window to set off the sound then you would create the func_explosive that would be the breaking window and add a target key and set it to the the target_speaker. There is a way to make the target_speaker to start on that I will explain in the spawnflags section.

Key Value Pairs

Noise

Noise is the name and path of the actual sound that will be played. The trick to it, if you want to call it a trick, is that you must specify the directory path and the name of the sound. Here is a list of all the sounds that you can use and their directory paths. A common thought is that you can only use the sounds in the world/ directory but this is simply not true. You can use ANY sound at ANY time. You will soon find out though that the sounds in the world directory will be used much more often. So for an example if we want the target_speaker to produce a pump sound then we would set noise=world/bigpump.wav.

Things to remember:

  • Every target_speaker MUST have a noise key.
  • Case does not matter. xian.wav and XIAN.WAV will both work.

  • attenuation

    attenuation is the distance the sound will travel before fading out. There are 4 different levels of attenuation:
  • -1 : No fade off, the whole level will hear the sound
  • 1 : Normal fighting sounds. This is also the default attenuation for normal sounds.
  • 2 : idle sound level.
  • 3 : ambient sound level. Default attenuation for target_speaker entities that have the spawnflag looped-on set.
  • a value of 0 for attenuation will default to 1.


    volume

    Volume is pretty self explanatory. Volume levels can be values of 0.0 to 1.0. 1.0 being the loudest. If volume is left blank then the default volume is set to 1. A volume of .1 will barely be audible. If there are multiple target_speaker entities with the same sound playing at the same time then the volume will increase beyond normal but excessive target_speakers will do nothing beyond a certain point.

    Spawnflags

    looped-on

    When looped-on is set then the sound will start on when the level is started and stay on until triggered. Thus the sound will loop over and over again until triggered and turned off. Sounds that are looped-on always have an attenuation of 3 and a volume of 1 and can not be changed.


    looped-off

    Looped-off is the opposite of looped-on naturally. The sound will start off and then when trigger will start and stay on. As with a looped_on sound they always will have an attenuation of 3 and a volume of 1 and can not be changed.


    reliable

    reliable is used when you have a very important sound that player must hear, like for crucial voiceovers. It makes the sound that is marked as reliable to override all the other sounds that are playing at the same time.

    Uses of the Target_Speaker

    There are virtually unlimited uses of the target_speaker entity. Of course you are going to want to use a lot of the world/ sounds with breaking glass, moving trains, computers humming, etc. But there are also uses of the non world/ sounds. Like some of the monster sounds at random areas to create a freaky feel of the level. There is an example of this on the [example .map] map.

    Well anyways if you still don't understand please post your questions to the discussion board.

    Return to Tutorials Page...







    Copyright Crap