Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Difference between revisions of "precache model"
From Quake Wiki
(Created page with "====Syntax:==== <code>string precache_model(string s)</code> Precaches a model for use by the engine. Any model that you want to use MUST be precached. Precaching can only ...") |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | + | ''string'' '''precache_model'''(''string'' modelPath) | |
− | |||
− | Precaches a model | + | == Usage == |
− | + | Precaches a model so it can be used by entities within the map. Precaching must be done at map load. Models cannot be used if they haven't been precached. | |
− | |||
− | |||
− | |||
+ | === Parameters === | ||
+ | *''modelPath'' | ||
+ | :The path to the model file to set. Can be a model (.mdl), sprite (.spr) or BSP (.bsp). | ||
+ | |||
+ | === Return === | ||
+ | The passed model file path. Does nothing. | ||
+ | |||
+ | == Example == | ||
+ | // Precache a model in the monster's initialization function | ||
+ | void monster_my_monster() | ||
+ | { | ||
+ | precache_model("progs/mymonster.mdl"); | ||
+ | |||
+ | // ... | ||
+ | } | ||
[[Category:QuakeC Function]] | [[Category:QuakeC Function]] |
Latest revision as of 15:19, 31 July 2023
string precache_model(string modelPath)
Contents
Usage[edit]
Precaches a model so it can be used by entities within the map. Precaching must be done at map load. Models cannot be used if they haven't been precached.
Parameters[edit]
- modelPath
- The path to the model file to set. Can be a model (.mdl), sprite (.spr) or BSP (.bsp).
Return[edit]
The passed model file path. Does nothing.
Example[edit]
// Precache a model in the monster's initialization function void monster_my_monster() { precache_model("progs/mymonster.mdl"); // ... }