Entity systemClasses

CBaseEntity

Schema class CBaseEntity, derived from CEntityInstance.

Generated from the game's schema. Header: source2mod/schema/entity/classes/CBaseEntity.h

Inherits CEntityInstance

Fields

FieldType
m_CBodyComponentCBodyComponent*
m_NetworkTransmitComponentCNetworkTransmitComponent
m_aThinkFunctionsCUtlVector<thinkfunc_t>
m_iCurrentThinkContextint32_t
m_nLastThinkTickint32_t
m_bDisabledContextThinksbool
m_isSteadyStateCTypedBitVec<64>
m_lastNetworkChangefloat
m_thinkBASEPTR
m_ResponseContextsCUtlVector<ResponseContext_t>
m_iszResponseContextCUtlSymbolLarge
m_pfnTouchENTITYFUNCPTR
m_pfnUseUSEPTR
m_pfnBlockedENTITYFUNCPTR
m_pfnMoveDoneBASEPTR
m_iHealthint32_t
m_iMaxHealthint32_t
m_lifeStateuint8_t
m_flDamageAccumulatorfloat
m_bTakesDamagebool
m_nTakeDamageFlagsTakeDamageFlags_t
m_nPlatformTypeEntityPlatformTypes_t
m_MoveCollideMoveCollide_t
m_MoveTypeMoveType_t
m_nPreviouslySetMoveTypeMoveType_t
m_nActualMoveTypeMoveType_t
m_nWaterTouchuint8_t
m_nSlimeTouchuint8_t
m_bRestoreInHierarchybool
m_targetCUtlSymbolLarge
m_hDamageFilterCHandle<CBaseFilter>
m_iszDamageFilterNameCUtlSymbolLarge
m_flMoveDoneTimefloat
m_nSubclassIDCUtlStringToken
m_flAnimTimefloat
m_flSimulationTimefloat
m_flCreateTimefloat
m_bClientSideRagdollbool
m_ubInterpolationFrameuint8_t
m_vPrevVPhysicsUpdatePosVector
m_iTeamNumuint8_t
m_iGlobalnameCUtlSymbolLarge
m_iSentToClientsint32_t
m_sUniqueHammerIDCUtlString
m_spawnflagsuint32_t
m_nNextThinkTickint32_t
m_nSimulationTickint32_t
m_OnKilledCEntityIOOutput
m_fFlagsuint32_t
m_vecAbsVelocityVector
m_vecVelocityCNetworkVelocityVector
m_vecBaseVelocityVector
m_nPushEnumCountint32_t
m_pCollisionCCollisionProperty*
m_hEffectEntityCHandle<CBaseEntity>
m_hOwnerEntityCHandle<CBaseEntity>
m_fEffectsuint32_t
m_hGroundEntityCHandle<CBaseEntity>
m_nGroundBodyIndexint32_t
m_flFrictionfloat
m_flElasticityfloat
m_flGravityScalefloat
m_flTimeScalefloat
m_flWaterLevelfloat
m_bGravityDisabledbool
m_bAnimatedEveryTickbool
m_flActualGravityScalefloat
m_bGravityActuallyDisabledbool
m_bDisableLowViolencebool
m_nWaterTypeuint8_t
m_iEFlagsint32_t
m_OnUser1CEntityIOOutput
m_OnUser2CEntityIOOutput
m_OnUser3CEntityIOOutput
m_OnUser4CEntityIOOutput
m_iInitialTeamNumint32_t
m_flNavIgnoreUntilTimefloat
m_vecAngVelocityQAngle
m_bNetworkQuantizeOriginAndAnglesbool
m_bLagCompensatebool
m_pBlockerCHandle<CBaseEntity>
m_flLocalTimefloat
m_flVPhysicsUpdateLocalTimefloat
m_nBloodTypeBloodType
m_pPulseGraphInstanceCPulseGraphInstance_ServerEntity*

Schema fields are accessors: read with entity->m_field(), write with entity->m_field = value (the write marks the field for networking).

Methods

CreateEntityByName

static CBaseEntity* CreateEntityByName(const char* pszClassName);

Creates entity by classname.

ParameterType
pszClassNameconst char*

New

template<typename T> static T* New(const char* pszClassName);

Create entity by classname.

ParameterType
pszClassNameconst char*

FromIndex

template<typename T> static T* FromIndex(int iIndex);
template<typename T> static T* FromIndex(CEntityIndex index);

Get entity by index.

Get entity by entity index.

ParameterType
iIndexint
indexCEntityIndex

AcceptInput

void AcceptInput(const char* pszInput, CEntityInstance* pActivator = nullptr, CEntityInstance* pCaller = nullptr, const char* pszValue = "", HookChain eChain = HookChain::Run);

