Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Editing ambientsound
From Quake Wiki
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | ====Syntax:==== | |
− | + | <code>void ambientsound(vector pos, string sample, float volume, float attenuation)</code> | |
− | |||
− | |||
− | |||
− | |||
+ | 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:==== | ====Parameters:==== | ||
− | + | :<code>pos</code> - The coordinates for the origin of the sound. | |
− | + | :<code>sample</code> - 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. | |
− | + | :<code>volume</code> - A value between 0.0 and 1.0 that controls the volume of the sound. 0.0 is silent, 1.0 is full volume. | |
− | :The path | + | :<code>attenuation</code> - 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#Sounds|Engine Limits]] page. | |
− | : | ||
− | : | ||
− | : | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:QuakeC Function]] | [[Category:QuakeC Function]] |