Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Difference between revisions of "precache sound"
From Quake Wiki
(→Syntax:) |
|||
Line 1: | Line 1: | ||
− | + | ''string'' '''precache_sound'''(''string'' soundPath) | |
− | |||
− | Precaches a sound | + | == Usage == |
+ | Precaches a sound so it can be played during the map. Precaching must be done at map load. Sounds cannot be played if they haven't been precached. | ||
− | + | === Parameters === | |
− | : | + | *''soundPath'' |
− | + | :The path of the sound file. Supports WAV (.wav) files. | |
− | |||
+ | === Return === | ||
+ | The passed sound file path. Does nothing. | ||
+ | |||
+ | == Example == | ||
+ | // Precache a sound in the monster's initialization function for use later | ||
+ | void monster_my_monster() | ||
+ | { | ||
+ | precache_sound("mymonster/missile.wav"); | ||
+ | |||
+ | // ... | ||
+ | } | ||
[[Category:QuakeC Function]] | [[Category:QuakeC Function]] |
Latest revision as of 14:37, 31 July 2023
string precache_sound(string soundPath)
Contents
Usage[edit]
Precaches a sound so it can be played during the map. Precaching must be done at map load. Sounds cannot be played if they haven't been precached.
Parameters[edit]
- soundPath
- The path of the sound file. Supports WAV (.wav) files.
Return[edit]
The passed sound file path. Does nothing.
Example[edit]
// Precache a sound in the monster's initialization function for use later void monster_my_monster() { precache_sound("mymonster/missile.wav"); // ... }