Create(): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (it makes no difference of course)
Line 2: Line 2:
|de=Create():de
|de=Create():de
}}
}}
'''<code>CBaseEntity::Create()</code>''' creates and [[Spawn()|spawns]] a new [[entity]]. It can be called directly as well as from an existing object. {{todo|Is there any difference between those two approaches?}}
'''<code>CBaseEntity::Create()</code>''' creates and [[Spawn()|spawns]] a new [[entity]]. It can be called directly as well as from an existing object. It makes no difference which way you choose.


There is also <code>[[CBaseTempEntity]]::Create()</code>, which has a similar purpose but behaves quite differently.
The function <code>[[CBaseTempEntity]]::Create()</code> has another purpose, it can be used to dispatch an already existing [[Temporary Entity]].


== Arguments ==
== Arguments ==

Revision as of 17:27, 28 May 2011

Template:Otherlang2 CBaseEntity::Create() creates and spawns a new entity. It can be called directly as well as from an existing object. It makes no difference which way you choose.

The function CBaseTempEntity::Create() has another purpose, it can be used to dispatch an already existing Temporary Entity.

Arguments

const char* szName
The classname of the entity that should be created. Must be a pointer to constant memory; an ordinary string literal like "npc_class" will do.
const Vector& vecOrigin
The initial origin of the entity.
const QAngle& vecAngles
The initial orientation of the entity.
CBaseEntity* pOwner
The owner of the new entity. Pass NULL if there shouldn't be one.