Create(): Difference between revisions
Jump to navigation
Jump to search
TomEdwards (talk | contribs) (un-redirected: not specific to TEs!) |
No edit summary |
||
| Line 1: | Line 1: | ||
{{otherlang2 | |||
|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. {{todo|Is there any difference between those two approaches?}} | ||
| Line 15: | Line 18: | ||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:English]] | |||
Revision as of 15:50, 28 May 2011
CBaseEntity::Create() creates and 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?
There is also CBaseTempEntity::Create(), which has a similar purpose but behaves quite differently.
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
NULLif there shouldn't be one.