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

Difference between revisions of "makestatic"

From Quake Wiki

(Created page with "''void'' '''makestatic'''(''entity'' e) == Usage == Bakes an entity into the world. Once this happens the entity is no longer able to be interacted with but will not require...")
 
m (Example)
 
Line 16: Line 16:
 
     precache_model("progs/blue_torch.mdl");
 
     precache_model("progs/blue_torch.mdl");
 
     setmodel(self, "progs/blue_torch.mdl");
 
     setmodel(self, "progs/blue_torch.mdl");
 
+
 
     makestatic(self);
 
     makestatic(self);
 
  }
 
  }

Latest revision as of 17:32, 1 August 2023

void makestatic(entity e)

Usage[edit]

Bakes an entity into the world. Once this happens the entity is no longer able to be interacted with but will not require any networking to maintain. This is best used for entities that are merely cosmetic and can't be interacted with e.g. torches.

Warning: Making an entity static destroys the entity that's being passed. It cannot be referenced in code afterwards.

Parameters[edit]

  • e
The entity to make static.

Example[edit]

// Once this light is initialized, it becomes static
void light_blue_torch()
{
    precache_model("progs/blue_torch.mdl");
    setmodel(self, "progs/blue_torch.mdl");

    makestatic(self);
}