SEntitySpawnParams

SEntitySpawnParams

Structure used when spawning new entities to define their initial state. More...

#include

Public Attributes

Vec3 vPosition = ZERO
Optional: Initial position of the new entity instance in world space if pParent is not specified, otherwise local.
Quat qRotation = IDENTITY
Optional: Initial rotation of the new entity instance in world space if pParent is not specified, otherwise local.
Vec3 vScale = Vec3(1.f)
Optional: Initial scale of the new entity instance in world space if pParent is not specified, otherwise local.
const char * sName = ""
uint32 nFlags = 0
uint32 nFlagsExtended = 0
IEntity * pParent = nullptr
SChildAttachParams attachmentParams
Used when pParent is specified, same behavior as pParent->AttachChild(this, attachmentParams).
IEntityClass * pClass = nullptr
Optional: Entity class to use, if null we use the default class.
EntityId id = INVALID_ENTITYID
EntityId prevId = INVALID_ENTITYID
Optional: Unique entity identifier used for the previous instance if we are reloading.
bool bStaticEntityId = false
EntityGUID guid
EntityGUID prevGuid
Optional: Globally unique identifier used for the previous instance if we are reloading.
const char * sLayerName = ""
Optional: The name of the layer the entity resides in, used in the Editor.
XmlNodeRef entityNode
Optional: Reference to entity's xml data, used when loading entities from disk.
bool bIgnoreLock = false
void * pUserData = nullptr
Optional: User data that can be read from IEntitySystemSink to interact with the spawning of entities.
TSerialize * pSpawnSerializer = nullptr
IScriptTable * pPropertiesTable = nullptr
IScriptTable * pPropertiesInstanceTable = nullptr
IEntityArchetype * pArchetype = nullptr

Detailed Description

Structure used when spawning new entities to define their initial state.

Member Data Documentation

◆ bIgnoreLock

bool SEntitySpawnParams::bIgnoreLock = false

Optional: Whether the spawning of this entity should ignore whether or not IEntitySystem::LockSpawning was called If not provided, the spawning will fail if a lock was put in place

◆ bStaticEntityId

bool SEntitySpawnParams::bStaticEntityId = false

Optional: Used when id is set to automatically generate (id = INVALID_ENTITYID) to pick identifiers from the static pool instead of being treated as a dynamically spawned entity This is useful for supporting save games compatible with patched levels

◆ guid

EntityGUID SEntitySpawnParams::guid

Optional: Globally unique identifier for this entity instance, this is guaranteed to be unique across sessions and save games assuming that the entity is saved by the entity system If one is not provided, it will be generated by the entity system

◆ nFlags

uint32 SEntitySpawnParams::nFlags = 0

Optional: Default entity flags to assign to the new instance See EEntityFlags

◆ nFlagsExtended

uint32 SEntitySpawnParams::nFlagsExtended = 0

Optional: Default extended entity flags to assign to the new instance See EEntityFlagsExtended

◆ pParent

IEntity* SEntitySpawnParams::pParent = nullptr

Optional: Specify the parent of the new entity instance, ensuring that the new instance's coordinates are in relation to its parent Note that setting this will indicate that vPosition, qRotation and vScale should be provided in local space

◆ pSpawnSerializer

TSerialize* SEntitySpawnParams::pSpawnSerializer = nullptr

Set by networking when an entity is being spawned on a client as requested by the server This can be used by custom entity classes to deserialize data specified by the host via IEntity::GetSerializableNetworkSpawnInfo. Used internally to automatically call IEntityComponent::NetReplicateSerialize.

◆ sName

const char* SEntitySpawnParams::sName = ""

Optional: Name of the new entity instance Does not have to be unique!

Note
The name of the entity does not need to be unique.