Difference between revisions of "CAmbientGeneric (CS)"

From AlliedModders Wiki
Jump to: navigation, search
(CAmbientGeneric offset list)
 
(Added some contents.)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:CS Offset List]]
+
[[Category:CS Class List]]
  
  
* [[CBaseEntity Offset List (Counter-Strike)|CBaseEntity]]
+
== Basic Information ==
** '''CAmbienGeneric ''' ''(ambient_generic)''
 
  
 +
* '''Classname''': CAmbientGeneric. <br />
 +
* '''Inheriting Instances''': ambient_generic.<br />
 +
* '''Description''': The ambient_generic allows you to play a specific sound. <br />
  
<tt>''W = Windows'' |</tt><tt> ''L = Linux''</tt>
+
 
 +
== Class Hierarchy ==
 +
 
 +
* [[CBaseEntity (CS)|CBaseEntity]]
 +
** '''CAmbientGeneric''' ''(ambient_generic)''
 +
 
 +
 
 +
== Entity Data ==
 +
 
 +
<tt>W = Windows |</tt><tt> L = Linux</tt>
 
{| cellpadding="4"
 
{| cellpadding="4"
 
|- class="t2th"
 
|- class="t2th"
Line 13: Line 24:
 
| m_flAttenuation
 
| m_flAttenuation
 
| style="text-align:center" | 34  
 
| style="text-align:center" | 34  
| style="text-align:center" | 39
+
| style="text-align:center" | 38
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | float
 
| style="text-align:center" | float
 
| Attenuation value.
 
| Attenuation value.
 
<pawn>
 
<pawn>
// attenuation values
+
-1     : "Default"       | None
#define ATTN_NONE 0
+
ATTN_NONE   : "Everywhere"    | AMBIENT_SOUND_EVERYWHERE 
#define ATTN_NORM 0.8
+
ATTN_IDLE   : "Small Radius"  | AMBIENT_SOUND_SMALLRADIUS 
#define ATTN_IDLE 2.0
+
ATTN_STATIC : "Medium Radius" | AMBIENT_SOUND_MEDIUMRADIUS
#define ATTN_STATIC 1.25
+
ATTN_NORM  : "Large Radius"  | AMBIENT_SOUND_LARGERADIUS
 
</pawn>
 
</pawn>
 
|- class="t2td"
 
|- class="t2td"
 
| m_dpv.preset
 
| m_dpv.preset
 
| style="text-align:center" | 35  
 
| style="text-align:center" | 35  
| style="text-align:center" | 40
+
| style="text-align:center" | 39
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| None.
 
| None.
Line 34: Line 45:
 
| m_dpv.pitchrun
 
| m_dpv.pitchrun
 
| style="text-align:center" | 36  
 
| style="text-align:center" | 36  
| style="text-align:center" | 41
+
| style="text-align:center" | 40
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| Pitch shift % when sound is running 0 - 255.
 
| Pitch shift % when sound is running 0 - 255.
Line 41: Line 52:
 
| m_dpv.pitchstart
 
| m_dpv.pitchstart
 
| style="text-align:center" | 37  
 
| style="text-align:center" | 37  
| style="text-align:center" | 42
+
| style="text-align:center" | 41
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| Pitch shift % when sound stops or starts 0 - 255.
 
| Pitch shift % when sound stops or starts 0 - 255.
Line 48: Line 59:
 
| m_dpv.spinup
 
| m_dpv.spinup
 
| style="text-align:center" | 38  
 
| style="text-align:center" | 38  
 +
| style="text-align:center" | 42
 +
| style="text-align:center" | +4
 +
| style="text-align:center" | int
 +
| Spinup time 0 - 100.
 +
|- class="t2td"
 +
| m_dpv.spindown
 +
| style="text-align:center" | 39
 
| style="text-align:center" | 43  
 
| style="text-align:center" | 43  
 
| style="text-align:center" | +5  
 
| style="text-align:center" | +5  
 
| style="text-align:center" | int
 
| style="text-align:center" | int
| Spinup time 0 - 100.
+
| Spindown time 0 - 100.
 
|- class="t2td"
 
|- class="t2td"
 
| m_dpv.volrun
 
| m_dpv.volrun
| style="text-align:center" | 39
+
| style="text-align:center" | 40
 
| style="text-align:center" | 44  
 
| style="text-align:center" | 44  
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| Volume change % when sound is running 0 - 10.
 
| Volume change % when sound is running 0 - 10.
 
|- class="t2td"
 
|- class="t2td"
 
| m_dpv.volstart
 
| m_dpv.volstart
| style="text-align:center" | 40
+
| style="text-align:center" | 41
| style="text-align:center" | 46
+
| style="text-align:center" | 45
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| Volume change % when sound stops or starts 0 - 10.
 
| Volume change % when sound stops or starts 0 - 10.
 
|- class="t2td"
 
|- class="t2td"
 
| m_dpv.fadein
 
| m_dpv.fadein
| style="text-align:center" | 41
+
| style="text-align:center" | 42
 
| style="text-align:center" | 46  
 
| style="text-align:center" | 46  
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| Volume fade in time 0 - 100.
 
| Volume fade in time 0 - 100.
 
|- class="t2td"
 
|- class="t2td"
 
| m_dpv.fadeout
 
| m_dpv.fadeout
| style="text-align:center" | 42
+
| style="text-align:center" | 43
 
| style="text-align:center" | 47  
 
| style="text-align:center" | 47  
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| Volume fade out time 0 - 100.
 
| Volume fade out time 0 - 100.
 
|- class="t2td"
 
|- class="t2td"
 
| m_dpv.lfotype
 
| m_dpv.lfotype
| style="text-align:center" | 43
+
| style="text-align:center" | 44
 
| style="text-align:center" | 48  
 
| style="text-align:center" | 48  
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| Low Frequency Oscillator. 0) off 1) square 2) triangle 3) random.
 
