CEntityFuncs
Global entity functions
Type: Reference
Methods
Declaration | Description |
---|---|
CBaseEntity@ CreateEntity(const string& in szClassName, dictionary@ pDictionary = null, bool fSpawn = true) | Create an entity by class name. Pass keyvalues in using the dictionary, if any. Keyvalues must be strings. The class name can be either one of the entities included with the game or a custom entity. |
CBaseEntity@ Create(const string& in szClassname, const Vector& in vecOrigin, const Vector& in vecAngles, bool fCreateAndDontSpawn, edict_t@ entOwner = null) | Creates an entity by class name. |
void CreateDecal(const string& in szDecalName, const Vector& in vecOrigin, const string& in szTargetName = "") | Creates a decal with the specified name. If given a name, has to be triggered to be placed, otherwise, is placed immediately. |
CSprite@ CreateSprite(const string& in szSpriteName, const Vector& in vecOrigin, bool fAnimated, float flFrameRate = 10.0f) | Creates a sprite. flFrameRate must be set to a valid value to animate the sprite. |
CBeam@ CreateBeam(const string& in szSpriteName, int width) | Creates a beam entity with the given sprite and width set. |
void CreateExplosion(const Vector& in vecCenter, const Vector& in vecAngles, edict_t@ pOwner, int iMagnitude, bool fDoDamage) | Creates an explosion. If fDoDamage is true, also deals damage to entities within its effect radius, which is determined by the magnitude. |
CBaseEntity@ CreateDisplacerPortal(const Vector& in vecOrigin, const Vector& in vecVelocity, edict_t@ pOwner, float flDamage, float flRadius) | Creates a displacer portal. |
CBaseEntity@ CreateRPGRocket(const Vector& in vecOrigin, const Vector& in vecAngles, edict_t@ pOwner) | Creates an rpg rocket. |
CBaseEntity@ CreateRPGRocket(const Vector& in vecOrigin, const Vector& in vecAngles, const Vector& in vecVelocity, edict_t@ pOwner) | Creates an rpg rocket with custom velocity. |
CGib@ CreateGib( const Vector& in vecOrigin, const Vector& in vecAngles) | Creates a server side gib. |
CGrenade@ ShootTimed(entvars_t@ pevOwner, const Vector& in vecStart, const Vector& in vecVelocity, float flTime) | Spawns a timed grenade. |
CGrenade@ ShootContact(entvars_t@ pevOwner, const Vector& in vecStart, const Vector& in vecVelocity) | Spawns a contact grenade. |
CGrenade@ ShootMortar(entvars_t@ pevOwner, const Vector& in vecStart, const Vector& in vecVelocity) | Spawns a mortar grenade. |
CGrenade@ ShootBananaCluster(entvars_t@ pevOwner, const Vector& in vecStart, const Vector& in vecVelocity) | Spawn a banana bomb. |
void UseSatchelCharges(entvars_t@ pevOwner, SATCHELCODE code) | Triggers all satchel charges owned by pevOwner to either be released from ownership, or detonated. |
void SpawnHeadGib(entvars_t@ pevVictim) | Spawns a head gib for the target victim. |
void SpawnRandomGibs(entvars_t@ pevVictim, int cGibs, int iHuman) | Spawns random gibs for the target victim. iHuman specifies whether the gibs are human or alien. |
void SpawnStickyGibs(entvars_t@ pevVictim, const Vector& in vecOrigin, int cGibs) | Spawns sticky gibs for the target victim. cGibs specifies how many gibs there are. |
void SetOrigin(CBaseEntity@ entity, const Vector& in vecOrigin) | Set the origin of an entity |
void SetModel(CBaseEntity@ entity, const string& in szFileName) | Set the model of an entity |
void SetSize(entvars_t@ pev, const Vector& in vecMin, const Vector& in vecMax) | Set the size of an entity |
CBaseEntity@ FindEntityInSphere(CBaseEntity@ pStartEntity, const Vector& in vecCenter, float flRadius,const string& in szValue = "", const string& in szKeyword = "targetname") | Finds an entity in a sphere |
CBaseEntity@ FindEntityByString(CBaseEntity@ pStartEntity,const string& in szKeyword, const string& in szValue) | Finds an entity based on a key value pair |
CBaseEntity@ FindEntityByClassname(CBaseEntity@ startEntity, const string& in name) | Finds an entity by class name |
CBaseEntity@ FindEntityByTargetname(CBaseEntity@ startEntity, const string& in name) | Finds an entity by target name |
CBaseEntity@ FindEntityGeneric(const string& in szName, const Vector& in vecSrc, float flRadius) | Finds an entity by target name in a sphere |
int MonstersInSphere(array<CBaseEntity@>@ pArray, const Vector& in vecCenter, float flRadius) | Finds monsters in a sphere |
int EntitiesInBox(array<CBaseEntity@>@ pArray, const Vector& in mins, const Vector& in maxs, int flagMask) | Finds entities in a box |
int TargetsInBox(array<CBaseEntity@>@ pArray, const Vector& in mins, const Vector& in maxs) | Finds targets in a box |
int BrushEntsInBox(array<CBaseEntity@>@ pArray, const Vector& in mins, const Vector& in maxs ) | Finds brush entities in a box |
int DispatchSpawn(edict_t@ entity) | Dispatches the spawning of an entity |
bool DispatchKeyValue(edict_t@ entity, const string& in szKeyName, const string& in szValue) | Dispatches the passing of a key value pair to an entity |
bool EntvarsKeyvalue(edict_t@ entity, const string& in szKeyName, const string& in szValue) | Handles the initialization of keyvalues located in the entity's entvars_t object. |
void DispatchObjectCollisionBox(edict_t@ entity) | Dispatches the initialization of the collision box of an entity |
CBaseEntity@ Instance(edict_t@ edict) | Gets the entity instance of an edict instance |
CBaseEntity@ Instance(entvars_t@ vars) | Gets the entity instance of an entvars instance |
CBaseEntity@ Instance(int iEdictNum) | Gets the entity instance based on an edict number |
void FireTargets(const string& in szTargetName, CBaseEntity@ pActivator, CBaseEntity@ pCaller, USE_TYPE useType, float flValue = 0.0f, float flDelay = 0.0f) | Triggers targets. If flDelay is nonzero, causes a temporary entity to be spawned to trigger the target at the given time. The temporary entity becomes the caller, not the entity passed in. |
bool IsMasterTriggered(const string& in szMaster, CBaseEntity@ pActivator) | Returns whether the master with the given name would be triggered if activated by the given entity. |
void Remove(CBaseEntity@ pEntity) | Removes the given entity before the next frame starts. |
bool IsValidEntity(edict_t@ pEntity) | Returns whether this is a valid entity. |
int EntIndex(edict_t@ pEdict) | Gets the index for the given edict. |
edict_t@ IndexEnt(int iEdictNum) | Gets the edict for the given index. |
void EjectBrass(const Vector& in vecOrigin, const Vector& in vecVelocity, float flRotation, int iModel, TE_BOUNCE soundtype) | tosses a brass shell from passed origin at passed velocity. |
ScriptClassInterface@ CastToScriptClass(CBaseEntity@ pEntity) | Casts an CBaseEntity@ representing a custom entity to the ScriptClassBaseClass type |
CBaseEntity@ RandomTargetname(const string& in szTargetname) | Returns a randomly selected entity that has the given target name. |
void PrecacheMaterialSounds(const Materials material) | Precaches the sounds used by a particular material |
CBaseEntity@ FindEntityInCylinder(CBaseEntity@ pStartEntity, Vector vecStart, Vector vecEnd, float flRadius, string szClassName) | Find Entity In a cylinder |
void ChangeLevelByEntity(CBaseEntity@ pEntity, CBaseEntity@ pActivator) | CASEntity_ChangeLevelByEntity |
bool CreateSolidOptimizer(edict_t@ ent, int boneindex, const Vector& in halfextent, const Vector& in halfextent2) | Create physic box for entity |
bool CreatePhysicBox(edict_t@ ent, float mass, float linearfriction, float rollingfriction, float restitution, float ccdradius, float ccdthreshold, bool pushable ) | Create physic object for entity |
bool CreatePhysicObject(edict_t@ ent, const PhysicShapeParams& in shapeParams, const PhysicObjectParams& in objectParams ) | Create physic object for entity |
bool CreateCompoundPhysicObject(edict_t@ ent, array<PhysicShapeParams>@ shapeParamArray, const PhysicObjectParams& in objectParams) | Create physic compound shape for entity |
bool CreatePhysicVehicle(edict_t@ ent, const array<PhysicWheelParams>& in wheels, const PhysicVehicleParams& in vehicleParams ) | Create vehicle manager for physic entity |
bool CreatePhysicTrigger(edict_t@ ent) | Create physic trigger that fires pfnTouch when colliding with physic object |
bool SetPhysicObjectTransform(edict_t@ ent, const Vector& in origin, const Vector& in angles ) | Set physic object's transform |
bool SetPhysicObjectFreeze(edict_t@ ent, bool freeze ) | Set physic object's activation state to freeze or unfreeze |
bool SetEntitySuperPusher(edict_t@ ent, bool enable) | Enable or disable Super-Pusher for brush entity |
bool SetEntityLevelOfDetail(edict_t@ ent, int flags, int body_0, float scale_0, int body_1, float scale_1, float distance_1, int body_2, float scale_2, float distance_2, int body_3, float scale_3, float distance_3) | Enable Level-of-Detail for entity |
bool SetEntityPartialViewer(edict_t@ ent, int player_mask) | Enable Semi-Visible for entity |
bool SetEntitySemiVisible(edict_t@ ent, int player_mask) | Enable Semi-Visible for entity |
bool SetEntityFollow(edict_t@ ent, edict_t@ follow, int flags, const Vector& in origin_offset, const Vector& in angles_offset ) | Enable follow for the entity |
bool SetEntityEnvStudioAnim(edict_t@ ent, int flags, float overrideCurFrame, float overrideMaxFrame, array<EnvStudioKeyframe>@ keyframes ) | Enable follow for the entity |
bool SetEntityCustomMoveSize(edict_t@ ent, const Vector& in mins, const Vector& in maxs ) | Enable follow for the entity |
edict_t@ GetCurrentSuperPusher(Vector& out vecPushDirection) | Get current working Super-Pusher entity and push direction, return valid edict only in pfnTouch callback |
edict_t@ GetCurrentPhysicImpactEntity(Vector& out vecImpactPoint, Vector& out vecImpactDirection, float& out flImpactImpulse) | Get current impact information from Bullet Engine, return valid edict only in pfnTouch callback |
bool ApplyPhysicImpulse(edict_t@ ent, const Vector& in impulse, const Vector& in origin) | Apply impulse on physic object |
bool ApplyPhysicForce(edict_t@ ent, const Vector& in impulse, const Vector& in origin) | Apply impulse on physic object |
bool SetVehicleEngine(edict_t@ ent, int wheelIndex, bool enableMotor, float angularVelcoity, float maxMotorForce) | Set engine wheel's motor and servo for the vehicle |
bool SetVehicleSteering(edict_t@ ent, int wheelIndex, float angularTarget, float angularVelocity, float maxMotorForce) | Set steering wheel's motor and servo for the vehicle |