CBaseEntity
Schema class CBaseEntity, derived from CEntityInstance.
Generated from the game's schema. Header: source2mod/schema/entity/classes/CBaseEntity.h
Inherits CEntityInstance
Fields
| Field | Type |
|---|---|
m_CBodyComponent | CBodyComponent* |
m_NetworkTransmitComponent | CNetworkTransmitComponent |
m_aThinkFunctions | CUtlVector<thinkfunc_t> |
m_iCurrentThinkContext | int32_t |
m_nLastThinkTick | int32_t |
m_bDisabledContextThinks | bool |
m_isSteadyState | CTypedBitVec<64> |
m_lastNetworkChange | float |
m_think | BASEPTR |
m_ResponseContexts | CUtlVector<ResponseContext_t> |
m_iszResponseContext | CUtlSymbolLarge |
m_pfnTouch | ENTITYFUNCPTR |
m_pfnUse | USEPTR |
m_pfnBlocked | ENTITYFUNCPTR |
m_pfnMoveDone | BASEPTR |
m_iHealth | int32_t |
m_iMaxHealth | int32_t |
m_lifeState | uint8_t |
m_flDamageAccumulator | float |
m_bTakesDamage | bool |
m_nTakeDamageFlags | TakeDamageFlags_t |
m_nPlatformType | EntityPlatformTypes_t |
m_MoveCollide | MoveCollide_t |
m_MoveType | MoveType_t |
m_nPreviouslySetMoveType | MoveType_t |
m_nActualMoveType | MoveType_t |
m_nWaterTouch | uint8_t |
m_nSlimeTouch | uint8_t |
m_bRestoreInHierarchy | bool |
m_target | CUtlSymbolLarge |
m_hDamageFilter | CHandle<CBaseFilter> |
m_iszDamageFilterName | CUtlSymbolLarge |
m_flMoveDoneTime | float |
m_nSubclassID | CUtlStringToken |
m_flAnimTime | float |
m_flSimulationTime | float |
m_flCreateTime | float |
m_bClientSideRagdoll | bool |
m_ubInterpolationFrame | uint8_t |
m_vPrevVPhysicsUpdatePos | Vector |
m_iTeamNum | uint8_t |
m_iGlobalname | CUtlSymbolLarge |
m_iSentToClients | int32_t |
m_sUniqueHammerID | CUtlString |
m_spawnflags | uint32_t |
m_nNextThinkTick | int32_t |
m_nSimulationTick | int32_t |
m_OnKilled | CEntityIOOutput |
m_fFlags | uint32_t |
m_vecAbsVelocity | Vector |
m_vecVelocity | CNetworkVelocityVector |
m_vecBaseVelocity | Vector |
m_nPushEnumCount | int32_t |
m_pCollision | CCollisionProperty* |
m_hEffectEntity | CHandle<CBaseEntity> |
m_hOwnerEntity | CHandle<CBaseEntity> |
m_fEffects | uint32_t |
m_hGroundEntity | CHandle<CBaseEntity> |
m_nGroundBodyIndex | int32_t |
m_flFriction | float |
m_flElasticity | float |
m_flGravityScale | float |
m_flTimeScale | float |
m_flWaterLevel | float |
m_bGravityDisabled | bool |
m_bAnimatedEveryTick | bool |
m_flActualGravityScale | float |
m_bGravityActuallyDisabled | bool |
m_bDisableLowViolence | bool |
m_nWaterType | uint8_t |
m_iEFlags | int32_t |
m_OnUser1 | CEntityIOOutput |
m_OnUser2 | CEntityIOOutput |
m_OnUser3 | CEntityIOOutput |
m_OnUser4 | CEntityIOOutput |
m_iInitialTeamNum | int32_t |
m_flNavIgnoreUntilTime | float |
m_vecAngVelocity | QAngle |
m_bNetworkQuantizeOriginAndAngles | bool |
m_bLagCompensate | bool |
m_pBlocker | CHandle<CBaseEntity> |
m_flLocalTime | float |
m_flVPhysicsUpdateLocalTime | float |
m_nBloodType | BloodType |
m_pPulseGraphInstance | CPulseGraphInstance_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.
| Parameter | Type |
|---|---|
pszClassName | const char* |
New
template<typename T> static T* New(const char* pszClassName);Create entity by classname.
| Parameter | Type |
|---|---|
pszClassName | const 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.
| Parameter | Type |
|---|---|
iIndex | int |
index | CEntityIndex |
AcceptInput
void AcceptInput(const char* pszInput, CEntityInstance* pActivator = nullptr, CEntityInstance* pCaller = nullptr, const char* pszValue = "", HookChain eChain = HookChain::Run);Accepts entity input.
| Parameter | Type | Default |
|---|---|---|
pszInput | const char* | |
pActivator | CEntityInstance* | nullptr |
pCaller | CEntityInstance* | nullptr |
pszValue | const char* | "" |
eChain | HookChain | HookChain::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.
| Parameter | Type | Default |
|---|---|---|
pszInput | const char* | |
pActivator | CEntityInstance* | nullptr |
pCaller | CEntityInstance* | nullptr |
pszValue | const char* | "" |
flDelay | float | 0.0f |
eChain | HookChain | HookChain::Run |
AddSingleEntityIOListener
CEntityIOListenerHandle* AddSingleEntityIOListener(const char* pszOutput, std::function<Action(const char*, CEntityInstance*, CEntityInstance*, float, bool)> callback, bool post);Add signle entity IO listener.
| Parameter | Type |
|---|---|
pszOutput | const char* |
callback | std::function<Action(const char*, CEntityInstance*, CEntityInstance*, float, bool)> |
post | bool |
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.
| Parameter | Type |
|---|---|
vecOrigin | Vector |
SetAbsRotation
void SetAbsRotation(QAngle angAbsRotation);Set absolute rotation.
| Parameter | Type |
|---|---|
angAbsRotation | QAngle |
SetAngRotation
void SetAngRotation(QAngle angRotation);Set local rotation.
| Parameter | Type |
|---|---|
angRotation | QAngle |
SetAbsVelocity
void SetAbsVelocity(Vector vecVelocity);Set absolute velocity.
| Parameter | Type |
|---|---|
vecVelocity | Vector |
SetBaseVelocity
void SetBaseVelocity(Vector vecVelocity);Set base velocity.
| Parameter | Type |
|---|---|
vecVelocity | Vector |
GetVData
CEntitySubclassVDataBase* GetVData();Get entity VData.
DispatchSpawn
void DispatchSpawn(CEntityKeyValues* pEntityKeyValues = nullptr, HookChain eChain = HookChain::Run);Spawn entity.
| Parameter | Type | Default |
|---|---|---|
pEntityKeyValues | CEntityKeyValues* | nullptr |
eChain | HookChain | HookChain::Run |
Teleport
void Teleport(const Vector* pPosition, const QAngle* pAngles, const Vector* pVelocity, HookChain eChain = HookChain::Run);Teleport entity.
| Parameter | Type | Default |
|---|---|---|
pPosition | const Vector* | |
pAngles | const QAngle* | |
pVelocity | const Vector* | |
eChain | HookChain | HookChain::Run |
SetMoveType
void SetMoveType(MoveType_t nMoveType);Set move type.
| Parameter | Type |
|---|---|
nMoveType | MoveType_t |
GetCollisionGroup
uint8 GetCollisionGroup();Get collision group.
SetCollisionGroup
void SetCollisionGroup(uint8 nCollisionGroup);Set collision group.
| Parameter | Type |
|---|---|
nCollisionGroup | uint8 |
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).
| Parameter | Type | Default |
|---|---|---|
eChain | HookChain | HookChain::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.
| Parameter | Type | Default |
|---|---|---|
pszParticleName | const char* | |
nAttachType | ParticleAttachment_t | ParticleAttachment_t::PATTACH_ABSORIGIN_FOLLOW |
nAttachmentPoint | uint8 | 0 |
bResetAllParticlesOnEntity | bool | false |
pFilter | IRecipientFilter* | nullptr |
eChain | HookChain | HookChain::Run |