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


From Quake Wiki

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

void setmodel(entity e, string modelPath)


Sets the entity's model. Valid models must be precached at map load in order to be usable. This sets both the model and modelindex fields. The model index is the index within the cache which is not exposed to QuakeC, but can be set directly by storing the value and changing it. The model name and model index do not need to match as modelindex takes priority.

For BSP models this also sets up the size information of the entity meaning setsize() should not be used on them. BSP entities will automatically store their model name in their model field on map load, so calling setmodel(self, self.model); will work for things like platforms, doors, and trains.

To clear a model, setting model to ""/string_null or setting modelindex to 0 will work.


  • e
The entity whose model is being set.
  • modelPath
The path to the model file to set. Can be a model (.mdl), sprite (.spr) or BSP (.bsp).


void monster_my_monster()
    // Make sure the model is precached first in the initialization function

    // Set the entity's model to mymonster.mdl
    setmodel(self, "progs/mymonster.mdl");