Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Difference between revisions of "spawn (function)"
From Quake Wiki
Line 1: | Line 1: | ||
− | + | ''entity'' '''spawn'''() | |
− | |||
− | + | == Usage == | |
− | + | Creates a new default entity. Note that if you're spawning an entity that relies on precached sounds and models, one entity of that type must be spawned at map load or their sounds and models precached elsewhere (the server itself, another entity type, etc.). | |
− | |||
− | |||
− | |||
+ | === Return === | ||
+ | The newly created entity. | ||
+ | |||
+ | == Example == | ||
+ | // Creates an Ogre | ||
+ | entity ogre = spawn(); | ||
+ | ogre.classname = "monster_ogre"; | ||
+ | |||
+ | entity curSelf = self; | ||
+ | self = ogre; | ||
+ | monster_ogre(); | ||
+ | self = curSelf; | ||
[[Category:QuakeC Function]] | [[Category:QuakeC Function]] |
Latest revision as of 12:32, 31 July 2023
entity spawn()
Usage[edit]
Creates a new default entity. Note that if you're spawning an entity that relies on precached sounds and models, one entity of that type must be spawned at map load or their sounds and models precached elsewhere (the server itself, another entity type, etc.).
Return[edit]
The newly created entity.
Example[edit]
// Creates an Ogre entity ogre = spawn(); ogre.classname = "monster_ogre"; entity curSelf = self; self = ogre; monster_ogre(); self = curSelf;