| Low Frequency Oscillator. 0) off 1) square 2) triangle 3) random.
 
|- class="t2td"
 
|- class="t2td"
 
| m_dpv.lforate
 
| m_dpv.lforate
| style="text-align:center" | 44
+
| style="text-align:center" | 45
 
| style="text-align:center" | 49  
 
| style="text-align:center" | 49  
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| Low Frequency Oscillator. 0 - 1000, how fast lfo osciallates.
 
| Low Frequency Oscillator. 0 - 1000, how fast lfo osciallates.
 
|- class="t2td"
 
|- class="t2td"
 
| m_dpv.lfomodpitch
 
| m_dpv.lfomodpitch
| style="text-align:center" | 45
+
| style="text-align:center" | 46
 
| style="text-align:center" | 50  
 
| style="text-align:center" | 50  
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| 0-100 mod of current pitch. 0 is off.
 
| 0-100 mod of current pitch. 0 is off.
 
|- class="t2td"
 
|- class="t2td"
 
| m_dpv.lfomodvol
 
| m_dpv.lfomodvol
| style="text-align:center" | 46
+
| style="text-align:center" | 47
 
| style="text-align:center" | 51  
 
| style="text-align:center" | 51  
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| 0-100 mod of current volume. 0 is off.
 
| 0-100 mod of current volume. 0 is off.
 
|- class="t2td"
 
|- class="t2td"
 
| m_dpv.cspinup
 
| m_dpv.cspinup
| style="text-align:center" | 47
+
| style="text-align:center" | 48
 
| style="text-align:center" | 52  
 
| style="text-align:center" | 52  
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| Each trigger hit increments counter and spinup pitch.
 
| Each trigger hit increments counter and spinup pitch.
 
|- class="t2td"
 
|- class="t2td"
 
| m_dpv.cspincount
 
| m_dpv.cspincount
| style="text-align:center" | 48
+
| style="text-align:center" | 49
 
| style="text-align:center" | 53  
 
| style="text-align:center" | 53  
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| None.
 
