You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date.
Click here to see the current revision of this 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 (10 = loudest) (health) - Sets the volume of the sound. Scales from 0 (completely silent) to 10 (maximum, default). (If using dynamics attributes below, this is the maximum volume the sound will reach.)
Dynamic Presets (preset) - Sets the ambient_generic to use a predefined set of dynamics. If set to anything other than "None", this will override every other attribute apart from Name and WAV Name.
None (0) - Does not use a preset, and will not override any other entity attributes.
Huge Machine (1) - Very long spin up, starting slow and getting fast. Very long spin down.
Big Machine (2) - Medium spin up, starting normal and getting fast. Long spin down.
Machine (3) - Quick spin up, starting normal and getting fast. Quick spin down.
Oscillate spinup/down (19) - Medium oscillation, with long spin up from slow to fast. Long spin down.
Pulse spinup/down (20) - Slow pulse, with long spin up from slow to fast. Long spin down.
Random pitch (21) - Occasionally switches speed, tending towards slower speeds. Quick fade out.
Random pitch fast (22) - Rapidly switches speed, tending towards faster speeds. Quick fade out.
Incremental Spinup (23) - Quick spin up. Subsequent triggers will not toggle, but will spin up from existing speed, up to five times. Cannot be turned off.
Bizzare (25) - Fast oscillation between fast and slow/silent. Quick fade out.
Planet X (26) - Medium switching between slower speeds, similar to "Random pitch". Quick fade out.
Haunted (27) - Slow switch between normal and slow speed. Quick fade out.
Start Volume (volstart) - Sets the volume that the sound should start at when fading in, and that it should stop at when fading out. Scales from 0 (completely silent) to 10 (maximum). (Should be lower than Volume.)
Fade in time (0-100) (fadein) - Sets how long the sound should take to fade in from Start Volume to Volume. Scales from 0 (instant) to 100 (very long).
Fade out time (0-100) (fadeout) - Sets how long the sound should take to fade out from Volume to Start Volume. Scales from 0 (instant) to 100 (very long).
Pitch (> 100 = higher) (pitch) - Sets the pitch of the sound. Scales from 100 (default), with lower values meaning lower pitch and higher values meaning higher pitch.
Start Pitch (pitchstart) - Sets the pitch that the sound should start at when spinning up, and that it should stop at when spinning down. Scales from 100 (default), with lower values meaning lower pitch and higher values meaning higher pitch. (Should be lower than Pitch.)
Spin up time (0-100) (spinup) - Sets how long the sound should take to spin up from Start Pitch to Pitch. Scales from 0 (instant) to 100 (very long).
Spin down time (0-100) (spindown) - Sets how long the sound should take to spin down from Pitch to Start Pitch. Scales from 0 (instant) to 100 (very long).
LFO type 0)off 1)sqr 2)tri 3)rnd (lfotype) - Allows the sound to have certain oscillating effects applied to its pitch.
0 - Disables the LFO effects.
1 - Switches between a low and high pitch.
2 - Oscillates between a low and high pitch.
3 - Randomly switches pitches.
LFO rate (0-1000) (lforate) - Sets how quickly the pitch changes with the LFO effects. Scales between 0 (does not change) and 1000 (changes extremely quickly).
LFO mod pitch (0-100) (lfomodpitch) - Sets how much the pitch should change with the LFO effects. Scales between 0 (does not change) and 100 (very large changes).
LFO mod vol (0-100) (lfomodvol) - Sets how much the volume should change with the LFO effects. Seems to coincide with lower pitches. Scales between 0 (does not change) and 100 (silent).
Incremental spinup count (cspinup) - Sets how many times the ambient_generic can be triggered to have the pitch spin up on top of the pitch it was already playing at. Setting this to a value other than 0 will disable toggling the sound, and will prevent the sound from being turned off even it has been triggered that many times.
Flags
Play Everywhere (1) - If enabled, the sound will be heard throughout the entire map.
Small Radius (2) - If enabled, the sound will be at maximum volume within a roughly 256 unit radius, fading out completely at around 512 units away.
Medium Radius (4) - If enabled, the sound will be at maximum volume within a roughly 512 unit radius, fading out completely at around 768 units away.
Large Radius (8) - If enabled, the sound will be at maximum volume within a roughly 768 unit radius, fading out completely at around 1280 units away.
Start Silent (16) - If enabled, the sound will not play at the start of the map, and will need to be triggered to play. Otherwise, the sound will play at the start of the map whether it is a looping sound or not.
Not Toggled (32) - Tells the entity whether or not it is dealing with a looping sound. If enabled, the sound will play whenever the entity is triggered (intended for non-looping sounds). (Looping sounds will still play, but will not turn off when triggered.) If not enabled, the sound will toggle on or off when triggered (intended for looping sounds). (Non-looping sounds will still play, but every second trigger will turn the sound off regardless of whether the sound is actually playing anything.) See notes for more information about looping sounds.
Notes
Sounds will only loop if there are cue points defined in the .wav file, and will loop (or not) regardless of entity settings.Cue points determine where the looping will start and end. Sounds will play from start to end and then loop the segment between the first cue and the second cue (or the end if there is only one), ignoring other cue points. See this example map for further analysis.
Certain timing dynamics settings (such as Pitch Spin Up/Down Time) will cause non-looping sounds to loop for the duration of those times if the sound is not long enough.
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."
If more than one of the "Radius" flags are checked, the entity will use the smallest radius that is checked. "Play Everywhere" will override those flags, however.
Example maps
Some example maps that show the ambient_generic in action: