trigger_speaker
Description
Point class. This will play a sound when triggered. Normal sounds play once each time the trigger is activated. Ambient looped sounds have an attenuation 2 + volume 1 and start off by default. Multiple identical ambient looping sounds will just increase volume without any speed cost. If neither AMBIENT_ON or AMBIENT_OFF are set, the sound is sent over explicitly throughout the level (this creates more net traffic).
Keys
|
noise:
|
path/name of wav file to play.
|
channel:
|
channel on which sound is generated (has no effect on ambient sounds). Value ranges from 0 - 8.
0 :auto channel (automatic).
1 :weapon channel (sounds from weapons).
2 :voice channel (talking - default).
3 :item channel (items on player making sounds).
4 :body channel (falling to the ground, landing,
bodyfalls).
5 :dialog channel (formal dialog).
6 :secondary dialog channel (formal dialog).
7 :weaponidle channel (sounds the player's weapon makes).
8 :no PHS channel (don't use PHS).
|
volume:
|
loudness of sound (default 1). Value ranges from 0 - 4 (floating point). Volume has no effect on ambient sounds.
|
attenuation:
|
attenuation of sound with distance (0 becomes 1 for non-ambients, 2 for ambients).
-1 :none, send to whole level.
0 :default (normal or ambient).
1 :normal fighting sounds.
2 :idle monster sounds.
3 :static attenuation (same as ambient sounds).
|
pitch:
|
the pitch of the sound (has no effect on ambient sounds). Value must be >0 (floating point). For example:
0.5 :half speed.
1.0 :normal speed (default).
2.0 :double speed.
|
fadetime:
|
how long the sound takes to fade in seconds (has no effect on ambient sounds, 0 is default).
|
timeofs:
|
offset time in milliseconds till the sound starts (has no effect on ambient sounds, 0 is default).
|
key:
|
name of item required to activate this (default: none). This can be any Inventory_* type entity. Use the last part of the entity name (after "Inventory_"). The only exceptions are:
ChemBioSuit : use chemsuit instead
cookies : works but doesn't generate an icon
genericpulsepart : works but doesn't generate an icon
|
targetname:
|
name used by trigger or script to activate this.
|
thread:
|
name of thread to call when triggered. This can be in a different script file as well by using the '::' notation.
|
|
Spawnflags
|
1
|
AMBIENT_ON
|
ambient sounds start on and toggle on/off each time the speaker is triggered.
|
2
|
RELIABLE
|
this sound should be sent over in a reliable fashion (has no effect on ambient sounds). Should only be set for crucial voice-overs or sounds.
|
4
|
NOT_PLAYERS
|
activating trigger will not respond to players.
|
8
|
MONSTERS
|
activating trigger will respond to monsters.
|
16
|
PROJECTILES
|
activating trigger will respond to projectiles (rockets, grenades, mines).
|
32
|
AMBIENT_OFF
|
ambient sounds start off and toggle on/off each time the speaker is triggered (default).
|
128
|
TOGGLE
|
ambient sounds toggle on/off each time the speaker is triggered.
|
|
Notes
There are two types of sounds: ambient and normal.
Ambient sounds are always played at volume 1, ambient attenuation. They are automatically stopped and started, and if you have more than one in an area, only one sound will be played, but at a greater volume. Ambient sounds must be placed in an open area, they do use the PVS (Potentially Visible Set) and PHS (Potentially Hearable Set) to determine who to send to, so you cannot embed them in geometry.
Ambient sounds are sent over the network with minimal bandwidth (IOW they are efficient). Ambient sounds all auto-loop, they can be triggered on and off quite easily so they are also ideal for machinery.
Normal sounds can be played at any volume, pitch, attenuation, etc. you want. They are sent over the network explicitly and require more bandwidth. Normal sounds should be used for one time triggers, dialog, etc. Normal sounds only loop if their .wav file has been setup with a loop. Normal sounds play and then end, this is their standard behavior.
Normal sounds can be sent over the network reliably or unreliably. If they are sent over reliably, they are guaranteed to arrive, if unreliable, they are not guaranteed. The RELIABLE flag can be set, but should only be set when you absolutely need to have that sound in a Deathmatch situation, in single play, all sounds are reliable so it isn't an issue.
Info courtesy of Mark Dochterman, Ritual Entertainment.
|
|