Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

Difference between revisions of "ambientsound"

From Quake Wiki

m (Other Details:: linked to Engine Limits page)
Line 11: Line 11:
 
:void
 
:void
 
====Other Details:====
 
====Other Details:====
There is a separate limit to how many ambient sounds can be placed in a map (even if they are the same sound).  In stock Quake, this is 128. (VERIFY?)
+
There is a separate limit to how many ambient sounds can be placed in a map (even if they are the same sound).  In stock Quake, this is 128. You can view the known limits for other engines at the [[Engine Limits#Sounds|Engine Limits]] page.
  
  
 
[[Category:QuakeC Function]]
 
[[Category:QuakeC Function]]

Revision as of 23:03, 27 March 2013

Syntax:

void ambientsound(vector pos, string sample, float volume, float attenuation)

Starts a sound as an ambient sound. Unlike normal sounds started from the sound function, an ambient sound will never stop playing, even if the player moves out of audible range. It will also be properly registered by the engine if it is started outside of hearing range of the player.

Parameters:

pos - The coordinates for the origin of the sound.
sample - The path to the sound file. Unlike models, sounds have /sound/ already present, so do not include that directory in the pathname. This sound MUST be looped by placing markers in the .wav file.
volume - A value between 0.0 and 1.0 that controls the volume of the sound. 0.0 is silent, 1.0 is full volume.
attenuation - A value greater than or equal to 0 and less than 4 that controls how fast the sound's volume attenuated from distance. 0 can be heard everywhere in the level, 1 can be heard up to 1000 units and 3.999 has a radius of about 250 units.

Returns:

void

Other Details:

There is a separate limit to how many ambient sounds can be placed in a map (even if they are the same sound). In stock Quake, this is 128. You can view the known limits for other engines at the Engine Limits page.