This subpage is used on the Activate() page to display content in English.
If you have edited the language subpage, do not forget to purge the base page by clicking on the button on the right. Otherwise, its contents will not be updated.
Activate() is a
void member function of
CBaseEntity that is available through inheritance to every entity in a Source game. It is called by the engine after
Spawn() and, if
Spawn() occurred during a map's initial load, after all other entities have been spawned too.
Activate() is used to perform spawning tasks that require interaction with other entities. Such tasks should never be performed in
Spawn() itself, as it may be called before any other entities become available.
CBaseEntity executes code in this function, so always call
BaseClass::Activate() from your version.
Activate() is not related to entity inputs or flags of the same name. It is always called.
Note:If an entity is spawned from the console (ex:
ent_create) or via game code (ex:
Activate() is not called so be sure to call
Activate() from the spawning code. Also note that
Activate() is not called for client-side entities.
// Start out with a target entity
SetTargetEntity( STRING(m_strTargetName) );