| None.
Line 125: Line 143:
 
| m_dpv.pitch
 
| m_dpv.pitch
 
| style="text-align:center" | 50  
 
| style="text-align:center" | 50  
| style="text-align:center" | 55
+
| style="text-align:center" | 54
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| None.
 
| None.
Line 132: Line 150:
 
| m_dpv.spinupsav
 
| m_dpv.spinupsav
 
| style="text-align:center" | 51  
 
| style="text-align:center" | 51  
| style="text-align:center" | 56
+
| style="text-align:center" | 55
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| None.
 
| None.
Line 139: Line 157:
 
| m_dpv.spindownsav
 
| m_dpv.spindownsav
 
| style="text-align:center" | 52
 
| style="text-align:center" | 52
| style="text-align:center" | 57
+
| style="text-align:center" | 56
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| None.
 
| None.
Line 146: Line 164:
 
| m_dpv.cspincount
 
| m_dpv.cspincount
 
| style="text-align:center" | 53  
 
| style="text-align:center" | 53  
| style="text-align:center" | 58
+
| style="text-align:center" | 57
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| None.
 
| None.
Line 153: Line 171:
 
| m_dpv.pitchfrac
 
| m_dpv.pitchfrac
 
| style="text-align:center" | 54
 
| style="text-align:center" | 54
| style="text-align:center" | 59
+
| style="text-align:center" | 58
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| None.
 
| None.
Line 160: Line 178:
 
| m_dpv.vol
 
| m_dpv.vol
 
| style="text-align:center" | 55  
 
| style="text-align:center" | 55  
| style="text-align:center" | 60
+
| style="text-align:center" | 59
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| None.
 
| None.
Line 167: Line 185:
 
| m_dpv.fadeoutsav
 
| m_dpv.fadeoutsav
 
| style="text-align:center" | 56  
 
| style="text-align:center" | 56  
| style="text-align:center" | 61
+
| style="text-align:center" | 60
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| None.
 
| None.
Line 174: Line 192:
 
| m_dpv.volfrac
 
| m_dpv.volfrac
 
| style="text-align:center" | 57  
 
| style="text-align:center" | 57  
| style="text-align:center" | 62
+
| style="text-align:center" | 61
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| None.
 
| None.
Line 181: Line 199:
 
| m_dpv.lfofrac
 
| m_dpv.lfofrac
 
| style="text-align:center" | 58  
 
| style="text-align:center" | 58  
| style="text-align:center" | 63
+
| style="text-align:center" | 62
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| None.
 
| None.
Line 188: Line 206:
 
| m_dpv.lfomult
 
| m_dpv.lfomult
 
| style="text-align:center" | 59  
 
| style="text-align:center" | 59  
| style="text-align:center" | 64
+
| style="text-align:center" | 63
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | int
 
| style="text-align:center" | int
 
| None.
 
| None.
Line 195: Line 213:
 
| m_fActive
 
| m_fActive
 
| style="text-align:center" | 60  
 
| style="text-align:center" | 60  
| style="text-align:center" | 65
+
| style="text-align:center" | 64
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | BOOL
 
| style="text-align:center" | BOOL
 
| Only TRUE when the entity is playing a looping sound.
 
| Only TRUE when the entity is playing a looping sound.
Line 202: Line 220:
 
| m_fLooping
 
| m_fLooping
 
| style="text-align:center" | 61
 
| style="text-align:center" | 61
| style="text-align:center" | 66
+
| style="text-align:center" | 65
| style="text-align:center" | +5
+
| style="text-align:center" | +4
 
| style="text-align:center" | BOOL
 
| style="text-align:center" | BOOL
 
| TRUE when the sound played will loop.
 
| TRUE when the sound played will loop.
Line 209: Line 227:
  
  
== Spawn flags ==
+
== Entity Attributes ==
 +
 
 +
* '''Name''' (''targetname'') - Property used to identify entities.
 +
* '''WAV name''' (''message'') - This is the path/filename of the .wav file (note the forward-slash).
 +
