This article was converted from a previous version of TWHL and may need to be reviewed
- The formatting may be incorrect due to differences in the WikiCode processing engine, it needs to be revised and reformatted
- Some information may be out of date
- After the article is re-formatted and updated, remove this notice and the Review Required category.
- Some older articles are no longer useful, or they duplicate information from other pages. In this case, delete the page after merging any relevant information into other pages. Contact an admin to delete a page.
The ambient_generic entity allows you to play a specific sound. It is a flexible entity that can be used for both looping ambient sounds and one-off sound effects triggered on cue.
Attributes
- Name (targetname) - Name is a general attribute used to identify entities.
- WAV name (message) - This defines which sound file will be played by the entity. This accepts an input of the form "path/filename.wav" (starting from the "sound" folder). (Example: "ambience/drips.wav"). The name of a sentence defined in sentences.txt will also be accepted with the form "!SENTENCENAME". (Example: "!HG_ALERT1")
- Volume (health) - Volume of the sound. Range: 0-10.
- Dynamic Presets (preset) - Various effects that can be applied to the sound:
0 = None
1 = Huge Machine
2 = Big Machine
3 = Machine
4 = Slow Fade in
5 = Fade in
6 = Quick Fade in
7 = Slow Pulse
8 = Pulse
9 = Quick pulse
10 = Slow Oscillator
11 = Oscillator
12 = Quick Oscillator
13 = Grunge pitch
14 = Very low pitch
15 = Low pitch
16 = High pitch
17 = Very high pitch
18 = Screaming pitch
19 = Oscillate spinup/down
20 = Pulse spinup/down
21 = Random pitch
22 = Random pitch fast
23 = Incremental Spinup
24 = Alien
25 = Bizzare
26 = Planet X
27 = Haunted
- Start volume (volstart)
- Fade-in time (fadein) - Time taken for the sound to fade in. Range: 0-100
- Fade-out time (fadeout) - Time taken for the sound to fade out, if not looped. Range: 0-100
- Pitch (pitch) - 100 is normal, > 100 higher, < 100 lower.
- Start pitch (pitchstart)
- Spin-up time (spinup) - Range: 0-100
- spin-down time (spindown) - Range: 0-100
- LFO type (lfotype) - Values: 0=off,1=sqr,2=tri,3=rnd
- LFO rate (lforate) - Range: 0-1000
- LFO mod pitch (lfomodpitch) - Range: 0-100
- LFO modvol (lfomodvol) - Range: 0-100
- Incremental spin-up count (cspinup)
Flags
- Play Everywhere (1) - Sound will be heard in the entire level.
- Small Radius (2) - Sound range is about 800 units at max volume.
- Medium Radius (4) - Sound range is about 1250 units at max volume.
- Large Radius (8) - Sound range is about 2000 units at max volume.
- Start Silent (16) - Checking this means the entity must be triggered to work.
- Not Toggled (32) - Older FGDs show this as Not Looped. Makes the entity interpret each call as "turn on" instead of "toggle state". Must be left unchecked for looping sound files. Note that actual looping depends purely on cue points defined in the .wav file (see notes).
Notes
- Important: Sounds will only loop if there are cue points defined in the .wav file. Cue points determine where the looping will start and end. These sounds will play from start to end and then loop the segment between the first cue to the second (further cue points are ignored); or between the first one and the end of the file if there is only one cue present.
Sound files with cues present will
always loop regardless of the "Not Toggled" flag. If said flag is set, when this entity is triggered the sound will start playing from its start point. If set for a sound file with cues, when the entity is triggered the sound will only jump back to its start and continue looping, and it will be impossible to turn off.
By extension, sound files with no cues present will only play once when the entity is triggered, and will remain silent until triggered again; regardless of the state of the "Not Toggled" flag.
- From WorldCraft 2.1 Help: "To play a wav through the streaming code (for very large, one-shot wavs) use * in front of the name. For instance, ambience/*speak2.wav would stream speak2.wav. Streaming sounds are loaded in segments from the disk, played, and flushed from memory."
- "To play any sentence from sentences.txt, replace the path/filename.wav with ! followed by the sentence name. For instance, !NA1 plays the sentence
named NA1."
- "All the keyvalues from volstart to cspinup are various pitch, volume, and low frequency pitch oscillation settings that are overridden by the dynamic preset setting. In general, don't use these. The incremental spin-up count may be used as follows: each time the ambient is triggered, its pitch will rise from 'start pitch' to 'pitch' by this many increments. So, a setting of '3' means that the pitch of the ambient will rise from 'start pitch' to 'pitch' in three presses (ie: three triggers)."