Accepts entity input.

ParameterTypeDefault
pszInputconst char*
pActivatorCEntityInstance*nullptr
pCallerCEntityInstance*nullptr
pszValueconst char*""
eChainHookChainHookChain::Run

AddEntityIOEvent

void AddEntityIOEvent(const char* pszInput, CEntityInstance* pActivator = nullptr, CEntityInstance* pCaller = nullptr, const char* pszValue = "", float flDelay = 0.0f, HookChain eChain = HookChain::Run);

Add delayed entity IO event.

ParameterTypeDefault
pszInputconst char*
pActivatorCEntityInstance*nullptr
pCallerCEntityInstance*nullptr
pszValueconst char*""
flDelayfloat0.0f
eChainHookChainHookChain::Run

AddSingleEntityIOListener

CEntityIOListenerHandle* AddSingleEntityIOListener(const char* pszOutput, std::function<Action(const char*, CEntityInstance*, CEntityInstance*, float, bool)> callback, bool post);

Add signle entity IO listener.

GetAbsOrigin

Vector GetAbsOrigin();

Get absolute origin.

GetAngRotation

QAngle GetAngRotation();

Get local rotation.

GetAbsRotation

QAngle GetAbsRotation();

Get absolute rotation.

GetAbsVelocity

Vector GetAbsVelocity();

Get absolute velocity.

SetAbsOrigin

void SetAbsOrigin(Vector vecOrigin);

Set absolute origin.

ParameterType
vecOriginVector

SetAbsRotation

void SetAbsRotation(QAngle angAbsRotation);

Set absolute rotation.

ParameterType
angAbsRotationQAngle

SetAngRotation

void SetAngRotation(QAngle angRotation);

Set local rotation.

ParameterType
angRotationQAngle

SetAbsVelocity

void SetAbsVelocity(Vector vecVelocity);

Set absolute velocity.

ParameterType
vecVelocityVector

SetBaseVelocity

void SetBaseVelocity(Vector vecVelocity);

Set base velocity.

ParameterType
vecVelocityVector

GetVData

CEntitySubclassVDataBase* GetVData();

Get entity VData.

DispatchSpawn

void DispatchSpawn(CEntityKeyValues* pEntityKeyValues = nullptr, HookChain eChain = HookChain::Run);

Spawn entity.

ParameterTypeDefault
pEntityKeyValuesCEntityKeyValues*nullptr
eChainHookChainHookChain::Run

Teleport

void Teleport(const Vector* pPosition, const QAngle* pAngles, const Vector* pVelocity, HookChain eChain = HookChain::Run);

Teleport entity.

ParameterTypeDefault
pPositionconst Vector*
pAnglesconst QAngle*
pVelocityconst Vector*
eChainHookChainHookChain::Run

SetMoveType

void SetMoveType(MoveType_t nMoveType);

Set move type.

ParameterType
nMoveTypeMoveType_t

GetCollisionGroup

uint8 GetCollisionGroup();

Get collision group.

SetCollisionGroup

void SetCollisionGroup(uint8 nCollisionGroup);

Set collision group.

ParameterType
nCollisionGroupuint8

CollisionRulesChanged

void CollisionRulesChanged();

Notify collision rules changed.

GetIndex

int GetIndex();

Get entity index.

GetHandle

template<typename T = CBaseEntity> CHandle<T> GetHandle();

Get entity handle. Templated the same way New() is: every generated entity class shadows it with a plain GetHandle() returning CHandle of its own type, so player->GetHandle() on a CCSPlayerController* is a CHandle<CCSPlayerController>.

GetName

const char* GetName() const;

Get entity name.

Remove

void Remove(HookChain eChain = HookChain::Run);

Removes the entity (UTIL_Remove).

ParameterTypeDefault
eChainHookChainHookChain::Run

DispatchParticleEffect

void DispatchParticleEffect(const char* pszParticleName, ParticleAttachment_t nAttachType = ParticleAttachment_t::PATTACH_ABSORIGIN_FOLLOW, uint8 nAttachmentPoint = 0, bool bResetAllParticlesOnEntity = false, IRecipientFilter* pFilter = nullptr, HookChain eChain = HookChain::Run);

Dispatches a particle effect on this entity. A null filter sends it to everyone.

ParameterTypeDefault
pszParticleNameconst char*
nAttachTypeParticleAttachment_tParticleAttachment_t::PATTACH_ABSORIGIN_FOLLOW
nAttachmentPointuint80
bResetAllParticlesOnEntityboolfalse
pFilterIRecipientFilter*nullptr
eChainHookChainHookChain::Run

On this page