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

spawn (function)

From Quake Wiki

Revision as of 12:32, 31 July 2023 by Boondorl (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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;