Create(): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (it makes no difference of course)
mNo edit summary
Line 1: Line 1:
{{otherlang2
{{lang|Create()}}
|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. It makes no difference which way you choose.
'''<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.


Line 7: Line 5:


== Arguments ==
== Arguments ==
; <code>const [[char]]* szName</code>
; <code>const [[char]]* szName</code>
: The [[classname]] of the entity that should be created. Must be a pointer to constant memory; an ordinary string literal like <code>"npc_class"</code> will do.
: The [[classname]] of the entity that should be created. Must be a pointer to constant memory; an ordinary string literal like <code>"npc_class"</code> will do.
Line 17: Line 14:
: The [[owner]] of the new entity. Pass <code>NULL</code> if there shouldn't be one.
: The [[owner]] of the new entity. Pass <code>NULL</code> if there shouldn't be one.


[[Category:Functions]]
[[Category:Functions]][[Category:English]]
[[Category:English]]

Revision as of 15:14, 14 May 2021

English (en)Deutsch (de)Português do Brasil (pt-br)Русский (ru)Translate (Translate)

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.