ambient_generic

From Sven Co-op
Revision as of 21:56, 19 March 2023 by Outerbeast (talk | contribs) (User Only flag description + other additions)
Jump to navigation Jump to search
ambient_generic
Type

point

Status

supported

 


This entity is used to play sound-files. They can be looping or not.
You can use this to play music as well, however it is recommended to use ambient_music for this purpose.

1 Keyvalues

Sound file : message

Name of the sound file to play.
Supported formats are:

  • AIFF
  • ASF
  • DLS
  • FLAC
  • IT
  • M3U
  • MID
  • MOD
  • MP2
  • MP3
  • OGG
  • S3M
  • VAG
  • WAV
  • WMA
  • XM

Hammer will only let you select WAV-files, but other formats do work as they are fully supported by the game's sound engine. Type the path in manually in that case. File Path starts in the 'sound' folder, example: mymap/soundfile.ogg.
Alternatively, a sentence can be played using the ! prefix followed by a sentence name for the keyvalue, e.g. !C1A2_0. Check the default_sentences.txt file for options.

Volume : health

Set how loud the sound shall be in a range from 0 (not audible) to 10 (normal). Note that this is linear, while the human hearing sense is logarithmic. That means, 10 people talking sound two times as loud as one person talking. 100 people talking sound three times as loud as one person talking. So, a value of '1' will make the sound sound only half as loud as a value of '10' would. A value of '0.1' would make it a third as loud as a value of '10' would. So, if you want your sound to actually be quiet, you are likely to set a value below 1.0.

Play mode : playmode

This is the new way of setting whether a sound will loop or not. If a value other than 'Default' is selected, the 'Unlooped/Cyclic'-flag will be ignored and this option will be referenced to instead. You can also enable linear rolloff with this option, to allow you to setup your own radius. Note that linear rolloff isn't true to how sound works in real life, so it might sound/feel odd.

Dynamic presets : presets

Allows you to specify a dynamic preset to enhance the sound. You should probably experiment with these to find something that sounds good, if you don't want to stick with the default.

Start volume : volstart

Start volume for fade-in; between 0.0 and 10.0.

Fade in time : fadein

Time, in seconds, till the sound will reach "Volume"-value after being triggered on, starting from "Start volume"-value.

Fade out time : fadeout

Time, in seconds, till the sound will have faded out completely after being triggered off.

Pitch : pitch

Sound playback speed, in per-cent.

Start pitch : pitchstart

Initial sound playback speed, in per-cent. Changes towards "Pitch" within fade in time.

Spin up time (0-100) : spinup

Time, in seconds, over which a spinup sound-effect (consecutive fade-ins) shall be applied as the sound starts playing.

Spin down time (0-100) : spindown

Time, in seconds, over which a spindown sound-effect (consecutive fade-outs) shall be applied as the sound is turned off.

LFO type : lfotype

Allows you to set up a low frequency oscillator to modify volume and/or pitch over time, as the sound plays.

LFO rate (0-1000) : lforate

Rate, in Hertz, at which the LFO oscillates. You'll usually want to put low values like 0.3.

LFO mod pitch (0-100) : lfomodpitch

Set how much the LFO shall affect the sound's pitch.

LDO mod vol (0-100) : lfomodrate

Set how much the LFO shall affect the sound's volume.

Refresh rate : refreshrate

Set the delay between LFO-effects-application to the playing sound, in seconds. The default is 0.2 seconds. 0.0 makes the LFO-effect smooth, while greater values can cause it to sound choppy.

Incremental spinup count : cspinup

Set how many consecutive fade-ins/fade-outs shall be applied to spin-up and spin-down sound-effect.

Linear minimum radius : linearmin

When you set the play mode to use linear rolloff, the value set here will be used as the minimum sound radius, meaning the sound will be heard at full volume within this radius around the ambient_generic. You may only choose one of these preset values, as the volume curves need to be precalculated for performance reasons.

Linear maximum radius : linearmax

When you set the play mode to use linear rolloff, the value set here will be used as the maximum sound radius, meaning the sound cannot be heard outside of this radius around the ambient_generic. You may only choose one of these preset values, as the volume curves need to be precalculated for performance reasons.

2 Flags

1 : Play everywhere

The sound will play everywhere.

2 : Small radius

Big sound radius.

4 : Medium radius

Huge sound radius.

8 : Large radius

Extra-huge sound radius.

16 : Start silent

If set, this sound will start off. Only makes sense for looped sounds. This is usually left unchecked for ambient looping sounds, however only with other than default play mode. See notes for more info.

32 : Unlooped/Cyclic

The sound will play once when triggered. If triggered while playing, the sound will stop and restart immediately.

{{Entity_flag|64|User Only (+origin)|The sound will only be audible to the activator of this entity when triggered. If "Play everywhere" flag is set, the sound will be audible to everyone at their own position.

3 Notes

  • Looped sounds that starts enabled ("Start silent" flag unchecked) should use other than default play mode (preferably Linear/Looped) or they need to be triggered by trigger_auto after short delay (e.g. one second) with "Start silent" flag selected. This is because ambient_generics with default play mode are not correctly processed at map start, and works only after triggered.
  • If no sound radius is set, 'Medium radius' is used as a default. You should set only one sound radius, or 'Play everywhere'.