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

ambientsound

From Quake Wiki

Revision as of 04:25, 27 March 2013 by Necros (talk | contribs)

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. (VERIFY?)