* '''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'')
 +
 
 +
 
 +
== Entity Flags ==
  
 
<pawn>
 
<pawn>
#define AMBIENT_SOUND_STATIC 0  // medium radius attenuation
+
#define AMBIENT_SOUND_STATIC 0   
#define AMBIENT_SOUND_EVERYWHERE 1
+
#define AMBIENT_SOUND_EVERYWHERE 1   // Play Everywhere (1) - Sound will be heard in the entire level.
#define AMBIENT_SOUND_SMALLRADIUS 2
+
#define AMBIENT_SOUND_SMALLRADIUS 2   // Small Radius    (2) - Sound range is about 800 units at max volume.
#define AMBIENT_SOUND_MEDIUMRADIUS 4
+
#define AMBIENT_SOUND_MEDIUMRADIUS 4   // Medium Radius  (4) - Sound range is about 1250 units at max volume.
#define AMBIENT_SOUND_LARGERADIUS 8
+
#define AMBIENT_SOUND_LARGERADIUS 8   // Large Radius    (8) - Sound range is about 2000 units at max volume.
#define AMBIENT_SOUND_START_SILENT 16
+
#define AMBIENT_SOUND_START_SILENT 16 // Start Silent  (16) - Checking this means the entity must be triggered to work.
#define AMBIENT_SOUND_NOT_LOOPING 32
+
#define AMBIENT_SOUND_NOT_LOOPING 32 // Not Toggled    (32) - Older FGDs show this as Not Looped. Specifies that
 +
                                            /* the sound is to be played only once. With this flag checked, each time the
 +
                                              entity is triggered it will play once. If it is not checked, triggering it will
 +
                                              cause the sound to alternate between on and off. */
 
</pawn>
 
</pawn>
 +
  
 
== Constants ==
 
== Constants ==
Line 249: Line 322:
 
#define VOL_NORM 1.0
 
#define VOL_NORM 1.0
 
</pawn>
 
</pawn>
 +
 +
 +
== Notes ==
 +
 +
* From WorldCraft 2.1 Help: “''To play a wav through the streaming code (for very large, one-shot wavs) use <nowiki>*</nowiki> in front of the name. For instance, ambience/<nowiki>*</nowiki>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 <nowiki>!</nowiki> followed by the sentence name. For instance, <nowiki>!</nowiki>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).''”
 +
 +
 +
== HLSDK Reference ==
 +
 +
* [http://svn.tcwonline.org/viewvc.cgi/hlsdk/dlls/sound.cpp?view=markup&root=amxmodx sound.cpp] ''(line 31)''
 +
 +
 +
== Related Links ==
 +
 +
* [http://twhl.co.za/wiki.php?id=122 TWHL]

Latest revision as of 07:22, 29 August 2009


Basic Information

  • Classname: CAmbientGeneric.
  • Inheriting Instances: ambient_generic.
  • Description: The ambient_generic allows you to play a specific sound.


Class Hierarchy


Entity Data

W = Windows | L = Linux

Name W. Offset L. Offset L. Diff Type Description
m_flAttenuation 34 38 +4 float Attenuation value.
-1	    : "Default"	      | None
ATTN_NONE   : "Everywhere"    | AMBIENT_SOUND_EVERYWHERE   
ATTN_IDLE   : "Small Radius"  | AMBIENT_SOUND_SMALLRADIUS  
ATTN_STATIC : "Medium Radius" | AMBIENT_SOUND_MEDIUMRADIUS
ATTN_NORM   : "Large Radius"  | AMBIENT_SOUND_LARGERADIUS
m_dpv.preset 35 39 +4 int None.
m_dpv.pitchrun 36 40 +4 int Pitch shift % when sound is running 0 - 255.
m_dpv.pitchstart 37 41 +4 int Pitch shift % when sound stops or starts 0 - 255.
m_dpv.spinup 38 42 +4 int Spinup time 0 - 100.
m_dpv.spindown 39 43 +5 int Spindown time 0 - 100.
m_dpv.volrun 40 44 +4 int Volume change % when sound is running 0 - 10.
m_dpv.volstart 41 45 +4 int Volume change % when sound stops or starts 0 - 10.
m_dpv.fadein 42 46 +4 int Volume fade in time 0 - 100.
m_dpv.fadeout 43 47 +4 int Volume fade out time 0 - 100.
m_dpv.lfotype 44 48 +4 int Low Frequency Oscillator. 0) off 1) square 2) triangle 3) random.
m_dpv.lforate 45 49 +4 int Low Frequency Oscillator. 0 - 1000, how fast lfo osciallates.
m_dpv.lfomodpitch 46 50 +4 int 0-100 mod of current pitch. 0 is off.
m_dpv.lfomodvol 47 51 +4 int 0-100 mod of current volume. 0 is off.
m_dpv.cspinup 48 52 +4 int Each trigger hit increments counter and spinup pitch.
m_dpv.cspincount 49 53 +4 int None.
m_dpv.pitch 50 54 +4 int None.
m_dpv.spinupsav 51 55 +4 int None.
m_dpv.spindownsav 52 56 +4 int None.
m_dpv.cspincount 53 57 +4 int None.
m_dpv.pitchfrac 54 58 +4 int None.
m_dpv.vol 55 59 +4 int None.
m_dpv.fadeoutsav 56 60 +4 int None.
m_dpv.volfrac 57 61 +4 int None.
m_dpv.lfofrac 58 62 +4 int None.
m_dpv.lfomult 59 63 +4 int None.
m_fActive 60 64 +4 BOOL Only TRUE when the entity is playing a looping sound.
m_fLooping 61 65 +4 BOOL TRUE when the sound played will loop.


Entity Attributes

  • Name (targetname) - Property used to identify entities.
  • WAV name (message) - This is the path/filename of the .wav file (note the forward-slash).
  • 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)


Entity Flags

#define AMBIENT_SOUND_STATIC		0  
#define AMBIENT_SOUND_EVERYWHERE	1   // Play Everywhere (1) - Sound will be heard in the entire level.
#define AMBIENT_SOUND_SMALLRADIUS	2   // Small Radius    (2) - Sound range is about 800 units at max volume.
#define AMBIENT_SOUND_MEDIUMRADIUS	4   // Medium Radius   (4) - Sound range is about 1250 units at max volume.
#define AMBIENT_SOUND_LARGERADIUS	8   // Large Radius    (8) - Sound range is about 2000 units at max volume.
#define AMBIENT_SOUND_START_SILENT	16  // Start Silent   (16) - Checking this means the entity must be triggered to work.
#define AMBIENT_SOUND_NOT_LOOPING	32  // Not Toggled    (32) - Older FGDs show this as Not Looped. Specifies that 
                                            /* the sound is to be played only once. With this flag checked, each time the 
                                               entity is triggered it will play once. If it is not checked, triggering it will
                                               cause the sound to alternate between on and off. */


Constants

// channels
#define CHAN_AUTO		0
#define CHAN_WEAPON		1
#define	CHAN_VOICE		2
#define CHAN_ITEM		3
#define	CHAN_BODY	        4
#define CHAN_STREAM		5	// allocate stream channel from the static or dynamic area
#define CHAN_STATIC		6	// allocate channel from the static area 
#define CHAN_NETWORKVOICE_BASE	7	// voice data coming across the network
#define CHAN_NETWORKVOICE_END	500     // network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END).
 
// attenuation values
#define ATTN_NONE		0
#define	ATTN_NORM		0.8
#define ATTN_IDLE		2
#define ATTN_STATIC		1.25 
 
// pitch values
#define	PITCH_NORM		100	// non-pitch shifted
#define PITCH_LOW		95	// other values are possible - 0-255, where 255 is very high
#define PITCH_HIGH		120
 
// volume values
#define VOL_NORM		1.0


Notes

  • 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).


HLSDK Reference


Related Links