Mapbase/Scripting/Script Functions

From Valve Developer Community
Jump to: navigation, search

Squirrel This list contains engine-related Squirrel variables, functions, and constants available for VScript in Mapbase Mapbase.

The official documentation can be printed in the console by setting developer to non-zero, loading a map, and executing script_help.

Instances

Name Type Description
Convars Convars Provides an interface to read and change the values of console variables.
Entities CEntities Allows searching of currently-spawned entities.
NetProps CNetPropManager Allows reading and updating the network properties of an entity.
Localize CLocalize Accesses functions related to localization strings.
debugoverlay CDebugOverlayScriptHelper Allows scripts to display debug overlays.
GameRules CGameRules Accesses game rules functions.
AmmoDef CAmmoDef Accesses the game's ammo type data.
Squads CAI_SquadManager Manages and controls NPC squads.

Variables

Name Type Description
__Documentation table Contains the printed strings from the script_help command.
Hooks table Table of registered game event callbacks.

Constants

A constant is a variable whose value cannot be altered during program runtime, usually to avoid magic numbers by giving them self-documenting names.

System Constants

Instance Type Value
_charsize_ integer 1
_floatsize_ integer 4
_intsize_ integer 4
_version_ string "Squirrel 3.1 stable"
_versionnumber_ integer 310
RAND_MAX integer 32767
PI float 3.14159

Game Constants

Please see List of Mapbase Script Constants.

Enums

Please see List of Mapbase Script Constants.
Warning.pngWarning:Everything below this point is automatically generated. Avoid modifying it directly.











Classes

CBaseEntity

Root class of all server-side entities

Function Signature Description
AcceptInput bool CBaseEntity::AcceptInput(string, string, handle, handle)
Activate void CBaseEntity::Activate()
AddContext void CBaseEntity::AddContext(string, string, float) Add a response context value
AddEFlags void CBaseEntity::AddEFlags(int) Add Eflags
AddEffects void CBaseEntity::AddEffects(int) Add effect(s)
AddFlag void CBaseEntity::AddFlag(int) Add flag
AddOutput bool CBaseEntity::AddOutput(string, string, string, string, float, int) Add an output
AddSolidFlags void CBaseEntity::AddSolidFlags(int) Add solid flags
AddSpawnFlags void CBaseEntity::AddSpawnFlags(int) Add spawnflag(s)
ApplyAbsVelocityImpulse void CBaseEntity::ApplyAbsVelocityImpulse(Vector)
ApplyLocalAngularVelocityImpulse void CBaseEntity::ApplyLocalAngularVelocityImpulse(Vector)
BodyTarget Vector CBaseEntity::BodyTarget(Vector, bool)
Classify int CBaseEntity::Classify() Get Class_T class ID (corresponds to the CLASS_ set of constants)
ClearEffects void CBaseEntity::ClearEffects() Clear effect(s)
ClearSpawnFlags void CBaseEntity::ClearSpawnFlags() Clear spawnflag(s)
ConnectOutput void ConnectOutput(string output, string function) Adds an I/O connection that will call the named function when the specified output fires
Destroy void CBaseEntity::Destroy()
DisconnectOutput void CBaseEntity::DisconnectOutput(string, string) Removes a connected script function from an I/O event.
DispatchInteraction bool CBaseEntity::DispatchInteraction(int, handle, handle) Dispatches an interaction on this entity. See the g_interaction set of constants for more information.
EmitSound void CBaseEntity::EmitSound(string) Plays a sound from this entity.
EntityToWorldTransform handle CBaseEntity::EntityToWorldTransform() Get the entity's transform
EyeAngles Vector CBaseEntity::EyeAngles() Get eye pitch, yaw, roll as a vector
EyePosition Vector CBaseEntity::EyePosition() Get vector to eye position - absolute coords
FireBullets void CBaseEntity::FireBullets(handle) Fire bullets from entity with a given info handle
FireOutput void CBaseEntity::FireOutput(string, handle, handle, string, float) Fire an entity output
FirstMoveChild handle CBaseEntity::FirstMoveChild()
FollowEntity void CBaseEntity::FollowEntity(handle, bool) Begin following the specified entity. This makes this entity non-solid, parents it to the target entity, and teleports it to the specified entity's origin. The second parameter is whether or not to use bonemerging while following.
GetAngles Vector CBaseEntity::GetAngles() Get entity pitch, yaw, roll as a vector
GetAngularVelocity Vector CBaseEntity::GetAngularVelocity() Get the local angular velocity - returns a vector of pitch,yaw,roll
GetBoundingMaxs Vector CBaseEntity::GetBoundingMaxs() Get a vector containing max bounds, centered on object
GetBoundingMins Vector CBaseEntity::GetBoundingMins() Get a vector containing min bounds, centered on object
GetCenter Vector CBaseEntity::GetCenter() Get vector to center of object - absolute coords
GetClassname string CBaseEntity::GetClassname()
GetCollisionGroup int CBaseEntity::GetCollisionGroup() Get the collision group
GetContext string CBaseEntity::GetContext(string) Get a response context value
GetContextCount int CBaseEntity::GetContextCount() Get the number of response contexts
GetContextExpireTime float CBaseEntity::GetContextExpireTime(string) Get a response context's expiration time
GetContextIndex handle CBaseEntity::GetContextIndex(int) Get a response context at a specific index in the form of a table
GetDebugName string CBaseEntity::GetDebugName() If name exists returns name, otherwise returns classname
GetEFlags int CBaseEntity::GetEFlags() Get Eflags
GetEffects int CBaseEntity::GetEffects() Get effects
GetFlags int CBaseEntity::GetFlags() Get flags
GetFollowedEntity handle CBaseEntity::GetFollowedEntity() Get the entity we're following.
GetForwardVector Vector CBaseEntity::GetForwardVector() Get the forward vector of the entity
GetFriction float CBaseEntity::GetFriction()
GetGravity float CBaseEntity::GetGravity()
GetGroundEntity handle CBaseEntity::GetGroundEntity() Get the entity we're standing on.
GetHealth int CBaseEntity::GetHealth()
GetKeyValue string CBaseEntity::GetKeyValue(string) Get a keyvalue
GetLocalAngles Vector CBaseEntity::GetLocalAngles() GetLocalAngles
GetLocalOrigin Vector CBaseEntity::GetLocalOrigin() GetLocalOrigin
GetMass float CBaseEntity::GetMass()
GetMaxHealth int CBaseEntity::GetMaxHealth()
GetMaxOutputDelay float CBaseEntity::GetMaxOutputDelay(string) Get the longest delay for all events attached to an output
GetModelKeyValues handle CBaseEntity::GetModelKeyValues() Get a KeyValue class instance on this entity's model
GetModelName string CBaseEntity::GetModelName() Returns the name of the model
GetMoveParent handle CBaseEntity::GetMoveParent() If in hierarchy, retrieves the entity's parent
GetMoveType int CBaseEntity::GetMoveType() Get the move type
GetName string CBaseEntity::GetName()
GetOrCreatePrivateScriptScope handle CBaseEntity::GetOrCreatePrivateScriptScope() Create and retrieve the script-side data associated with an entity
GetOrigin Vector CBaseEntity::GetOrigin()
GetOwner handle CBaseEntity::GetOwner() Gets this entity's owner
GetPhysicsObject handle CBaseEntity::GetPhysicsObject() Get the entity's physics object if it has one
GetPreTemplateName string CBaseEntity::GetPreTemplateName() Get the entity name stripped of template unique decoration
GetRenderAlpha int CBaseEntity::GetRenderAlpha() Get the render color's alpha value
GetRenderColorB int CBaseEntity::GetRenderColorB() Get the render color's B value
GetRenderColorG int CBaseEntity::GetRenderColorG() Get the render color's G value
GetRenderColorR int CBaseEntity::GetRenderColorR() Get the render color's R value
GetRenderColorVector Vector CBaseEntity::GetRenderColorVector() Get the render color as a vector
GetRenderMode int CBaseEntity::GetRenderMode() Get render mode
GetRightVector Vector CBaseEntity::GetRightVector() Get the right vector of the entity
GetRootMoveParent handle CBaseEntity::GetRootMoveParent() If in hierarchy, walks up the hierarchy to find the root parent
GetScriptId string CBaseEntity::GetScriptId() Retrieve the unique identifier used to refer to the entity within the scripting system
GetScriptScope handle CBaseEntity::GetScriptScope() Retrieve the script-side data associated with an entity
GetSolid int CBaseEntity::GetSolid()
GetSolidFlags int CBaseEntity::GetSolidFlags() Get solid flags
GetSoundDuration float CBaseEntity::GetSoundDuration(string, string) Returns float duration of the sound. Takes soundname and optional actormodelname.
GetSpawnFlags int CBaseEntity::GetSpawnFlags() Get spawnflags
GetTakeDamage int CBaseEntity::GetTakeDamage() Gets this entity's m_takedamage value. (DAMAGE_YES, DAMAGE_NO, etc.)
GetTeam int CBaseEntity::GetTeam()
GetTransmitState int CBaseEntity::GetTransmitState()
GetUpVector Vector CBaseEntity::GetUpVector() Get the up vector of the entity
GetVelocity Vector CBaseEntity::GetVelocity()
GetWaterLevel int CBaseEntity::GetWaterLevel() Get current level of water submergence
HasSpawnFlags bool CBaseEntity::HasSpawnFlags(int) Check if the entity has specific spawnflag(s) ticked
HeadTarget Vector CBaseEntity::HeadTarget(Vector)
IsAlive bool CBaseEntity::IsAlive() Return true if this entity is alive
IsCombatCharacter bool CBaseEntity::IsCombatCharacter() Returns true if this entity is a combat character (player or NPC).
IsEffectActive bool CBaseEntity::IsEffectActive(int) Check if an effect is active
IsEntVisible bool CBaseEntity::IsEntVisible(handle) Check if the specified entity can be visible to this entity.
IsFollowingEntity bool CBaseEntity::IsFollowingEntity() Returns true if this entity is following another entity.
IsNPC bool CBaseEntity::IsNPC() Returns true if this entity is a NPC.
IsPlayer bool CBaseEntity::IsPlayer() Returns true if this entity is a player.
IsVisible bool CBaseEntity::IsVisible(Vector) Check if the specified position can be visible to this entity.
IsVisibleWithMask bool CBaseEntity::IsVisibleWithMask(Vector, int) Check if the specified position can be visible to this entity with a specific trace mask.
IsWeapon bool CBaseEntity::IsWeapon() Returns true if this entity is a weapon.
IsWorld bool CBaseEntity::IsWorld() Returns true if this entity is the world.
NextMovePeer handle CBaseEntity::NextMovePeer()
PrecacheSoundScript void CBaseEntity::PrecacheSoundScript(string) Precache a sound for later playing.
RemoveEFlags void CBaseEntity::RemoveEFlags(int) Remove Eflags
RemoveEffects void CBaseEntity::RemoveEffects(int) Remove effect(s)
RemoveFlag void CBaseEntity::RemoveFlag(int) Remove flag
RemoveSolidFlags void CBaseEntity::RemoveSolidFlags(int) Remove solid flags
RemoveSpawnFlags void CBaseEntity::RemoveSpawnFlags(int) Remove spawnflag(s)
SetAbsAngles void CBaseEntity::SetAbsAngles(Vector) SetAbsAngles
SetAbsOrigin void CBaseEntity::SetAbsOrigin(Vector) SetAbsOrigin
SetAngles void CBaseEntity::SetAngles(Vector) Set entity pitch, yaw, roll
SetAngularVelocity void CBaseEntity::SetAngularVelocity(float, float, float) Set the local angular velocity - takes float pitch,yaw,roll velocities
SetCollisionGroup void CBaseEntity::SetCollisionGroup(int) Set the collision group
SetContextThink void CBaseEntity::SetContextThink(string, handle, float) Set a think function on this entity.
SetEffects void CBaseEntity::SetEffects(int) Set effect(s)
SetForwardVector void CBaseEntity::SetForwardVector(Vector) Set the orientation of the entity to have this forward vector
SetFriction void CBaseEntity::SetFriction(float)
SetGravity void CBaseEntity::SetGravity(float)
SetGroundEntity void CBaseEntity::SetGroundEntity(handle) Set the entity we're standing on.
SetHealth void CBaseEntity::SetHealth(int)
SetLocalAngles void CBaseEntity::SetLocalAngles(Vector) SetLocalAngles
SetLocalOrigin void CBaseEntity::SetLocalOrigin(Vector) SetLocalOrigin
SetMass void CBaseEntity::SetMass(float)
SetMaxHealth void CBaseEntity::SetMaxHealth(int)
SetModel void CBaseEntity::SetModel(string)
SetMoveType void CBaseEntity::SetMoveType(int) Set the move type
SetName void CBaseEntity::SetName(string)
SetOrigin void CBaseEntity::SetOrigin(Vector)
SetOriginAngles void CBaseEntity::SetOriginAngles(Vector, Vector) Set both the origin and the angles
SetOriginAnglesVelocity void CBaseEntity::SetOriginAnglesVelocity(Vector, Vector, Vector) Set the origin, the angles, and the velocity
SetOwner void CBaseEntity::SetOwner(handle) Sets this entity's owner
SetParent void CBaseEntity::SetParent(handle, string)
SetRenderAlpha void CBaseEntity::SetRenderAlpha(int) Set the render color's alpha value
SetRenderColor void CBaseEntity::SetRenderColor(int, int, int) Set the render color
SetRenderColorB void CBaseEntity::SetRenderColorB(int) Set the render color's B value
SetRenderColorG void CBaseEntity::SetRenderColorG(int) Set the render color's G value
SetRenderColorR void CBaseEntity::SetRenderColorR(int) Set the render color's R value
SetRenderColorVector void CBaseEntity::SetRenderColorVector(Vector) Set the render color as a vector
SetRenderMode void CBaseEntity::SetRenderMode(int) Set render mode
SetSize void CBaseEntity::SetSize(Vector, Vector)
SetSolid void CBaseEntity::SetSolid(int)
SetTakeDamage void CBaseEntity::SetTakeDamage(int) Sets this entity's m_takedamage value. (DAMAGE_YES, DAMAGE_NO, etc.)
SetTeam void CBaseEntity::SetTeam(int)
SetThink void CBaseEntity::SetThink(handle, float)
SetThinkFunction void CBaseEntity::SetThinkFunction(string, float)
SetTransmitState int CBaseEntity::SetTransmitState(int)
SetVelocity void CBaseEntity::SetVelocity(Vector)
StopFollowingEntity void CBaseEntity::StopFollowingEntity() Stops following an entity if we're following one.
StopSound void CBaseEntity::StopSound(string) Stops a sound from this entity.
StopThink void CBaseEntity::StopThink()
StopThinkFunction void CBaseEntity::StopThinkFunction()
TakeDamage int CBaseEntity::TakeDamage(handle) Apply damage to this entity with a given info handle
TakeHealth int CBaseEntity::TakeHealth(float, int) Give this entity health
ValidateScriptScope bool CBaseEntity::ValidateScriptScope() Ensure that an entity's script scope has been created
entindex int CBaseEntity::entindex()
Function Signature Description
FireBullets void CBaseEntity -> FireBullets(handle entity, float speed, Vector point, Vector normal) Called for every single VPhysics-related collision experienced by this entity.
HandleInteraction bool CBaseEntity -> HandleInteraction(int interaction, handle sourceEnt) Called for internal game interactions. See the g_interaction set of constants for more information. Returning true or false will return that value without falling to any internal handling. Returning nothing will allow the interaction to fall to any internal handling.
ModifyEmitSoundParams void CBaseEntity -> ModifyEmitSoundParams(handle params) Called every time a sound is emitted on this entity, allowing for its parameters to be modified.
ModifySentenceParams void CBaseEntity -> ModifySentenceParams(handle params) Called every time a sentence is emitted on this entity, allowing for its parameters to be modified.
OnDeath bool CBaseEntity -> OnDeath(handle info) Called when the entity dies (Event_Killed). Returning false makes the entity cancel death, although this could have unforeseen consequences. For hooking any damage instead of just death, see filter_script and PassesFinalDamageFilter.
OnEntText string CBaseEntity -> OnEntText() Called every frame when ent_text is enabled on the entity. Return a string to be added to the ent_text printout.
OnKilledOther void CBaseEntity -> OnKilledOther(handle victim, handle info) Called when the entity kills another entity.
UpdateOnRemove void CBaseEntity -> UpdateOnRemove() Called when the entity is being removed.
VPhysicsCollision void CBaseEntity -> VPhysicsCollision(handle entity, float speed, Vector point, Vector normal) Called for every single VPhysics-related collision experienced by this entity.

CBaseAnimating

Extends CBaseEntity

Animating models

Function Signature Description
BecomeRagdollOnClient bool CBaseAnimating::BecomeRagdollOnClient(Vector)
CanBecomeRagdoll bool CBaseAnimating::CanBecomeRagdoll()
Dissolve bool CBaseAnimating::Dissolve(string, float, bool, int, Vector, int) Use 'sprites/blueglow1.vmt' for the default material, Time() for the default start time, false for npcOnly if you don't want it to check if the entity is a NPC first, 0 for the default dissolve type, Vector(0,0,0) for the default dissolver origin, and 0 for the default magnitude.
FindBodygroupByName int CBaseAnimating::FindBodygroupByName(string) Finds a bodygroup by name
GetAttachmentAngles Vector CBaseAnimating::GetAttachmentAngles(int) Get the attachement id's angles as a p,y,r vector
GetAttachmentMatrix handle CBaseAnimating::GetAttachmentMatrix(int) Get the attachement id's matrix transform
GetAttachmentOrigin Vector CBaseAnimating::GetAttachmentOrigin(int) Get the attachement id's origin vector
GetBodygroup int CBaseAnimating::GetBodygroup(int) Gets a bodygroup
GetBodygroupCount int CBaseAnimating::GetBodygroupCount(int) Gets the number of models in a bodygroup
GetBodygroupName string CBaseAnimating::GetBodygroupName(int) Gets a bodygroup name
GetBoneTransform void CBaseAnimating::GetBoneTransform(int, handle) Get the transform for the specified bone
GetCycle float CBaseAnimating::GetCycle()
GetModelScale float CBaseAnimating::GetModelScale() Gets the model's scale
GetNumBodyGroups int CBaseAnimating::GetNumBodyGroups() Gets the number of bodygroups
GetNumBones int CBaseAnimating::GetNumBones() Get the number of bones
GetPhysicsBone int CBaseAnimating::GetPhysicsBone(int) Get physics bone from bone index
GetPlaybackRate float CBaseAnimating::GetPlaybackRate()
GetPoseParameter float CBaseAnimating::GetPoseParameter(string) Get the specified pose parameter's value
GetSequence int CBaseAnimating::GetSequence() Gets the current sequence
GetSequenceActivity int CBaseAnimating::GetSequenceActivity(int) Gets the activity ID of the specified sequence index
GetSequenceActivityName string CBaseAnimating::GetSequenceActivityName(int) Gets the activity name of the specified sequence index
GetSequenceKeyValues handle CBaseAnimating::GetSequenceKeyValues(int) Get a KeyValue class instance on the specified sequence. WARNING: This uses the same KeyValue pointer as GetModelKeyValues!
GetSequenceMoveDist float CBaseAnimating::GetSequenceMoveDist(int) Gets the move distance of the specified sequence
GetSequenceMoveYaw float CBaseAnimating::GetSequenceMoveYaw(int) Gets the move yaw of the specified sequence
GetSequenceName string CBaseAnimating::GetSequenceName(int) Gets the name of the specified sequence index
GetSkin int CBaseAnimating::GetSkin() Gets the model's skin
Ignite void CBaseAnimating::Ignite(float, bool, float, bool) 'NPCOnly' only lets this fall through if the entity is a NPC and 'CalledByLevelDesigner' determines whether to treat this like the Ignite input or just an internal ignition call.
IsRagdoll bool CBaseAnimating::IsRagdoll()
IsSequenceFinished bool CBaseAnimating::IsSequenceFinished() Ask whether the main sequence is done playing
LookupActivity int CBaseAnimating::LookupActivity(string) Gets the ID of the specified activity name
LookupAttachment int CBaseAnimating::LookupAttachment(string) Get the named attachement id
LookupBone int CBaseAnimating::LookupBone(string) Get the named bone id
LookupSequence int CBaseAnimating::LookupSequence(string) Gets the index of the specified sequence name
ResetSequenceInfo void CBaseAnimating::ResetSequenceInfo()
Scorch void CBaseAnimating::Scorch(int, int) Makes the entity darker from scorching
SelectHeaviestSequence int CBaseAnimating::SelectHeaviestSequence(int) Selects the sequence with the heaviest weight for the specified activity ID
SelectWeightedSequence int CBaseAnimating::SelectWeightedSequence(int, int) Selects a sequence for the specified activity ID
SequenceDuration float CBaseAnimating::SequenceDuration(int) Get the specified sequence duration
SequenceHasMovement bool CBaseAnimating::SequenceHasMovement(int) Checks if the specified sequence has movement
SequenceLoops bool CBaseAnimating::SequenceLoops() Does the current sequence loop?
SetBodygroup void CBaseAnimating::SetBodygroup(int, int) Sets a bodygroup
SetCycle void CBaseAnimating::SetCycle(float)
SetModelScale void CBaseAnimating::SetModelScale(float, float) Sets the model's scale with the specified change duration
SetPlaybackRate void CBaseAnimating::SetPlaybackRate(float)
SetPoseParameter void CBaseAnimating::SetPoseParameter(string, float) Set the specified pose parameter to the specified value
SetSequence void CBaseAnimating::SetSequence(int) Sets the current sequence
SetSkin void CBaseAnimating::SetSkin(int) Sets the model's skin
StudioFrameAdvance void CBaseAnimating::StudioFrameAdvance()
Function Signature Description
HandleAnimEvent bool CBaseAnimating -> HandleAnimEvent(handle event) Called when handling animation events. Return false to cancel base handling.
OnServerRagdoll void CBaseAnimating -> OnServerRagdoll(handle ragdoll, bool submodel) Called when this entity creates/turns into a server-side ragdoll.

CBaseAnimatingOverlay

Extends CBaseAnimating

Animating models which support dynamic animation layers/overlays.

Function Signature Description
AddGesture int CBaseAnimatingOverlay::AddGesture(string, bool) Adds a new animation layer using the specified activity name.
AddGestureID int CBaseAnimatingOverlay::AddGestureID(int, bool) Adds a new animation layer using the specified activity index.
AddGestureSequence int CBaseAnimatingOverlay::AddGestureSequence(string, bool) Adds a new animation layer using the specified activity name.
AddGestureSequenceID int CBaseAnimatingOverlay::AddGestureSequenceID(int, bool) Adds a new animation layer using the specified sequence index.
FastRemoveLayer void CBaseAnimatingOverlay::FastRemoveLayer(int) Removes the specified layer index immediately.
FindGestureLayer int CBaseAnimatingOverlay::FindGestureLayer(string) Finds and returns the first active animation layer which uses the specified activity name.
FindGestureLayerByID int CBaseAnimatingOverlay::FindGestureLayerByID(int) Finds and returns the first active animation layer which uses the specified activity index.
GetLayerActivity string CBaseAnimatingOverlay::GetLayerActivity(int) Gets the activity name of the specified layer index.
GetLayerActivityID int CBaseAnimatingOverlay::GetLayerActivityID(int) Gets the activity index of the specified layer index.
GetLayerCycle float CBaseAnimatingOverlay::GetLayerCycle(int) Gets the cycle of the specified layer index.
GetLayerDuration float CBaseAnimatingOverlay::GetLayerDuration(int) Gets the duration of the specified layer index.
GetLayerSequence int CBaseAnimatingOverlay::GetLayerSequence(int) Gets the sequence index of the specified layer index.
GetLayerWeight float CBaseAnimatingOverlay::GetLayerWeight(int) Gets the weight of the specified layer index.
GetNumAnimOverlays int CBaseAnimatingOverlay::GetNumAnimOverlays() Gets the current number of animation layers.
HasActiveLayer bool CBaseAnimatingOverlay::HasActiveLayer() Returns true if there is currently an active layer.
IsValidLayer bool CBaseAnimatingOverlay::IsValidLayer(int) Returns true if the specified layer index is valid.
RemoveAllGestures void CBaseAnimatingOverlay::RemoveAllGestures() Removes all animation layers.
RemoveLayer void CBaseAnimatingOverlay::RemoveLayer(int, float, float) Removes the specified layer index with the specified kill rate and delay.
SetLayerAutokill void CBaseAnimatingOverlay::SetLayerAutokill(int, bool) Sets whether or not the specified layer index should remove itself when it's finished playing.
SetLayerBlendIn void CBaseAnimatingOverlay::SetLayerBlendIn(int, float) Sets the fade-in of the specified layer index, with the fade being a 0-1 fraction of the cycle.
SetLayerBlendOut void CBaseAnimatingOverlay::SetLayerBlendOut(int, float) Sets the fade-out of the specified layer index, with the fade being a 0-1 fraction of the cycle.
SetLayerCycle void CBaseAnimatingOverlay::SetLayerCycle(int, float) Sets the cycle of the specified layer index.
SetLayerDuration void CBaseAnimatingOverlay::SetLayerDuration(int, float) Sets the duration of the specified layer index.
SetLayerLooping void CBaseAnimatingOverlay::SetLayerLooping(int, bool) Sets whether or not the specified layer index should loop.
SetLayerNoEvents void CBaseAnimatingOverlay::SetLayerNoEvents(int, bool) Sets whether or not the specified layer index should fire animation events.
SetLayerNoRestore void CBaseAnimatingOverlay::SetLayerNoRestore(int, bool) Sets whether or not the specified layer index should restore after a save is loaded.
SetLayerPlaybackRate void CBaseAnimatingOverlay::SetLayerPlaybackRate(int, float) Sets the playback rate of the specified layer index.
SetLayerWeight void CBaseAnimatingOverlay::SetLayerWeight(int, float) Sets the weight of the specified layer index.

CBaseFlex

Extends CBaseAnimatingOverlay

Animated characters who have vertex flex capability.

Function Signature Description
GetCurrentScene handle CBaseFlex::GetCurrentScene() Returns the instance of the oldest active scene entity (if any).
GetSceneByIndex handle CBaseFlex::GetSceneByIndex(int) Returns the instance of the scene entity at the specified index.
SetViewtarget void CBaseFlex::SetViewtarget(Vector) Sets the entity's eye target.

CBaseCombatCharacter

Extends CBaseFlex

The base class shared by players and NPCs.

Function Signature Description
BodyAngles Vector CBaseCombatCharacter::BodyAngles() Get the body's angles.
BodyDirection2D Vector CBaseCombatCharacter::BodyDirection2D() Get the body's 2D direction.
BodyDirection3D Vector CBaseCombatCharacter::BodyDirection3D() Get the body's 3D direction.
DoMuzzleFlash void CBaseCombatCharacter::DoMuzzleFlash() Does a muzzle flash.
DropAllWeapons void CBaseCombatCharacter::DropAllWeapons(bool) Make the character drop all of its weapons.
DropWeapon void CBaseCombatCharacter::DropWeapon(handle) Make the character drop the specified weapon entity if they own it.
EntInAimCone bool CBaseCombatCharacter::EntInAimCone(handle) Check if the specified entity is in the character's aim cone.
EntInViewCone bool CBaseCombatCharacter::EntInViewCone(handle) Check if the specified entity is in the character's viewcone.
EquipWeapon void CBaseCombatCharacter::EquipWeapon(handle) Make the character equip the specified weapon entity. If they don't already own the weapon, they will acquire it instantly.
EyeDirection2D Vector CBaseCombatCharacter::EyeDirection2D() Get the eyes' 2D direction.
EyeDirection3D Vector CBaseCombatCharacter::EyeDirection3D() Get the eyes' 3D direction.
FindWeapon handle CBaseCombatCharacter::FindWeapon(string, int) Find a specific weapon in the character's inventory by its classname.
GetActiveWeapon handle CBaseCombatCharacter::GetActiveWeapon() Get the character's active weapon entity.
GetAllWeapons void CBaseCombatCharacter::GetAllWeapons(handle) Get the character's weapon inventory.
GetAmmoCount int CBaseCombatCharacter::GetAmmoCount(int) Get the ammo count of the specified ammo type.
GetAttackSpread Vector CBaseCombatCharacter::GetAttackSpread(handle, handle) Get the attack spread.
GetCurrentWeaponProficiency int CBaseCombatCharacter::GetCurrentWeaponProficiency() Get the character's current proficiency (accuracy) with their current weapon.
GetRelationPriority int CBaseCombatCharacter::GetRelationPriority(handle) Get a character's relationship priority for a specific entity.
GetRelationship int CBaseCombatCharacter::GetRelationship(handle) Get a character's relationship to a specific entity.
GetSpreadBias float CBaseCombatCharacter::GetSpreadBias(handle, handle) Get the spread bias.
GetVehicleEntity handle CBaseCombatCharacter::GetVehicleEntity() Get the entity for a character's current vehicle if they're in one.
GetWeapon handle CBaseCombatCharacter::GetWeapon(int) Get a specific weapon in the character's inventory.
GiveAmmo int CBaseCombatCharacter::GiveAmmo(int, int, bool) Gives the specified amount of the specified ammo type. The third parameter is whether or not to suppress the ammo pickup sound. Returns the amount of ammo actually given, which is 0 if the player's ammo for this type is already full.
HeadDirection2D Vector CBaseCombatCharacter::HeadDirection2D() Get the head's 2D direction.
HeadDirection3D Vector CBaseCombatCharacter::HeadDirection3D() Get the head's 3D direction.
InAimCone bool CBaseCombatCharacter::InAimCone(Vector) Check if the specified position is in the character's aim cone.
InViewCone bool CBaseCombatCharacter::InViewCone(Vector) Check if the specified position is in the character's viewcone.
LastHitGroup int CBaseCombatCharacter::LastHitGroup() Get the last hitgroup.
RemoveAmmo void CBaseCombatCharacter::RemoveAmmo(int, int) Removes the specified amount of the specified ammo type.
SetAmmoCount void CBaseCombatCharacter::SetAmmoCount(int, int) Set the ammo count of the specified ammo type.
SetClassRelationship void CBaseCombatCharacter::SetClassRelationship(int, int, int) Set a character's relationship with a specific Classify() class.
SetRelationship void CBaseCombatCharacter::SetRelationship(handle, int, int) Set a character's relationship with a specific entity.
ShootPosition Vector CBaseCombatCharacter::ShootPosition() Get the character's shoot position.
WeaponCount int CBaseCombatCharacter::WeaponCount() Get the number of weapons a character possesses.
Function Signature Description
RelationshipPriority int CBaseCombatCharacter -> RelationshipPriority(handle entity, int def) Called when a character's relationship priority for another entity is requested. Returning a number will make the game use that priority instead of the default priority. (note: 'default' in this case includes overrides from ai_relationship/SetRelationship)
RelationshipType int CBaseCombatCharacter -> RelationshipType(handle entity, int def) Called when a character's relationship to another entity is requested. Returning a disposition will make the game use that disposition instead of the default relationship. (note: 'default' in this case includes overrides from ai_relationship/SetRelationship)

CBaseCombatWeapon

Extends CBaseAnimating

The base class for all equippable weapons.

Function Signature Description
AddViewKick void CBaseCombatWeapon::AddViewKick() Applies the weapon's view kick.
AltFiresUnderwater bool CBaseCombatWeapon::AltFiresUnderwater() Returns true if this weapon can alt-fire underwater.
CanBePickedUpByNPCs bool CBaseCombatWeapon::CanBePickedUpByNPCs() Check if the weapon can be picked up by NPCs.
CapabilitiesGet int CBaseCombatWeapon::CapabilitiesGet() Get the capabilities the weapon currently possesses.
Clip1 int CBaseCombatWeapon::Clip1() Get the weapon's current primary ammo.
Clip2 int CBaseCombatWeapon::Clip2() Get the weapon's current secondary ammo.
FireDuration float CBaseCombatWeapon::FireDuration() Returns the amount of time that the weapon has sustained firing.
FiresUnderwater bool CBaseCombatWeapon::FiresUnderwater() Returns true if this weapon can fire underwater.
GetBulletSpread Vector CBaseCombatWeapon::GetBulletSpread() Returns the weapon's default bullet spread.
GetBulletSpreadForProficiency Vector CBaseCombatWeapon::GetBulletSpreadForProficiency(int) Returns the weapon's bullet spread for the specified proficiency level.
GetDefaultAnimSpeed float CBaseCombatWeapon::GetDefaultAnimSpeed() Returns the weapon's default animation speed.
GetDefaultClip1 int CBaseCombatWeapon::GetDefaultClip1() Get the weapon's default primary ammo.
GetDefaultClip2 int CBaseCombatWeapon::GetDefaultClip2() Get the weapon's default secondary ammo.
GetDrawActivity int CBaseCombatWeapon::GetDrawActivity() Returns the weapon's draw activity.
GetDroppedModel string CBaseCombatWeapon::GetDroppedModel() Get the weapon's unique dropped model if it has one.
GetFireRate float CBaseCombatWeapon::GetFireRate() Get the weapon's firing rate.
GetMaxClip1 int CBaseCombatWeapon::GetMaxClip1() Get the weapon's maximum primary ammo.
GetMaxClip2 int CBaseCombatWeapon::GetMaxClip2() Get the weapon's maximum secondary ammo.
GetOwner handle CBaseCombatWeapon::GetOwner() Get the weapon's owner.
GetPrimaryAmmoType int CBaseCombatWeapon::GetPrimaryAmmoType() Get the weapon's primary ammo type.
GetPrimaryAttackActivity int CBaseCombatWeapon::GetPrimaryAttackActivity() Returns the weapon's primary attack activity.
GetPrintName string CBaseCombatWeapon::GetPrintName()
GetSecondaryAmmoType int CBaseCombatWeapon::GetSecondaryAmmoType() Get the weapon's secondary ammo type.
GetSecondaryAttackActivity int CBaseCombatWeapon::GetSecondaryAttackActivity() Returns the weapon's secondary attack activity.
GetSubType int CBaseCombatWeapon::GetSubType() Get the weapon's subtype.
GetViewModel string CBaseCombatWeapon::GetViewModel(int) Get the weapon's view model.
GetViewModelSequenceDuration float CBaseCombatWeapon::GetViewModelSequenceDuration() Gets the sequence duration of the current view model animation.
GetWeaponIdleTime float CBaseCombatWeapon::GetWeaponIdleTime() Returns the next time WeaponIdle() will run.
GetWeight int CBaseCombatWeapon::GetWeight() Get the weapon's weight.
GetWorldModel string CBaseCombatWeapon::GetWorldModel() Get the weapon's world model.
GiveDefaultAmmo void CBaseCombatWeapon::GiveDefaultAmmo() Fill the weapon back up to default ammo.
HasAnyAmmo bool CBaseCombatWeapon::HasAnyAmmo() Check if the weapon currently has ammo or doesn't need ammo.
HasPrimaryAmmo bool CBaseCombatWeapon::HasPrimaryAmmo() Check if the weapon currently has ammo or doesn't need primary ammo.
HasSecondaryAmmo bool CBaseCombatWeapon::HasSecondaryAmmo() Check if the weapon currently has ammo or doesn't need secondary ammo.
HasWeaponIdleTimeElapsed bool CBaseCombatWeapon::HasWeaponIdleTimeElapsed() Returns true if the idle time has elapsed.
IsViewModelSequenceFinished bool CBaseCombatWeapon::IsViewModelSequenceFinished() Returns true if the current view model animation is finished.
MinRange1 float CBaseCombatWeapon::MinRange1() Returns the closest this weapon can be used.
MinRange2 float CBaseCombatWeapon::MinRange2() Returns the closest this weapon can be used.
NextPrimaryAttack float CBaseCombatWeapon::NextPrimaryAttack() Returns the next time PrimaryAttack() will run when the player is pressing +ATTACK.
NextSecondaryAttack float CBaseCombatWeapon::NextSecondaryAttack() Returns the next time SecondaryAttack() will run when the player is pressing +ATTACK2.
ReloadsSingly bool CBaseCombatWeapon::ReloadsSingly() Returns true if this weapon reloads 1 round at a time.
SendWeaponAnim bool CBaseCombatWeapon::SendWeaponAnim(int) Sends a weapon animation.
SetAltFiresUnderwater void CBaseCombatWeapon::SetAltFiresUnderwater(bool) Sets whether this weapon can alt-fire underwater.
SetClip1 void CBaseCombatWeapon::SetClip1(int) Set the weapon's current primary ammo.
SetClip2 void CBaseCombatWeapon::SetClip2(int) Set the weapon's current secondary ammo.
SetFireDuration void CBaseCombatWeapon::SetFireDuration(float) Sets the amount of time that the weapon has sustained firing.
SetFiresUnderwater void CBaseCombatWeapon::SetFiresUnderwater(bool) Sets whether this weapon can fire underwater.
SetMinRange1 void CBaseCombatWeapon::SetMinRange1(float) Sets the closest this weapon can be used.
SetMinRange2 void CBaseCombatWeapon::SetMinRange2(float) Sets the closest this weapon can be used.
SetNextPrimaryAttack void CBaseCombatWeapon::SetNextPrimaryAttack(float) Sets the next time PrimaryAttack() will run when the player is pressing +ATTACK.
SetNextSecondaryAttack void CBaseCombatWeapon::SetNextSecondaryAttack(float) Sets the next time SecondaryAttack() will run when the player is pressing +ATTACK2.
SetOwner void CBaseCombatWeapon::SetOwner(handle) Set the weapon's owner.
SetReloadsSingly void CBaseCombatWeapon::SetReloadsSingly(bool) Sets whether this weapon reloads 1 round at a time.
SetSubType void CBaseCombatWeapon::SetSubType(int) Set the weapon's subtype.
SetWeaponIdleTime void CBaseCombatWeapon::SetWeaponIdleTime(float) Sets the next time WeaponIdle() will run.
UsesClipsForAmmo1 bool CBaseCombatWeapon::UsesClipsForAmmo1() Check if the weapon uses clips for primary ammo.
UsesClipsForAmmo2 bool CBaseCombatWeapon::UsesClipsForAmmo2() Check if the weapon uses clips for secondary ammo.
UsesPrimaryAmmo bool CBaseCombatWeapon::UsesPrimaryAmmo() Check if the weapon uses primary ammo.
UsesSecondaryAmmo bool CBaseCombatWeapon::UsesSecondaryAmmo() Check if the weapon uses secondary ammo.
WeaponClassify int CBaseCombatWeapon::WeaponClassify() Returns the weapon's classify class from the WEPCLASS_ constant group
WeaponSound void CBaseCombatWeapon::WeaponSound(int, float) Plays one of the weapon's sounds.

CBasePlayer

Extends CBaseCombatCharacter

The player entity.

Function Signature Description
DeathCount int CBasePlayer::DeathCount() Gets the number of deaths this player has had in a multiplayer game.
DisableButtons void CBasePlayer::DisableButtons(int) Disables the specified button mask.
EnableButtons void CBasePlayer::EnableButtons(int) Enables the specified button mask if it was disabled before.
FlashlightIsOn int CBasePlayer::FlashlightIsOn() Returns true if the flashlight is on.
FlashlightTurnOff void CBasePlayer::FlashlightTurnOff() Turns off the flashlight.
FlashlightTurnOn void CBasePlayer::FlashlightTurnOn() Turns on the flashlight.
ForceButtons void CBasePlayer::ForceButtons(int) Forces the specified button mask.
FragCount int CBasePlayer::FragCount() Gets the number of frags (kills) this player has in a multiplayer game.
GetArmor int CBasePlayer::GetArmor() Gets the player's armor.
GetAutoaimVector Vector CBasePlayer::GetAutoaimVector(float) Gets the player's autoaim shooting direction with the specified scale.
GetAutoaimVectorCustomMaxDist Vector CBasePlayer::GetAutoaimVectorCustomMaxDist(float, float) Gets the player's autoaim shooting direction with the specified scale and a custom max distance.
GetButtonDisabled int CBasePlayer::GetButtonDisabled() Gets the player's currently unusable buttons.
GetButtonForced int CBasePlayer::GetButtonForced() Gets the player's currently forced buttons.
GetButtonLast int CBasePlayer::GetButtonLast() Gets the player's previously active buttons.
GetButtonPressed int CBasePlayer::GetButtonPressed() Gets the player's currently pressed buttons.
GetButtonReleased int CBasePlayer::GetButtonReleased() Gets the player's just-released buttons.
GetButtons int CBasePlayer::GetButtons() Gets the player's active buttons.
GetExpresser handle CBasePlayer::GetExpresser() Gets a handle for this player's expresser.
GetEyeForward Vector CBasePlayer::GetEyeForward() Gets the player's forward eye vector.
GetEyeRight Vector CBasePlayer::GetEyeRight() Gets the player's right eye vector.
GetEyeUp Vector CBasePlayer::GetEyeUp() Gets the player's up eye vector.
GetFOV int CBasePlayer::GetFOV()
GetFOVOwner handle CBasePlayer::GetFOVOwner() Gets current view owner.
GetNetworkIDString string CBasePlayer::GetNetworkIDString() Gets the player's network (i.e. Steam) ID.
GetPlayerName string CBasePlayer::GetPlayerName() Gets the player's name.
GetUserID int CBasePlayer::GetUserID() Gets the player's user ID.
GetViewModel handle CBasePlayer::GetViewModel(int) Returns the viewmodel of the specified index.
IsConnected bool CBasePlayer::IsConnected() Returns true if this player is connected.
IsDisconnecting bool CBasePlayer::IsDisconnecting() Returns true if this player is disconnecting.
IsNoclipping bool CBasePlayer::IsNoclipping() Returns true if the player is in noclip mode.
IsSuitEquipped bool CBasePlayer::IsSuitEquipped() Returns true if this player had the HEV suit equipped.
SetArmor void CBasePlayer::SetArmor(int) Sets the player's armor.
SetFOV void CBasePlayer::SetFOV(int, float) Sets player FOV regardless of view owner.
SetMuzzleFlashTime void CBasePlayer::SetMuzzleFlashTime(float) Sets the player's muzzle flash time for AI.
SetSuitUpdate void CBasePlayer::SetSuitUpdate(string, int, int) Sets an update for the player's HEV suit.
ShouldAutoaim bool CBasePlayer::ShouldAutoaim() Returns true if the player should be autoaiming.
UnforceButtons void CBasePlayer::UnforceButtons(int) Unforces the specified button mask if it was forced before.
ViewPunch void CBasePlayer::ViewPunch(Vector) Punches the player's view with the specified vector.
Function Signature Description
PlayerRunCommand void CBasePlayer -> PlayerRunCommand(handle command) Called when running a player command on the server.

CHL2_Player

Extends CBasePlayer

The HL2 player entity.

Function Signature Description
AddAnimStateLayer void CHL2_Player::AddAnimStateLayer(int, float, float, float, bool, bool) Adds a custom sequence index as a misc. layer for the singleplayer anim state, wtih parameters for blending in/out, setting the playback rate, holding the animation at the end, and only playing when the player is still.
AddAuxPower void CHL2_Player::AddAuxPower(float) Adds to the player's available aux power.
AddCustomSuitDevice void CHL2_Player::AddCustomSuitDevice(int) Adds a custom suit device ID. (1-3)
GetAuxPower float CHL2_Player::GetAuxPower() Gets the player's available aux power.
GetFlashlightBattery float CHL2_Player::GetFlashlightBattery() Gets the energy available in the player's flashlight. If the legacy (aux power-based) flashlight is enabled, this returns the aux power.
InitCustomSuitDevice void CHL2_Player::InitCustomSuitDevice(int, float) Initializes a custom suit device. (just sets drain rate for now)
IsCustomSuitDeviceActive bool CHL2_Player::IsCustomSuitDeviceActive(int) Checks if a custom suit device is active.
RemoveAuxPower bool CHL2_Player::RemoveAuxPower(float) Removes from the player's available aux power.
RemoveCustomSuitDevice void CHL2_Player::RemoveCustomSuitDevice(int) Removes a custom suit device ID. (1-3)
SetAuxPower void CHL2_Player::SetAuxPower(float) Sets the player's available aux power.

CEntities

The global list of entities

Function Signature Description
AddCustomProcedural void CEntities::AddCustomProcedural(string, handle, bool) Adds a custom '!' target name. The first parameter is the name of the procedural (which should NOT include the '!'), the second parameter is a function which should support 5 arguments (name, startEntity, searchingEntity, activator, caller), and the third parameter is whether or not this procedural can return multiple entities. Note that these are NOT saved and must be redeclared on restore!
CreateByClassname handle CEntities::CreateByClassname(string) Creates an entity by classname
DisableEntityListening void CEntities::DisableEntityListening() Disables the 'OnEntity' hooks.
EnableEntityListening void CEntities::EnableEntityListening() Enables the 'OnEntity' hooks. This function must be called before using them.
FindByClassNearestFacing handle CEntities::FindByClassNearestFacing(Vector, Vector, float, string) Find the nearest entity along the facing direction from the given origin within the angular threshold with the given classname.
FindByClassname handle CEntities::FindByClassname(handle, string) Find entities by class name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByClassnameNearest handle CEntities::FindByClassnameNearest(string, Vector, float) Find entities by class name nearest to a point.
FindByClassnameNearest2D handle CEntities::FindByClassnameNearest2D(string, Vector, float) Find entities by class name nearest to a point in 2D space.
FindByClassnameWithin handle CEntities::FindByClassnameWithin(handle, string, Vector, float) Find entities by class name within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByClassnameWithinBox handle CEntities::FindByClassnameWithinBox(handle, string, Vector, Vector) Find entities by class name within an AABB. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByModel handle CEntities::FindByModel(handle, string) Find entities by model name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByName handle CEntities::FindByName(handle, string) Find entities by name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByNameNearest handle CEntities::FindByNameNearest(string, Vector, float) Find entities by name nearest to a point.
FindByNameWithin handle CEntities::FindByNameWithin(handle, string, Vector, float) Find entities by name within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByTarget handle CEntities::FindByTarget(handle, string) Find entities by targetname. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindInSphere handle CEntities::FindInSphere(handle, Vector, float) Find entities within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
First handle CEntities::First() Begin an iteration over the list of entities
GetLocalPlayer handle CEntities::GetLocalPlayer() Get local player or listen server host
Next handle CEntities::Next(handle) Continue an iteration over the list of entities, providing reference to a previously found entity
RemoveCustomProcedural void CEntities::RemoveCustomProcedural(string) Removes a custom '!' target name previously defined with AddCustomProcedural.
Function Signature Description
OnEntityCreated void CEntities -> OnEntityCreated(handle entity) Called when an entity is created. Requires EnableEntityListening() to be fired beforehand.
OnEntityDeleted void CEntities -> OnEntityDeleted(handle entity) Called when an entity is deleted. Requires EnableEntityListening() to be fired beforehand.
OnEntitySpawned void CEntities -> OnEntitySpawned(handle entity) Called when an entity spawns. Requires EnableEntityListening() to be fired beforehand.

CGameRules

The container of the game's rules, handling behavior which could be different on a game-by-game basis.

Function Signature Description
AllowFlashlight bool CGameRules::AllowFlashlight() Returns true if players are allowed to switch on their flashlight.
AllowNPCs bool CGameRules::AllowNPCs() Returns true if NPCs are allowed.
AllowSPRespawn bool CGameRules::AllowSPRespawn()
AllowThirdPersonCamera bool CGameRules::AllowThirdPersonCamera() Returns true if third-person camera is allowed.
Damage_IsTimeBased bool CGameRules::Damage_IsTimeBased(int) Damage types that are time-based.
Damage_NoPhysicsForce bool CGameRules::Damage_NoPhysicsForce(int) Damage types that don't have to supply a physics force & position.
Damage_ShouldGibCorpse bool CGameRules::Damage_ShouldGibCorpse(int) Damage types that gib the corpse.
Damage_ShouldNotBleed bool CGameRules::Damage_ShouldNotBleed(int) Damage types that don't make the player bleed.
Damage_ShowOnHUD bool CGameRules::Damage_ShowOnHUD(int) Damage types that have client HUD art.
DefaultFOV int CGameRules::DefaultFOV() Default player FOV in this game.
GetDamageMultiplier float CGameRules::GetDamageMultiplier() Ammo type damage multiplier.
GetGameDescription string CGameRules::GetGameDescription() This is the game description that gets seen in server browsers.
GetGameType int CGameRules::GetGameType()
GetGameTypeName string CGameRules::GetGameTypeName()
GetSkillLevel int CGameRules::GetSkillLevel() Returns the game's difficulty/skill level.
InRoundRestart bool CGameRules::InRoundRestart() Returns true if the round is restarting.
IsCoOp bool CGameRules::IsCoOp()
IsDeathmatch bool CGameRules::IsDeathmatch()
IsMultiplayer bool CGameRules::IsMultiplayer() Returns true if this is a multiplayer game (like co-op or deathmatch).
IsSkillLevel bool CGameRules::IsSkillLevel(int) Returns true if the game is set to the specified difficulty/skill level.
IsTeamplay bool CGameRules::IsTeamplay()
Name string CGameRules::Name() Gets the name of these rules.
RefreshSkillData void CGameRules::RefreshSkillData(bool)
SetSkillLevel void CGameRules::SetSkillLevel(int) Sets the game's difficulty/skill level.
ShouldCollide bool CGameRules::ShouldCollide(int, int) Returns whether two collision groups collide with each other in this game.

CAmmoDef

The ammo type definition manager.

Function Signature Description
DamageForce float CAmmoDef::DamageForce(int) Gets the amount of force this ammo type deals.
DamageType int CAmmoDef::DamageType(int) Gets the type of damage this ammo type deals.
Flags int CAmmoDef::Flags(int) Gets the flags this ammo type uses.
GetNumAmmoTypes int CAmmoDef::GetNumAmmoTypes() Gets the number of ammo types which currently exist.
Index int CAmmoDef::Index(string) Gets the index of the specified ammo type name.
MaxCarry int CAmmoDef::MaxCarry(int) Gets the maximum amount of this ammo type which players should be able to carry.
MaxSplashSize int CAmmoDef::MaxSplashSize(int) Gets the maximum size of water splashes caused by impacts from this ammo type.
MinSplashSize int CAmmoDef::MinSplashSize(int) Gets the minimum size of water splashes caused by impacts from this ammo type.
NPCDamage int CAmmoDef::NPCDamage(int) Gets the damage NPCs deal for the specified ammo type.
Name string CAmmoDef::Name(int) Gets the name of the specified ammo type index.
PlrDamage int CAmmoDef::PlrDamage(int) Gets the damage players deal for the specified ammo type.
TracerType int CAmmoDef::TracerType(int) Gets the type of tracer this ammo type uses.

CGlobalState

Global state system.

Function Signature Description
AddGlobal int CGlobalState::AddGlobal(string, string, int) Adds a new global with a specific map name and state. Returns its index.
AddToCounter int CGlobalState::AddToCounter(int, int) Adds to the counter of the specified global.
GetCounter int CGlobalState::GetCounter(int) Gets the counter of the specified global.
GetIndex int CGlobalState::GetIndex(string) Gets the index of the specified global name. Returns -1 if it does not exist.
GetState int CGlobalState::GetState(int) Gets the state of the specified global.
SetCounter void CGlobalState::SetCounter(int, int) Sets the counter of the specified global.
SetState void CGlobalState::SetState(int, int) Sets the state of the specified global.

CGlobalSys

GlobalSys

Function Signature Description
CommandLineCheck bool CGlobalSys::CommandLineCheck(string) returns true if the command line param was used, otherwise false.
CommandLineCheckFloat float CGlobalSys::CommandLineCheckFloat(string) returns the command line param as a float.
CommandLineCheckInt int CGlobalSys::CommandLineCheckInt(string) returns the command line param as an int.
CommandLineCheckStr string CGlobalSys::CommandLineCheckStr(string) returns the command line param as a string.
GetCommandLine string CGlobalSys::GetCommandLine() returns the command line

CDebugOverlayScriptHelper

CDebugOverlayScriptHelper

Function Signature Description
Axis void CDebugOverlayScriptHelper::Axis(Vector, Vector, float, bool, float) Draws an axis. Specify origin + orientation in world space.
Box void CDebugOverlayScriptHelper::Box(Vector, Vector, Vector, int, int, int, int, float) Draws a world-space axis-aligned box. Specify bounds in world space.
BoxAngles void CDebugOverlayScriptHelper::BoxAngles(Vector, Vector, Vector, Vector, int, int, int, int, float) Draws an oriented box at the origin. Specify bounds in local space.
BoxDirection void CDebugOverlayScriptHelper::BoxDirection(Vector, Vector, Vector, Vector, int, int, int, int, float) Draw box oriented to a Vector direction
Circle void CDebugOverlayScriptHelper::Circle(Vector, Vector, Vector, float, int, int, int, int, bool, float) Draws a circle. Specify center in world space.
CircleOriented void CDebugOverlayScriptHelper::CircleOriented(Vector, Vector, float, int, int, int, int, bool, float) Draws a circle oriented. Specify center in world space.
ClearAllOverlays void CDebugOverlayScriptHelper::ClearAllOverlays() Clear all debug overlays at once
Cross3D void CDebugOverlayScriptHelper::Cross3D(Vector, float, int, int, int, bool, float) Draws a world-aligned cross. Specify origin in world space.
Cross3DOriented void CDebugOverlayScriptHelper::Cross3DOriented(Vector, Vector, float, int, int, int, bool, float) Draws an oriented cross. Specify origin in world space.
DrawTickMarkedLine void CDebugOverlayScriptHelper::DrawTickMarkedLine(Vector, Vector, float, int, int, int, int, bool, float) Draws a dashed line. Specify endpoints in world space.
EntityBounds void CDebugOverlayScriptHelper::EntityBounds(handle, int, int, int, int, float) Draws bounds of an entity
EntityText void CDebugOverlayScriptHelper::EntityText(int, int, string, float, int, int, int, int) Draws text on an entity
EntityTextAtPosition void CDebugOverlayScriptHelper::EntityTextAtPosition(Vector, int, string, float, int, int, int, int) Draw entity text overlay at a specific position
Grid void CDebugOverlayScriptHelper::Grid(Vector) Add grid overlay
HorzArrow void CDebugOverlayScriptHelper::HorzArrow(Vector, Vector, float, int, int, int, int, bool, float) Draws a horizontal arrow. Specify endpoints in world space.
Line void CDebugOverlayScriptHelper::Line(Vector, Vector, int, int, int, bool, float) Draws a line between two points
ScreenText void CDebugOverlayScriptHelper::ScreenText(float, float, string, int, int, int, int, float) Draws 2D text. Specify coordinates in screen space.
SetDebugBits void CDebugOverlayScriptHelper::SetDebugBits(handle, int) Set debug bits on entity
Sphere void CDebugOverlayScriptHelper::Sphere(Vector, float, int, int, int, bool, float) Draws a wireframe sphere. Specify center in world space.
SweptBox void CDebugOverlayScriptHelper::SweptBox(Vector, Vector, Vector, Vector, Vector, int, int, int, int, float) Draws a swept box. Specify endpoints in world space and the bounds in local space.
Text void CDebugOverlayScriptHelper::Text(Vector, string, float) Draws 2D text. Specify origin in world space.
Triangle void CDebugOverlayScriptHelper::Triangle(Vector, Vector, Vector, int, int, int, int, bool, float) Draws a filled triangle. Specify vertices in world space.
VertArrow void CDebugOverlayScriptHelper::VertArrow(Vector, Vector, float, int, int, int, int, bool, float) Draws a vertical arrow. Specify endpoints in world space.
YawArrow void CDebugOverlayScriptHelper::YawArrow(Vector, float, float, float, int, int, int, int, bool, float) Draws a arrow associated with a specific yaw. Specify endpoints in world space.

CNetMsg

Network messages

Function Signature Description
GetNumBitsWritten int CNetMsg::GetNumBitsWritten()
ReadAngle float CNetMsg::ReadAngle()
ReadAngles Vector CNetMsg::ReadAngles()
ReadBool bool CNetMsg::ReadBool()
ReadByte int CNetMsg::ReadByte()
ReadChar int CNetMsg::ReadChar()
ReadCoord float CNetMsg::ReadCoord()
ReadEHandle handle CNetMsg::ReadEHandle()
ReadEntity handle CNetMsg::ReadEntity()
ReadFloat float CNetMsg::ReadFloat()
ReadInt int CNetMsg::ReadInt(int)
ReadLong int CNetMsg::ReadLong()
ReadNormal float CNetMsg::ReadNormal()
ReadShort int CNetMsg::ReadShort()
ReadString string CNetMsg::ReadString()
ReadUInt int CNetMsg::ReadUInt(int)
ReadVec3Coord Vector CNetMsg::ReadVec3Coord()
ReadVec3Normal Vector CNetMsg::ReadVec3Normal()
ReadWord int CNetMsg::ReadWord()
Receive void CNetMsg::Receive(string, handle) Set custom network message callback
Reset void CNetMsg::Reset() Reset the current network message buffer
Send void CNetMsg::Send(handle, bool) Send a custom network message from the server to the client (max 251 bytes)
SendEntityMessage void CNetMsg::SendEntityMessage(handle, bool) Send a message from a server side entity to its client side counterpart
SendUserMessage void CNetMsg::SendUserMessage(handle, string, bool) Send a usermessage from the server to the client
Start void CNetMsg::Start(string) Start writing new custom network message
WriteAngle void CNetMsg::WriteAngle(float) 8 bit unsigned char
WriteAngles void CNetMsg::WriteAngles(Vector)
WriteBool void CNetMsg::WriteBool(bool) 1 bit
WriteByte void CNetMsg::WriteByte(int) 8 bit unsigned char
WriteChar void CNetMsg::WriteChar(int) 8 bit char
WriteCoord void CNetMsg::WriteCoord(float)
WriteEHandle void CNetMsg::WriteEHandle(handle) 32 bit long
WriteEntity void CNetMsg::WriteEntity(handle) 11 bit (entindex)
WriteFloat void CNetMsg::WriteFloat(float) 32 bit float
WriteInt void CNetMsg::WriteInt(int, int) variable bit signed int
WriteLong void CNetMsg::WriteLong(int) 32 bit long
WriteNormal void CNetMsg::WriteNormal(float) 12 bit
WriteShort void CNetMsg::WriteShort(int) 16 bit short
WriteString void CNetMsg::WriteString(string) max 512 bytes at once
WriteUInt void CNetMsg::WriteUInt(int, int) variable bit unsigned int
WriteVec3Coord void CNetMsg::WriteVec3Coord(Vector)
WriteVec3Normal void CNetMsg::WriteVec3Normal(Vector) 27 bit
WriteWord void CNetMsg::WriteWord(int) 16 bit unsigned short

CBaseTrigger

Extends CBaseEntity

Trigger entity

Function Signature Description
Disable void CBaseTrigger::Disable()
Enable void CBaseTrigger::Enable()
GetTouchedEntityOfType handle CBaseTrigger::GetTouchedEntityOfType(string) Gets the first touching entity which matches the specified class.
GetTouchingEntities void CBaseTrigger::GetTouchingEntities(handle) Gets all entities touching this trigger (and satisfying its criteria). This function copies them to a table with a maximum number of elements.
IsTouching bool CBaseTrigger::IsTouching(handle) Checks whether the passed entity is touching the trigger.
PassesTriggerFilters bool CBaseTrigger::PassesTriggerFilters(handle) Returns whether a target entity satisfies the trigger's spawnflags, filter, etc.
PointIsWithin bool CBaseTrigger::PointIsWithin(Vector) Checks if the given vector is within the trigger's volume.
TouchTest void CBaseTrigger::TouchTest()
UsesFilter bool CBaseTrigger::UsesFilter() Returns true if this trigger uses a filter.

CBaseGrenade

Extends CBaseAnimating

The base class for grenades.

Function Signature Description
GetBlastForce Vector CBaseGrenade::GetBlastForce() Gets the grenade's blast force override. Grenades which use base damage force calculations return 0,0,0
GetDamage float CBaseGrenade::GetDamage() Gets the grenade's blast damage.
GetDamageRadius float CBaseGrenade::GetDamageRadius() Gets the grenade's blast damage radius.
GetOriginalThrower handle CBaseGrenade::GetOriginalThrower() Gets the grenade's original thrower after the thrower was changed due to being picked up by a gravity gun or something.
GetThrower handle CBaseGrenade::GetThrower() Gets the grenade's thrower.
GetTimer float CBaseGrenade::GetTimer() Gets the grenade's detonate time if it has one.
GetWarnAITime float CBaseGrenade::GetWarnAITime() Gets the time at which the grenade will warn/has warned AI.
HasWarnedAI bool CBaseGrenade::HasWarnedAI() Whether or not the grenade has issued its DANGER sound to the world sound list yet.
IsLive bool CBaseGrenade::IsLive() Whether or not the grenade has issued its DANGER sound to the world sound list yet.
SetDamage void CBaseGrenade::SetDamage(float) Sets the grenade's blast damage.
SetDamageRadius void CBaseGrenade::SetDamageRadius(float) Sets the grenade's blast damage radius.
SetThrower void CBaseGrenade::SetThrower(handle) Sets the grenade's thrower.

CBaseFilter

Extends CBaseEntity

All entities which could be used as filters.

Function Signature Description
BloodAllowed bool CBaseFilter::BloodAllowed(handle, handle) Check if the given caller and damage info allow for the production of blood.
DamageMod bool CBaseFilter::DamageMod(handle, handle) Mods the damage info with the given caller.
PassesDamageFilter bool CBaseFilter::PassesDamageFilter(handle, handle) Check if the given caller and damage info pass the damage filter, with the second parameter being a CTakeDamageInfo instance. The caller is the one who requests the filter result; For example, the entity being damaged when using this as a damage filter.
PassesFilter bool CBaseFilter::PassesFilter(handle, handle) Check if the given caller and entity pass the filter. The caller is the one who requests the filter result; For example, the entity being damaged when using this as a damage filter.
PassesFinalDamageFilter bool CBaseFilter::PassesFinalDamageFilter(handle, handle) Used by filter_damage_redirect to distinguish between standalone filter calls and actually damaging an entity. Returns true if there's no unique behavior. Parameters are identical to PassesDamageFilter.

CFilterScript

Extends CBaseFilter

The filter_script entity which allows VScript functions to hook onto filter methods.

Function Signature Description
BloodAllowed bool CFilterScript -> BloodAllowed(handle caller, handle info) A completely optional hook used by filter_script to determine if a caller is allowed to emit blood after taking damage. Return true if blood should be allowed or false if it should not. If this hook is not defined, it will always return true.
DamageMod bool CFilterScript -> DamageMod(handle caller, handle info) A completely optional hook used by filter_script to modify damage being taken by an entity. You are free to use CTakeDamageInfo functions on the damage info handle and it will change how the caller is damaged. Returning true or false currently has no effect on vanilla code, but you should generally return true if the damage info has been modified by your code and false if it was not. If this hook is not defined, it will always return false.
PassesDamageFilter bool CFilterScript -> PassesDamageFilter(handle caller, handle info) A hook used by filter_script to determine what damage should pass it when it's being used as a damage filter. Return true if the info should pass or false if it should not. If this hook is not defined in a filter_script, damage filter requests will instead check PassesFilter with the attacker as the activator.
PassesFilter bool CFilterScript -> PassesFilter(handle caller, handle activator) A hook used by filter_script to determine what entities should pass it. Return true if the entity should pass or false if it should not. This hook is required for regular filtering.
PassesFinalDamageFilter bool CFilterScript -> PassesFinalDamageFilter(handle caller, handle info) A completely optional hook used by filter_script which only runs when the entity will take damage. This is different from PassesDamageFilter, which is sometimes used in cases where damage is not actually about to be taken. This also runs after a regular PassesDamageFilter check. Return true if the info should pass or false if it should not. If this hook is not defined, it will always return true.

CAI_BaseNPC

Extends CBaseCombatCharacter

The base class all NPCs derive from.

Function Signature Description
AddSleepFlags void CAI_BaseNPC::AddSleepFlags(int) Add to the NPC's sleep flags. (see AI_SLEEP_ set of constants)
CapabilitiesAdd int CAI_BaseNPC::CapabilitiesAdd(int) Add capabilities to the NPC.
CapabilitiesClear void CAI_BaseNPC::CapabilitiesClear() Clear capabilities for the NPC.
CapabilitiesGet int CAI_BaseNPC::CapabilitiesGet() Get the capabilities the NPC currently possesses.
CapabilitiesRemove int CAI_BaseNPC::CapabilitiesRemove(int) Remove capabilities from the NPC.
ClearCondition void CAI_BaseNPC::ClearCondition(string) Clear a condition on the NPC.
ClearConditionID void CAI_BaseNPC::ClearConditionID(int) Clear a condition on the NPC by ID.
ClearSchedule void CAI_BaseNPC::ClearSchedule(string) Clear the NPC's current schedule for the specified reason.
Crouch bool CAI_BaseNPC::Crouch() Tells the NPC to crouch.
FindEnemyMemory handle CAI_BaseNPC::FindEnemyMemory(handle) Get information about the NPC's current enemy.
GetActivity string CAI_BaseNPC::GetActivity() Get the NPC's current activity.
GetActivityID int CAI_BaseNPC::GetActivityID() Get the NPC's current activity ID.
GetCine handle CAI_BaseNPC::GetCine() Get the NPC's currently running scripted sequence if it has one.
GetEnemy handle CAI_BaseNPC::GetEnemy() Get the NPC's current enemy.
GetEnemyLKP Vector CAI_BaseNPC::GetEnemyLKP() Get the last known position of the NPC's current enemy.
GetExpresser handle CAI_BaseNPC::GetExpresser() Get a handle for this NPC's expresser.
GetGestureVersionOfActivity string CAI_BaseNPC::GetGestureVersionOfActivity(string) Get the gesture activity counterpart of the specified sequence activity, if one exists.
GetGestureVersionOfActivityID int CAI_BaseNPC::GetGestureVersionOfActivityID(int) Get the gesture activity ID counterpart of the specified sequence activity ID, if one exists.
GetHintGroup string CAI_BaseNPC::GetHintGroup() Get the name of the NPC's hint group.
GetHintNode handle CAI_BaseNPC::GetHintNode() Get the NPC's current AI hint.
GetLastAttackTime float CAI_BaseNPC::GetLastAttackTime() Get the last time the NPC has used an attack (e.g. fired a bullet from a gun).
GetLastDamageTime float CAI_BaseNPC::GetLastDamageTime() Get the last time the NPC has been damaged.
GetLastEnemyTime float CAI_BaseNPC::GetLastEnemyTime() Get the last time the NPC has seen an enemy.
GetLastPlayerDamageTime float CAI_BaseNPC::GetLastPlayerDamageTime() Get the last time the NPC has been damaged by a player.
GetNPCState int CAI_BaseNPC::GetNPCState() Get the NPC's current state.
GetSchedule string CAI_BaseNPC::GetSchedule() Get the NPC's current schedule.
GetScheduleID int CAI_BaseNPC::GetScheduleID() Get the NPC's current schedule ID.
GetScriptState int CAI_BaseNPC::GetScriptState() Get the NPC's current scripted sequence state.
GetSequenceVersionOfGesture string CAI_BaseNPC::GetSequenceVersionOfGesture(string) Get the sequence activity counterpart of the specified gesture activity, if one exists.
GetSequenceVersionOfGestureID int CAI_BaseNPC::GetSequenceVersionOfGestureID(int) Get the sequence activity ID counterpart of the specified gesture activity ID, if one exists.
GetSleepState int CAI_BaseNPC::GetSleepState() Get the NPC's sleep state. (see AISS_ set of constants)
GetSquad handle CAI_BaseNPC::GetSquad() Get the NPC's squad if it has one.
GetTask string CAI_BaseNPC::GetTask() Get the NPC's current task.
GetTaskID int CAI_BaseNPC::GetTaskID() Get the NPC's current task ID.
HasCondition bool CAI_BaseNPC::HasCondition(string) Get whether the NPC has a condition.
HasConditionID bool CAI_BaseNPC::HasConditionID(int) Get whether the NPC has a condition ID.
HasSleepFlags bool CAI_BaseNPC::HasSleepFlags(int) Return true if the NPC has the specified sleep flags. (see AI_SLEEP_ set of constants)
IsCommandable bool CAI_BaseNPC::IsCommandable() Check if the NPC is commandable.
IsCrouching bool CAI_BaseNPC::IsCrouching() Returns true if the NPC is crouching.
IsInPlayerSquad bool CAI_BaseNPC::IsInPlayerSquad() Check if the NPC is in the player's squad.
IsInSquad bool CAI_BaseNPC::IsInSquad() Returns true if the NPC is in a squad.
IsMedic bool CAI_BaseNPC::IsMedic() Returns true if this NPC is a medic.
IsMoving bool CAI_BaseNPC::IsMoving() Check if the NPC is moving.
NumWeaponsInSquad int CAI_BaseNPC::NumWeaponsInSquad(string) Get the number of weapons in a squad.
RemoveSleepFlags void CAI_BaseNPC::RemoveSleepFlags(int) Remove from NPC's sleep flags. (see AI_SLEEP_ set of constants)
ResetActivity void CAI_BaseNPC::ResetActivity() Reset the NPC's current activity.
SetActivity void CAI_BaseNPC::SetActivity(string) Set the NPC's current activity.
SetActivityID void CAI_BaseNPC::SetActivityID(int) Set the NPC's current activity ID.
SetCondition void CAI_BaseNPC::SetCondition(string) Set a condition on the NPC.
SetConditionID void CAI_BaseNPC::SetConditionID(int) Set a condition on the NPC by ID.
SetEnemy void CAI_BaseNPC::SetEnemy(handle) Set the NPC's current enemy.
SetSchedule void CAI_BaseNPC::SetSchedule(string) Set the NPC's current schedule.
SetScheduleID void CAI_BaseNPC::SetScheduleID(int) Set the NPC's current schedule ID.
SetSleepState void CAI_BaseNPC::SetSleepState(int) Set the NPC's sleep state. (see AISS_ set of constants)
Sleep void CAI_BaseNPC::Sleep() Puts the NPC into a sleeping state.
Stand bool CAI_BaseNPC::Stand() Tells the NPC to stand if it is crouching.
TranslateActivity int CAI_BaseNPC::TranslateActivity(string) Translates the specified activity string and returns the translated activity ID.
TranslateActivityID int CAI_BaseNPC::TranslateActivityID(int) Translates the specified activity ID and returns the translated activity ID.
Wake void CAI_BaseNPC::Wake(handle) Awakens the NPC if it is currently asleep.
Function Signature Description
GetActualShootPosition Vector CAI_BaseNPC -> GetActualShootPosition(Vector shootOrigin, handle target) Called when the NPC is getting their actual shoot position, using the default shoot position as the parameter. (NOTE: NPCs which override this themselves might not always use this hook!)
NPC_TranslateActivity variant CAI_BaseNPC -> NPC_TranslateActivity(string activity, int activity_id) Called when the NPC is translating their current activity. The activity is provided in both string and ID form. Should return either an activity string or an activity ID. Return -1 to not translate.
NPC_TranslateSchedule variant CAI_BaseNPC -> NPC_TranslateSchedule(string schedule, int schedule_id) Called when the NPC is translating their current schedule. The schedule is provided in both string and ID form. Should return either a schedule string or a schedule ID. Return -1 to not translate.
OverrideMove void CAI_BaseNPC -> OverrideMove(float interval) Called when the NPC runs movement code, allowing the NPC's movement to be overridden by some other method. (NOTE: NPCs which override this themselves might not always use this hook!)
QueryHearSound bool CAI_BaseNPC -> QueryHearSound(handle sound) Called when the NPC is deciding whether to hear a CSound or not.
QuerySeeEntity bool CAI_BaseNPC -> QuerySeeEntity(handle entity) Called when the NPC is deciding whether to see an entity or not.
ShouldPlayFakeSequenceGesture bool CAI_BaseNPC -> ShouldPlayFakeSequenceGesture(string activity, string translatedActivity) Called when an activity is set on a NPC. Returning true will make the NPC convert the activity into a gesture (if a gesture is available) and continue their current activity instead.

CAI_BaseActor

Extends CAI_BaseNPC

The base class for NPCs which act in complex choreo scenes.

Function Signature Description
AddLookTarget void CAI_BaseActor::AddLookTarget(handle, float, float, float) Add a potential look target for this actor with the specified importance, duration, and ramp.
AddLookTargetPos void CAI_BaseActor::AddLookTargetPos(Vector, float, float, float) Add a potential look target position for this actor with the specified importance, duration, and ramp.

CSceneEntity

Extends CBaseEntity

Choreographed scene which controls animation and/or dialog on one or more actors.

Function Signature Description
AddBroadcastTeamTarget void CSceneEntity::AddBroadcastTeamTarget(int) Adds a team (by index) to the broadcast list
EstimateLength float CSceneEntity::EstimateLength() Returns length of this scene in seconds.
FindNamedEntity handle CSceneEntity::FindNamedEntity(string) given an entity reference, such as !target, get actual entity from scene object
IsPaused bool CSceneEntity::IsPaused() If this scene is currently paused.
IsPlayingBack bool CSceneEntity::IsPlayingBack() If this scene is currently playing.
LoadSceneFromString bool CSceneEntity::LoadSceneFromString(string, string) given a dummy scene name and a vcd string, load the scene
RemoveBroadcastTeamTarget void CSceneEntity::RemoveBroadcastTeamTarget(int) Removes a team (by index) from the broadcast list

CSceneListManager

Extends CBaseEntity

Stores choreo scenes and cleans them up when a later scene in the list begins playing.

Function Signature Description
GetScene handle CSceneListManager::GetScene(int) Gets the specified scene index from this manager.

CAI_Expresser

Expresser class for complex speech.

Function Signature Description
BlockSpeechUntil void CAI_Expresser::BlockSpeechUntil(float) Block speech for a certain amount of time. This is stored in curtime.
CanSpeak bool CAI_Expresser::CanSpeak() Check if the actor can speak.
ForceNotSpeaking void CAI_Expresser::ForceNotSpeaking() If the actor is speaking, force the system to recognize them as not speaking.
GetVoicePitch int CAI_Expresser::GetVoicePitch() Get the actor's voice pitch. Used in sentences.
IsSpeaking bool CAI_Expresser::IsSpeaking() Check if the actor is speaking.
SetVoicePitch void CAI_Expresser::SetVoicePitch(int) Set the actor's voice pitch. Used in sentences.
Speak bool CAI_Expresser::Speak(string, string) Speak a response concept with the specified modifiers.
SpeakAutoGeneratedScene bool CAI_Expresser::SpeakAutoGeneratedScene(string, float) Speak an automatically generated, instanced VCD scene for this sound as though it were played through the Response System. Return whether the scene successfully plays.
SpeakRawScene bool CAI_Expresser::SpeakRawScene(string, float) Speak a raw, instanced VCD scene as though it were played through the Response System. Return whether the scene successfully plays.
SpeakRawSentence int CAI_Expresser::SpeakRawSentence(string, float) Speak a raw sentence as though it were played through the Response System. Return the sentence's index; -1 if not successfully played.

CAI_Hint

Extends CBaseEntity

An entity which gives contextual pointers for NPCs.

Function Signature Description
GetDirection Vector CAI_Hint::GetDirection() Get the hint's direction.
GetHintActivity string CAI_Hint::GetHintActivity() Get the name of the hint activity.
GetHintGroup string CAI_Hint::GetHintGroup() Get the name of the hint's group.
GetHintType int CAI_Hint::GetHintType() Get the hint's type ID.
GetNodeId int CAI_Hint::GetNodeId() Get the hint's node ID.
GetUser handle CAI_Hint::GetUser() Get the hint's current user.
IsDisabled bool CAI_Hint::IsDisabled() Check if the hint is disabled.
IsLocked bool CAI_Hint::IsLocked() Check if the hint is locked.
Yaw float CAI_Hint::Yaw() Get the hint's yaw.

CAI_Squad

NPC squads used for schedule coordination, sharing information about enemies, etc.

Function Signature Description
AddToSquad void CAI_Squad::AddToSquad(handle) Adds a NPC to the squad.
GetAnyMember handle CAI_Squad::GetAnyMember() Randomly get any one of the squad's members.
GetFirstMember handle CAI_Squad::GetFirstMember(bool) Get the squad's first member. The parameter is for whether to ignore silent members (see CAI_Squad::IsSilentMember() for more info).
GetLeader handle CAI_Squad::GetLeader() Get the squad's leader.
GetMember handle CAI_Squad::GetMember(int) Get one of the squad's members by their index.
GetName string CAI_Squad::GetName() Get the squad's name.
GetSquadData string CAI_Squad::GetSquadData(int) Get the squad data in the specified slot.
GetSquadIndex int CAI_Squad::GetSquadIndex(handle) Get the index of the specified NPC in the squad.
GetSquadMemberNearestTo handle CAI_Squad::GetSquadMemberNearestTo(Vector) Get the squad member nearest to a point.
GetVisibleSquadMembers int CAI_Squad::GetVisibleSquadMembers(handle) Get the number of squad members visible to the specified member.
IsLeader bool CAI_Squad::IsLeader(handle) Returns true if the specified NPC is the squad's leader.
IsMember bool CAI_Squad::IsMember(handle) Returns true if the specified NPC is a member of the squad.
IsSilentMember bool CAI_Squad::IsSilentMember(handle) Returns true if the specified NPC is a "silent squad member", which means it's only in squads for enemy information purposes and does not actually participate in any tactics. For example, this is used for npc_enemyfinder and vital allies (e.g. Alyx) in the player's squad. Please note that this does not check if the NPC is in the squad first.
NearestSquadMember handle CAI_Squad::NearestSquadMember(handle) Get the squad member nearest to the specified member.
NumMembers int CAI_Squad::NumMembers(bool) Get the squad's number of members. The parameter is for whether to ignore silent members (see CAI_Squad::IsSilentMember() for more info).
RemoveFromSquad void CAI_Squad::RemoveFromSquad(handle) Removes a NPC from the squad.
SetSquadData void CAI_Squad::SetSquadData(int, string) Set the squad data in the specified slot.
SquadMemberInRange handle CAI_Squad::SquadMemberInRange(Vector, float) Get the first squad member found around the specified position in the specified range.
UpdateEnemyMemory void CAI_Squad::UpdateEnemyMemory(handle, handle, Vector) Updates the squad's memory of an enemy. The first parameter is the updater, the second parameter is the enemy, and the third parameter is the position.

CAI_SquadManager

Manager for NPC squads.

Function Signature Description
FindCreateSquad handle CAI_SquadManager::FindCreateSquad(string) Find the specified squad in the squad list or create it if it doesn't exist.
FindSquad handle CAI_SquadManager::FindSquad(string) Find the specified squad in the squad list. Returns null if none found.
GetFirstSquad handle CAI_SquadManager::GetFirstSquad() Get the first squad in the squad list.
GetNextSquad handle CAI_SquadManager::GetNextSquad(handle) Get the next squad in the squad list starting from the specified squad.
NumSquads int CAI_SquadManager::NumSquads() Get the number of squads in the list.

CAI_GoalEntity

Extends CBaseEntity

The base class for goal entities used to control NPC behavior.

Function Signature Description
IsActive bool CAI_GoalEntity::IsActive() Check if the goal entity is active.
NumActors int CAI_GoalEntity::NumActors() Get the number of actors using this goal entity.

CAI_ActBusyGoal

Extends CAI_GoalEntity

A goal entity which makes NPCs act busy.

Function Signature Description
ForceBusy void CAI_ActBusyGoal::ForceBusy(handle, handle, bool) Force a NPC to act busy.
ForceBusyComplex void CAI_ActBusyGoal::ForceBusyComplex(handle, handle, bool, bool, bool, float, int, handle) Force a NPC to act busy with additional parameters.
StopBusy void CAI_ActBusyGoal::StopBusy(handle) Force a NPC to stop busying.

CSound

A sound NPCs can hear.

Function Signature Description
DoesSoundExpire bool CSound::DoesSoundExpire() Returns true if the sound expires.
GetOwner handle CSound::GetOwner() Gets the sound's owner.
GetSoundOrigin Vector CSound::GetSoundOrigin() Gets the sound's origin.
GetSoundReactOrigin Vector CSound::GetSoundReactOrigin() Gets the sound's react origin.
GetTarget handle CSound::GetTarget() Gets the sound's target.
IsScent bool CSound::IsScent() Returns true if this is a type of scent (as opposed to a sound).
IsSound bool CSound::IsSound() Returns true if this is a type of sound (as opposed to a scent).
IsSoundType bool CSound::IsSoundType(int) Returns true if the sound type is the specified type.
OccludedVolume float CSound::OccludedVolume() Gets the sound's occluded volume.
Reset void CSound::Reset() Clears the volume, type, and origin for the sound without actually removing it.
SetSoundOrigin void CSound::SetSoundOrigin(Vector) Sets the sound's origin.
SoundChannel int CSound::SoundChannel() Gets the sound's channel.
SoundContext int CSound::SoundContext() Gets the sound type with contexts only.
SoundExpirationTime float CSound::SoundExpirationTime() Gets the sound's expiration time.
SoundType int CSound::SoundType() Gets the raw sound type.
SoundTypeNoContext int CSound::SoundTypeNoContext() Gets the sound type with contexts excluded.
ValidateOwner bool CSound::ValidateOwner() Returns true if the sound's owner is still valid or if the sound never had an owner in the first place.
Volume int CSound::Volume() Gets the sound's volume.

CNPC_Citizen

Extends CAI_BaseActor

npc_citizen from Half-Life 2

Function Signature Description
CanHeal bool CNPC_Citizen::CanHeal() Returns true if this citizen is a medic or ammo resupplier currently able to heal/give ammo.
GetCitizenType int CNPC_Citizen::GetCitizenType() Gets the citizen's type. 1 = Downtrodden, 2 = Refugee, 3 = Rebel, 4 = Unique
IsAmmoResupplier bool CNPC_Citizen::IsAmmoResupplier() Returns true if this citizen is an ammo resupplier.
SetCitizenType void CNPC_Citizen::SetCitizenType(int) Sets the citizen's type. 1 = Downtrodden, 2 = Refugee, 3 = Rebel, 4 = Unique
Function Signature Description
SelectModel string CNPC_Citizen -> SelectModel(string model_path, string model_head, int gender) Called when a citizen is selecting a random model. 'model_path' is the directory of the selected model and 'model_head' is the name. The 'gender' parameter uses the 'GENDER_' constants and is based only on the citizen's random head spawnflags. If a full model path string is returned, it will be used as the model instead.

CProtoSniper

Extends CAI_BaseNPC

Combine sniper NPC.

Function Signature Description
FindFrustratedShot bool CProtoSniper::FindFrustratedShot(float)
GetBulletOrigin Vector CProtoSniper::GetBulletOrigin()
GetBulletSpeed float CProtoSniper::GetBulletSpeed()
GetPaintCursor Vector CProtoSniper::GetPaintCursor() Get the point the sniper is currently aiming at.
GetPositionParameter float CProtoSniper::GetPositionParameter(float, bool)
IsLaserOn bool CProtoSniper::IsLaserOn()
IsSweepingRandomly bool CProtoSniper::IsSweepingRandomly()
LaserOff void CProtoSniper::LaserOff()
LaserOn void CProtoSniper::LaserOn(Vector, Vector)
ScopeGlint void CProtoSniper::ScopeGlint()

CPropVehicle

Extends CBaseAnimating

The base class for four-wheel physics vehicles.

Function Signature Description
GetPhysics handle CPropVehicle::GetPhysics() Get a vehicle's physics.
GetVehicleType int CPropVehicle::GetVehicleType() Get a vehicle's type.

CPropVehicleDriveable

Extends CPropVehicle

The base class for driveable vehicles.

Function Signature Description
GetDriver handle CPropVehicleDriveable::GetDriver() Get a vehicle's driver, which could be either a player or a npc_vehicledriver.
IsEngineOn bool CPropVehicleDriveable::IsEngineOn() Check if the engine is on.
IsOverturned bool CPropVehicleDriveable::IsOverturned() Check if the vehicle is overturned.
IsVehicleBodyInWater bool CPropVehicleDriveable::IsVehicleBodyInWater() Check if the vehicle's body is submerged in water.
StartEngine void CPropVehicleDriveable::StartEngine() Start the engine.
StopEngine void CPropVehicleDriveable::StopEngine() Stop the engine.

CPointCommentaryNode

Extends CBaseAnimating

Commentary nodes which play commentary in commentary mode.

Function Signature Description
AbortPlaying void CPointCommentaryNode::AbortPlaying() Stops playing the node and snaps out of its camera control immediately. The game uses this function to shut down commentary while in the middle of playing a node, as it can't smoothly blend out (since the commentary entities need to be removed).
CannotBeStopped bool CPointCommentaryNode::CannotBeStopped()
GetCommentaryFile string CPointCommentaryNode::GetCommentaryFile()
GetCommentaryType int CPointCommentaryNode::GetCommentaryType()
GetFootnote string CPointCommentaryNode::GetFootnote()
GetPrintName string CPointCommentaryNode::GetPrintName()
GetSpeakers string CPointCommentaryNode::GetSpeakers()
HasViewTarget bool CPointCommentaryNode::HasViewTarget()
IsActive bool CPointCommentaryNode::IsActive()
IsDisabled bool CPointCommentaryNode::IsDisabled()
PreventsMovement bool CPointCommentaryNode::PreventsMovement()
SetCommentaryFile void CPointCommentaryNode::SetCommentaryFile(string)
SetCommentaryType void CPointCommentaryNode::SetCommentaryType(int)
SetDisabled void CPointCommentaryNode::SetDisabled(bool)
SetFootnote void CPointCommentaryNode::SetFootnote(string)
SetPrintName void CPointCommentaryNode::SetPrintName(string)
SetSpeakers void CPointCommentaryNode::SetSpeakers(string)
Function Signature Description
PreStartCommentary bool CPointCommentaryNode -> PreStartCommentary() Called just before commentary begins. Use this to modify variables or commentary behavior before it begins. Returning false will prevent the commentary from starting.

CTriggerCamera

Extends CBaseEntity

Server-side camera entity

Function Signature Description
GetFov int CTriggerCamera::GetFov() get camera's current fov setting as integer
SetFov void CTriggerCamera::SetFov(int, float) set camera's current fov in integer degrees and fov change rate as float

CEnvEntityMaker

Extends CBaseEntity

env_entity_maker

Function Signature Description
SpawnEntity void CEnvEntityMaker::SpawnEntity() Create an entity at the location of the maker
SpawnEntityAtEntityOrigin void CEnvEntityMaker::SpawnEntityAtEntityOrigin(handle) Create an entity at the location of a specified entity instance
SpawnEntityAtLocation void CEnvEntityMaker::SpawnEntityAtLocation(Vector, Vector) Create an entity at a specified location and orientaton, orientation is Euler angle in degrees (pitch, yaw, roll)
SpawnEntityAtNamedEntityOrigin void CEnvEntityMaker::SpawnEntityAtNamedEntityOrigin(string) Create an entity at the location of a named entity

CLogicExternalData

Extends CBaseEntity

An entity which loads keyvalues from an external data file.

Function Signature Description
GetKeyValueBlock handle CLogicExternalData::GetKeyValueBlock() Gets the current external data block expressed in CScriptKeyValues.
GetKeyValues handle CLogicExternalData::GetKeyValues() Gets the external data expressed in CScriptKeyValues.
LoadFile void CLogicExternalData::LoadFile() Loads external data from the external file.
SaveFile void CLogicExternalData::SaveFile() Saves the external data to the external file.
SetKeyValueBlock void CLogicExternalData::SetKeyValueBlock(handle) Sets the current external data block from a CScriptKeyValues object.
SetKeyValues void CLogicExternalData::SetKeyValues(handle) Sets the external data from a CScriptKeyValues object.

CGameTrace

trace_t

Function Signature Description
AllSolid bool CGameTrace::AllSolid() Returns whether the trace is completely within a solid.
Contents int CGameTrace::Contents() Gets the contents of the surface the trace has hit.
Destroy void CGameTrace::Destroy() Deletes this instance. Important for preventing memory leaks.
DidHit bool CGameTrace::DidHit() Returns whether the trace hit anything.
DidHitNonWorldEntity bool CGameTrace::DidHitNonWorldEntity() Returns whether the trace hit something other than the world entity.
DidHitWorld bool CGameTrace::DidHitWorld() Returns whether the trace hit the world entity or not.
DispFlags int CGameTrace::DispFlags() Gets the displacement flags of the surface the trace has hit.
EndPos Vector CGameTrace::EndPos() Gets the trace's end position.
Entity handle CGameTrace::Entity() Returns the entity this trace has hit.
Fraction float CGameTrace::Fraction() Gets the fraction of the trace completed. For example, if the trace stopped exactly halfway to the end position, this would be 0.5.
FractionLeftSolid float CGameTrace::FractionLeftSolid() If this trace started within a solid, this is the point in the trace's fraction at which it left that solid.
GetEntityIndex int CGameTrace::GetEntityIndex() Returns the index of whatever entity this trace hit.
HitBox int CGameTrace::HitBox() Returns the hitbox of the entity this trace has hit. If it hit the world entity, this returns the static prop index.
HitGroup int CGameTrace::HitGroup() Returns the specific hit group this trace hit if it hit an entity.
IsDispSurface bool CGameTrace::IsDispSurface() Returns whether this trace hit a displacement.
IsDispSurfaceBuildable bool CGameTrace::IsDispSurfaceBuildable() Returns whether DISPSURF_FLAG_BUILDABLE is ticked on the displacement this trace hit.
IsDispSurfaceProp1 bool CGameTrace::IsDispSurfaceProp1() Returns whether DISPSURF_FLAG_SURFPROP1 is ticked on the displacement this trace hit.
IsDispSurfaceProp2 bool CGameTrace::IsDispSurfaceProp2() Returns whether DISPSURF_FLAG_SURFPROP2 is ticked on the displacement this trace hit.
IsDispSurfaceWalkable bool CGameTrace::IsDispSurfaceWalkable() Returns whether DISPSURF_FLAG_WALKABLE is ticked on the displacement this trace hit.
PhysicsBone int CGameTrace::PhysicsBone() Returns the physics bone this trace hit if it hit an entity.
Plane handle CGameTrace::Plane()
StartPos Vector CGameTrace::StartPos() Gets the trace's start position.
StartSolid bool CGameTrace::StartSolid() Returns whether the trace started within a solid.
Surface handle CGameTrace::Surface()

CMapbaseSystem

All-purpose Mapbase system primarily used for map-specific files.

Function Signature Description
AddManifestFile void CMapbaseSystem::AddManifestFile(string) Loads a manifest file.
GetModName string CMapbaseSystem::GetModName() Gets the name of the mod. This is the name which shows up on Steam, RPC, etc.
IsCoreMapbase bool CMapbaseSystem::IsCoreMapbase() Indicates whether this is one of the original Mapbase mods or just a separate mod using its code.
LoadCustomActbusyFile void CMapbaseSystem::LoadCustomActbusyFile(string) Loads a custom actbusy file.
LoadCustomLocalizationFile void CMapbaseSystem::LoadCustomLocalizationFile(string) Loads a custom localization file.
LoadCustomSoundscriptFile void CMapbaseSystem::LoadCustomSoundscriptFile(string) Loads a custom soundscript file.
LoadCustomSurfacePropsFile void CMapbaseSystem::LoadCustomSurfacePropsFile(string) Loads a custom surface properties file.
LoadCustomTalkerFile void CMapbaseSystem::LoadCustomTalkerFile(string) Loads a custom talker file.

CNetPropManager

Allows reading and updating the network properties of an entity.

Function Signature Description
GetPropArraySize int CNetPropManager::GetPropArraySize(handle, string) Returns the size of an netprop array, or -1.
GetPropEntity handle CNetPropManager::GetPropEntity(handle, string) Reads an EHANDLE valued netprop (21 bit integer). Returns the script handle of the entity.
GetPropEntityArray handle CNetPropManager::GetPropEntityArray(handle, string, int) Reads an EHANDLE valued netprop (21 bit integer) from an array. Returns the script handle of the entity.
GetPropFloat float CNetPropManager::GetPropFloat(handle, string) Reads a float valued netprop.
GetPropFloatArray float CNetPropManager::GetPropFloatArray(handle, string, int) Reads a float valued netprop from an array.
GetPropInt int CNetPropManager::GetPropInt(handle, string) Reads an integer valued netprop.
GetPropIntArray int CNetPropManager::GetPropIntArray(handle, string, int) Reads an integer valued netprop from an array.
GetPropString string CNetPropManager::GetPropString(handle, string) Reads a string valued netprop.
GetPropStringArray string CNetPropManager::GetPropStringArray(handle, string, int) Reads a string valued netprop from an array.
GetPropType string CNetPropManager::GetPropType(handle, string) Returns the name of the netprop type as a string.
GetPropVector Vector CNetPropManager::GetPropVector(handle, string) Reads a 3D vector valued netprop.
GetPropVectorArray Vector CNetPropManager::GetPropVectorArray(handle, string, int) Reads a 3D vector valued netprop from an array.
HasProp bool CNetPropManager::HasProp(handle, string) Checks if a netprop exists.
SetPropEntity void CNetPropManager::SetPropEntity(handle, string, handle) Sets an EHANDLE valued netprop (21 bit integer) to reference the specified entity.
SetPropEntityArray handle CNetPropManager::SetPropEntityArray(handle, string, handle, int) Sets an EHANDLE valued netprop (21 bit integer) from an array to reference the specified entity.
SetPropFloat void CNetPropManager::SetPropFloat(handle, string, float) Sets a netprop to the specified float.
SetPropFloatArray void CNetPropManager::SetPropFloatArray(handle, string, float, int) Sets a netprop from an array to the specified float.
SetPropInt void CNetPropManager::SetPropInt(handle, string, int) Sets a netprop to the specified integer.
SetPropIntArray void CNetPropManager::SetPropIntArray(handle, string, int, int) Sets a netprop from an array to the specified integer.
SetPropString void CNetPropManager::SetPropString(handle, string, string) Sets a netprop to the specified string.
SetPropStringArray void CNetPropManager::SetPropStringArray(handle, string, string, int) Sets a netprop from an array to the specified string.
SetPropVector void CNetPropManager::SetPropVector(handle, string, Vector) Sets a netprop to the specified vector.
SetPropVectorArray void CNetPropManager::SetPropVectorArray(handle, string, Vector, int) Sets a netprop from an array to the specified vector.

CAI_Network

The global list of AI nodes.

Function Signature Description
GetNodeHint handle CAI_Network::GetNodeHint(int) Get a node's hint
GetNodePosition Vector CAI_Network::GetNodePosition(int) Get position of node using a generic human hull
GetNodePositionWithHull Vector CAI_Network::GetNodePositionWithHull(int, int) Get position of node using the specified hull
GetNodeType int CAI_Network::GetNodeType(int) Get a node's type
GetNodeYaw float CAI_Network::GetNodeYaw(int) Get yaw of node
NearestNodeToPoint int CAI_Network::NearestNodeToPoint(Vector, bool) Get ID of nearest node
NearestNodeToPointForNPC int CAI_Network::NearestNodeToPointForNPC(handle, Vector, bool) Get ID of nearest node using the specified NPC's properties
NumNodes int CAI_Network::NumNodes() Number of nodes in the level

CWeaponCustomScripted

Extends CBaseCombatWeapon

Special weapon class with tons of hooks

Function Signature Description
AbortReload void CWeaponCustomScripted -> AbortReload()
ActivityList handle CWeaponCustomScripted -> ActivityList()
ActivityListCount int CWeaponCustomScripted -> ActivityListCount()
AddViewKick void CWeaponCustomScripted -> AddViewKick()
CanDeploy bool CWeaponCustomScripted -> CanDeploy() Should return true if weapon can be deployed
CanHolster bool CWeaponCustomScripted -> CanHolster() Should return true if weapon can be holstered
CheckReload void CWeaponCustomScripted -> CheckReload()
Deploy bool CWeaponCustomScripted -> Deploy() Called when weapon is being deployed
FinishReload void CWeaponCustomScripted -> FinishReload()
GetBulletSpread Vector CWeaponCustomScripted -> GetBulletSpread()
GetBulletSpreadForProficiency Vector CWeaponCustomScripted -> GetBulletSpreadForProficiency(int proficiency) Returns the bullet spread of a specific proficiency level. If this isn't defined, it will fall back to GetBulletSpread.
GetDefaultAnimSpeed float CWeaponCustomScripted -> GetDefaultAnimSpeed()
GetDrawActivity variant CWeaponCustomScripted -> GetDrawActivity()
GetFireRate float CWeaponCustomScripted -> GetFireRate()
GetMaxBurst int CWeaponCustomScripted -> GetMaxBurst()
GetMaxRestTime float CWeaponCustomScripted -> GetMaxRestTime()
GetMinBurst int CWeaponCustomScripted -> GetMinBurst()
GetMinRestTime float CWeaponCustomScripted -> GetMinRestTime()
GetPrimaryAttackActivity variant CWeaponCustomScripted -> GetPrimaryAttackActivity()
GetSecondaryAttackActivity variant CWeaponCustomScripted -> GetSecondaryAttackActivity()
HandleFireOnEmpty void CWeaponCustomScripted -> HandleFireOnEmpty() Called when they have the attack button down but they are out of ammo. The default implementation either reloads, switches weapons, or plays an empty sound.
HasAnyAmmo bool CWeaponCustomScripted -> HasAnyAmmo() Should return true if weapon has ammo
HasPrimaryAmmo bool CWeaponCustomScripted -> HasPrimaryAmmo() Should return true if weapon has primary ammo
HasSecondaryAmmo bool CWeaponCustomScripted -> HasSecondaryAmmo() Should return true if weapon has secondary ammo
Holster bool CWeaponCustomScripted -> Holster(handle switchingto) Called when weapon is being holstered
ItemBusyFrame void CWeaponCustomScripted -> ItemBusyFrame() Called each frame by the player PostThink, if the player's not ready to attack yet
ItemHolsterFrame void CWeaponCustomScripted -> ItemHolsterFrame() Called each frame by the player PreThink, if the weapon is holstered
ItemPostFrame void CWeaponCustomScripted -> ItemPostFrame() Called each frame by the player PostThink
ItemPreFrame void CWeaponCustomScripted -> ItemPreFrame() Called each frame by the player PreThink
PrimaryAttack void CWeaponCustomScripted -> PrimaryAttack()
Reload bool CWeaponCustomScripted -> Reload()
Reload_NPC void CWeaponCustomScripted -> Reload_NPC()
SecondaryAttack void CWeaponCustomScripted -> SecondaryAttack()
WeaponIdle void CWeaponCustomScripted -> WeaponIdle() Called when no buttons pressed
WeaponLOSCondition bool CWeaponCustomScripted -> WeaponLOSCondition()
WeaponMeleeAttack1Condition int CWeaponCustomScripted -> WeaponMeleeAttack1Condition()
WeaponMeleeAttack2Condition int CWeaponCustomScripted -> WeaponMeleeAttack2Condition()
WeaponRangeAttack1Condition int CWeaponCustomScripted -> WeaponRangeAttack1Condition()
WeaponRangeAttack2Condition int CWeaponCustomScripted -> WeaponRangeAttack2Condition()

CFourWheelVehiclePhysics

Handler for four-wheel vehicle physics.

Function Signature Description
BoostTimeLeft int CFourWheelVehiclePhysics::BoostTimeLeft() Gets how much time is left in any current boost.
DisableMotion void CFourWheelVehiclePhysics::DisableMotion() Disables vehicle motion.
EnableMotion void CFourWheelVehiclePhysics::EnableMotion() Enables vehicle motion.
GetHLSpeed float CFourWheelVehiclePhysics::GetHLSpeed() Gets HL speed.
GetMaxSpeed int CFourWheelVehiclePhysics::GetMaxSpeed() Gets the max speed.
GetRPM int CFourWheelVehiclePhysics::GetRPM() Gets the RPM.
GetSpeed int CFourWheelVehiclePhysics::GetSpeed() Gets the speed.
GetSteering float CFourWheelVehiclePhysics::GetSteering() Gets the steeering.
GetSteeringDegrees float CFourWheelVehiclePhysics::GetSteeringDegrees() Gets the degrees of steeering.
GetThrottle float CFourWheelVehiclePhysics::GetThrottle() Gets the throttle.
HasBoost bool CFourWheelVehiclePhysics::HasBoost() Checks if the vehicle has the ability to boost.
IsBoosting bool CFourWheelVehiclePhysics::IsBoosting() Checks if the vehicle is boosting.
IsEngineDisabled bool CFourWheelVehiclePhysics::IsEngineDisabled() Checks whether the engine is disabled.
SetAction void CFourWheelVehiclePhysics::SetAction(float) Sets the action.
SetBoost void CFourWheelVehiclePhysics::SetBoost(float) Sets the boost.
SetDisableEngine void CFourWheelVehiclePhysics::SetDisableEngine(bool) Sets whether the engine is disabled.
SetHandbrake void CFourWheelVehiclePhysics::SetHandbrake(bool) Sets the handbrake.
SetHasBrakePedal void CFourWheelVehiclePhysics::SetHasBrakePedal(bool) Sets whether a handbrake pedal exists.
SetMaxReverseThrottle void CFourWheelVehiclePhysics::SetMaxReverseThrottle(float) Sets the max reverse throttle.
SetMaxThrottle void CFourWheelVehiclePhysics::SetMaxThrottle(float) Sets the max throttle.
SetSteering void CFourWheelVehiclePhysics::SetSteering(float, float) Sets the steering.
SetSteeringDegrees void CFourWheelVehiclePhysics::SetSteeringDegrees(float) Sets the degrees of steering.
SetThrottle void CFourWheelVehiclePhysics::SetThrottle(float) Sets the throttle.

matrix3x4_t

A 3x4 matrix transform.

Function Signature Description
Init void matrix3x4_t::Init(Vector, Vector, Vector, Vector) Creates a matrix where the X axis = forward, the Y axis = left, and the Z axis = up.

IPhysicsObject

VPhysics object class.

Function Signature Description
ApplyForceCenter void IPhysicsObject::ApplyForceCenter(Vector)
ApplyForceOffset void IPhysicsObject::ApplyForceOffset(Vector, Vector)
ApplyTorqueCenter void IPhysicsObject::ApplyTorqueCenter(Vector)
EnableCollisions void IPhysicsObject::EnableCollisions(bool)
EnableDrag void IPhysicsObject::EnableDrag(bool)
EnableGravity void IPhysicsObject::EnableGravity(bool)
EnableMotion void IPhysicsObject::EnableMotion(bool)
GetInertia Vector IPhysicsObject::GetInertia()
GetInvInertia Vector IPhysicsObject::GetInvInertia()
GetInvMass float IPhysicsObject::GetInvMass()
GetMass float IPhysicsObject::GetMass()
GetName string IPhysicsObject::GetName()
IsAsleep bool IPhysicsObject::IsAsleep()
IsAttachedToConstraint bool IPhysicsObject::IsAttachedToConstraint(bool)
IsCollisionEnabled bool IPhysicsObject::IsCollisionEnabled()
IsDragEnabled bool IPhysicsObject::IsDragEnabled()
IsFluid bool IPhysicsObject::IsFluid()
IsGravityEnabled bool IPhysicsObject::IsGravityEnabled()
IsHinged bool IPhysicsObject::IsHinged()
IsMotionEnabled bool IPhysicsObject::IsMotionEnabled()
IsMoveable bool IPhysicsObject::IsMoveable()
IsStatic bool IPhysicsObject::IsStatic()
IsTrigger bool IPhysicsObject::IsTrigger()
SetInertia void IPhysicsObject::SetInertia(Vector)
SetMass void IPhysicsObject::SetMass(float)
Sleep void IPhysicsObject::Sleep()
Wake void IPhysicsObject::Wake()

CUserCmd

Function Signature Description
GetButtons int CUserCmd::GetButtons() Input button state.
GetCommandNumber int CUserCmd::GetCommandNumber() For matching server and client commands for debugging.
GetForwardMove float CUserCmd::GetForwardMove()
GetImpulse int CUserCmd::GetImpulse() Impulse command issued.
GetMouseX int CUserCmd::GetMouseX() Mouse accum in x from create move.
GetMouseY int CUserCmd::GetMouseY() Mouse accum in y from create move.
GetRandomSeed int CUserCmd::GetRandomSeed() For shared random functions.
GetSideMove float CUserCmd::GetSideMove()
GetTickCount int CUserCmd::GetTickCount() The tick the client created this command.
GetUpMove float CUserCmd::GetUpMove()
GetViewAngles Vector CUserCmd::GetViewAngles() Player instantaneous view angles.
GetWeaponSelect int CUserCmd::GetWeaponSelect() Current weapon id.
GetWeaponSubtype int CUserCmd::GetWeaponSubtype() Current weapon subtype id.
SetButtons void CUserCmd::SetButtons(int) Sets input button state.
SetForwardMove void CUserCmd::SetForwardMove(float)
SetImpulse void CUserCmd::SetImpulse(int) Sets impulse command issued.
SetMouseX void CUserCmd::SetMouseX(int) Sets mouse accum in x from create move.
SetMouseY void CUserCmd::SetMouseY(int) Sets mouse accum in y from create move.
SetSideMove void CUserCmd::SetSideMove(float)
SetUpMove void CUserCmd::SetUpMove(float)
SetViewAngles void CUserCmd::SetViewAngles(Vector) Sets player instantaneous view angles.
SetWeaponSelect void CUserCmd::SetWeaponSelect(int) Sets current weapon id.
SetWeaponSubtype void CUserCmd::SetWeaponSubtype(int) Sets current weapon subtype id.

CConvars

Provides an interface to convars.

Function Signature Description
GetBool bool CConvars::GetBool(string) Returns the convar as a bool. May return null if no such convar.
GetClientConvarValue string CConvars::GetClientConvarValue(int, string) Get a convar keyvalue for a specified client
GetCommandClient handle CConvars::GetCommandClient() returns the player who issued this console command.
GetDefaultValue string CConvars::GetDefaultValue(string) Returns the convar's default value as a string. May return null if no such convar.
GetFloat float CConvars::GetFloat(string) Returns the convar as a float. May return null if no such convar.
GetInt int CConvars::GetInt(string) Returns the convar as an int. May return null if no such convar.
GetStr string CConvars::GetStr(string) Returns the convar as a string. May return null if no such convar.
IsFlagSet bool CConvars::IsFlagSet(string, int) Returns the convar's flags. May return null if no such convar.
RegisterCommand void CConvars::RegisterCommand(string, handle, string, int) register a console command.
RegisterConvar void CConvars::RegisterConvar(string, string, string, int) register a new console variable.
SetBool void CConvars::SetBool(string, bool) Sets the value of the convar as a bool.
SetChangeCallback void CConvars::SetChangeCallback(string, handle) callback is called with 5 parameters (var, szOldValue, flOldValue, szNewValue, flNewValue)
SetCompletionCallback void CConvars::SetCompletionCallback(string, handle) callback is called with 3 parameters (cmd, partial, commands), user strings must be appended to 'commands' array
SetFloat void CConvars::SetFloat(string, float) Sets the value of the convar as a float.
SetInt void CConvars::SetInt(string, int) Sets the value of the convar as an int.
SetStr void CConvars::SetStr(string, string) Sets the value of the convar as a string.
UnregisterCommand void CConvars::UnregisterCommand(string) unregister a console command.

cplane_t

FireBulletsInfo_t

Function Signature Description
GetAdditionalIgnoreEnt handle FireBulletsInfo_t::GetAdditionalIgnoreEnt()
GetAmmoType int FireBulletsInfo_t::GetAmmoType()
GetAttacker handle FireBulletsInfo_t::GetAttacker()
GetDamage float FireBulletsInfo_t::GetDamage() Gets the damage the bullets should deal. 0 = use ammo type
GetDamageForceScale float FireBulletsInfo_t::GetDamageForceScale()
GetDirShooting Vector FireBulletsInfo_t::GetDirShooting()
GetDistance float FireBulletsInfo_t::GetDistance() Gets the distance the bullets should travel.
GetFlags int FireBulletsInfo_t::GetFlags() Gets the flags the bullets should use.
GetPlayerDamage int FireBulletsInfo_t::GetPlayerDamage() Gets the damage the bullets should deal when hitting the player. 0 = use regular damage
GetPrimaryAttack bool FireBulletsInfo_t::GetPrimaryAttack() Gets whether the bullets came from a primary attack.
GetShots int FireBulletsInfo_t::GetShots() Gets the number of shots which should be fired.
GetSource Vector FireBulletsInfo_t::GetSource()
GetSpread Vector FireBulletsInfo_t::GetSpread()
GetTracerFreq int FireBulletsInfo_t::GetTracerFreq()
SetAdditionalIgnoreEnt void FireBulletsInfo_t::SetAdditionalIgnoreEnt(handle)
SetAmmoType void FireBulletsInfo_t::SetAmmoType(int)
SetAttacker void FireBulletsInfo_t::SetAttacker(handle)
SetDamage void FireBulletsInfo_t::SetDamage(float) Sets the damage the bullets should deal. 0 = use ammo type
SetDamageForceScale void FireBulletsInfo_t::SetDamageForceScale(float)
SetDirShooting void FireBulletsInfo_t::SetDirShooting(Vector)
SetDistance void FireBulletsInfo_t::SetDistance(float) Sets the distance the bullets should travel.
SetFlags void FireBulletsInfo_t::SetFlags(float) Sets the flags the bullets should use.
SetPlayerDamage void FireBulletsInfo_t::SetPlayerDamage(float) Sets the damage the bullets should deal when hitting the player. 0 = use regular damage
SetPrimaryAttack void FireBulletsInfo_t::SetPrimaryAttack(bool) Sets whether the bullets came from a primary attack.
SetShots void FireBulletsInfo_t::SetShots(int) Sets the number of shots which should be fired.
SetSource void FireBulletsInfo_t::SetSource(Vector)
SetSpread void FireBulletsInfo_t::SetSpread(Vector)
SetTracerFreq void FireBulletsInfo_t::SetTracerFreq(int)

CLocalize

Accesses functions related to localization strings.

Function Signature Description
AddStringAsUTF8 void CLocalize::AddStringAsUTF8(string, string) Adds a new localized token as a UTF-8 string (not Unicode).
GetTokenAsUTF8 string CLocalize::GetTokenAsUTF8(string) Gets the current language's token as a UTF-8 string (not Unicode).

surfacedata_t

Function Signature Description
GetFriction float surfacedata_t::GetFriction()
GetJumpFactor float surfacedata_t::GetJumpFactor()
GetMaterialChar char surfacedata_t::GetMaterialChar()
GetSoundBreak string surfacedata_t::GetSoundBreak()
GetSoundBulletImpact string surfacedata_t::GetSoundBulletImpact()
GetSoundImpactHard string surfacedata_t::GetSoundImpactHard()
GetSoundImpactSoft string surfacedata_t::GetSoundImpactSoft()
GetSoundRolling string surfacedata_t::GetSoundRolling()
GetSoundScrapeRough string surfacedata_t::GetSoundScrapeRough()
GetSoundScrapeSmooth string surfacedata_t::GetSoundScrapeSmooth()
GetSoundStepLeft string surfacedata_t::GetSoundStepLeft()
GetSoundStepRight string surfacedata_t::GetSoundStepRight()
GetSoundStrain string surfacedata_t::GetSoundStrain()
GetThickness float surfacedata_t::GetThickness()

AI_EnemyInfo_t

Accessor for information about an enemy.

Function Signature Description
DangerMemory bool AI_EnemyInfo_t::DangerMemory() Get the memory of danger position w/o enemy pointer.
EludedMe bool AI_EnemyInfo_t::EludedMe() Get whether the enemy is not at the last known location.
Enemy handle AI_EnemyInfo_t::Enemy()
LastKnownLocation Vector AI_EnemyInfo_t::LastKnownLocation() Get
LastSeenLocation Vector AI_EnemyInfo_t::LastSeenLocation() Get
MobbedMe bool AI_EnemyInfo_t::MobbedMe() Get whether the enemy was part of a mob at some point.
SetDangerMemory void AI_EnemyInfo_t::SetDangerMemory(bool) Set the memory of danger position w/o enemy pointer.
SetEludedMe void AI_EnemyInfo_t::SetEludedMe(bool) Set whether the enemy is not at the last known location.
SetEnemy void AI_EnemyInfo_t::SetEnemy(handle)
SetLastKnownLocation void AI_EnemyInfo_t::SetLastKnownLocation(Vector) Set
SetLastSeenLocation void AI_EnemyInfo_t::SetLastSeenLocation(Vector) Set
SetMobbedMe void AI_EnemyInfo_t::SetMobbedMe(bool) Set whether the enemy was part of a mob at some point.
SetTimeAtFirstHand void AI_EnemyInfo_t::SetTimeAtFirstHand(float) Set the time at which the enemy was seen firsthand.
SetTimeFirstSeen void AI_EnemyInfo_t::SetTimeFirstSeen(float) Set
SetTimeLastReacquired void AI_EnemyInfo_t::SetTimeLastReacquired(float) Set
SetTimeLastReceivedDamageFrom void AI_EnemyInfo_t::SetTimeLastReceivedDamageFrom(float) Set the last time damage was received from this enemy.
SetTimeLastSeen void AI_EnemyInfo_t::SetTimeLastSeen(float) Set
SetTimeValidEnemy void AI_EnemyInfo_t::SetTimeValidEnemy(float) Set the time at which the enemy can be selected (reaction delay).
SetUnforgettable void AI_EnemyInfo_t::SetUnforgettable(bool) Set
TimeAtFirstHand float AI_EnemyInfo_t::TimeAtFirstHand() Get the time at which the enemy was seen firsthand.
TimeFirstSeen float AI_EnemyInfo_t::TimeFirstSeen() Get
TimeLastReacquired float AI_EnemyInfo_t::TimeLastReacquired() Get
TimeLastReceivedDamageFrom float AI_EnemyInfo_t::TimeLastReceivedDamageFrom() Get the last time damage was received from this enemy.
TimeLastSeen float AI_EnemyInfo_t::TimeLastSeen() Get
TimeValidEnemy float AI_EnemyInfo_t::TimeValidEnemy() Get the time at which the enemy can be selected (reaction delay).
Unforgettable bool AI_EnemyInfo_t::Unforgettable() Get

scriptanimevent_t

Function Signature Description
GetCycle float scriptanimevent_t::GetCycle()
GetEvent int scriptanimevent_t::GetEvent()
GetEventTime float scriptanimevent_t::GetEventTime()
GetOptions string scriptanimevent_t::GetOptions()
GetSource handle scriptanimevent_t::GetSource() Gets the event's source entity.
GetType int scriptanimevent_t::GetType() Gets the event's type flags. See the 'AE_TYPE_' set of constants for valid flags.
SetCycle void scriptanimevent_t::SetCycle(float)
SetEvent void scriptanimevent_t::SetEvent(int)
SetEventTime void scriptanimevent_t::SetEventTime(float)
SetOptions void scriptanimevent_t::SetOptions(string)
SetSource void scriptanimevent_t::SetSource(handle) Sets the event's source entity.
SetType void scriptanimevent_t::SetType(int) Sets the event's type flags. See the 'AE_TYPE_' set of constants for valid flags.

CScriptKeyValues

Wrapper class over KeyValues instance

Function Signature Description
FindKey handle CScriptKeyValues::FindKey(string) Given a KeyValues object and a key name, find a KeyValues object associated with the key name
FindOrCreateKey handle CScriptKeyValues::FindOrCreateKey(string) Given a KeyValues object and a key name, find or create a KeyValues object associated with the key name
GetBool bool CScriptKeyValues::GetBool() Given a KeyValues object, return its own associated bool value
GetFirstSubKey handle CScriptKeyValues::GetFirstSubKey() Given a KeyValues object, return the first sub key object
GetFloat float CScriptKeyValues::GetFloat() Given a KeyValues object, return its own associated float value
GetInt int CScriptKeyValues::GetInt() Given a KeyValues object, return its own associated integer value
GetKeyBool bool CScriptKeyValues::GetKeyBool(string) Given a KeyValues object and a key name, return associated bool value
GetKeyFloat float CScriptKeyValues::GetKeyFloat(string) Given a KeyValues object and a key name, return associated float value
GetKeyInt int CScriptKeyValues::GetKeyInt(string) Given a KeyValues object and a key name, return associated integer value
GetKeyString string CScriptKeyValues::GetKeyString(string) Given a KeyValues object and a key name, return associated string value
GetName string CScriptKeyValues::GetName() Given a KeyValues object, return its name
GetNextKey handle CScriptKeyValues::GetNextKey() Given a KeyValues object, return the next key object in a sub key group
GetString string CScriptKeyValues::GetString() Given a KeyValues object, return its own associated string value
IsKeyEmpty bool CScriptKeyValues::IsKeyEmpty(string) Given a KeyValues object and a key name, return true if key name has no value
ReleaseKeyValues void CScriptKeyValues::ReleaseKeyValues() Given a root KeyValues object, release its contents
SetBool void CScriptKeyValues::SetBool(bool) Given a KeyValues object, set its own associated bool value
SetFloat void CScriptKeyValues::SetFloat(float) Given a KeyValues object, set its own associated float value
SetInt void CScriptKeyValues::SetInt(int) Given a KeyValues object, set its own associated integer value
SetKeyBool void CScriptKeyValues::SetKeyBool(string, bool) Given a KeyValues object and a key name, set associated bool value
SetKeyFloat void CScriptKeyValues::SetKeyFloat(string, float) Given a KeyValues object and a key name, set associated float value
SetKeyInt void CScriptKeyValues::SetKeyInt(string, int) Given a KeyValues object and a key name, set associated integer value
SetKeyString void CScriptKeyValues::SetKeyString(string, string) Given a KeyValues object and a key name, set associated string value
SetName void CScriptKeyValues::SetName(string) Given a KeyValues object, set its name
SetString void CScriptKeyValues::SetString(string) Given a KeyValues object, set its own associated string value
SubKeysToTable void CScriptKeyValues::SubKeysToTable(handle) Converts to script table.
TableToSubKeys void CScriptKeyValues::TableToSubKeys(handle) Converts a script table to KeyValues.

CTakeDamageInfo

Damage information handler.

Function Signature Description
AddDamage void CTakeDamageInfo::AddDamage(float) Adds to the damage.
AddDamageType void CTakeDamageInfo::AddDamageType(int) Adds to the damage type.
BaseDamageIsValid bool CTakeDamageInfo::BaseDamageIsValid() Checks if the base damage is valid.
GetAmmoName string CTakeDamageInfo::GetAmmoName() Gets the ammo type name.
GetAmmoType int CTakeDamageInfo::GetAmmoType() Gets the ammo type.
GetAttacker handle CTakeDamageInfo::GetAttacker() Gets the attacker.
GetBaseDamage float CTakeDamageInfo::GetBaseDamage() Gets the base damage.
GetDamage float CTakeDamageInfo::GetDamage() Gets the damage.
GetDamageBonus float CTakeDamageInfo::GetDamageBonus() Gets the damage bonus.
GetDamageCustom int CTakeDamageInfo::GetDamageCustom() Gets the damage custom.
GetDamageForce Vector CTakeDamageInfo::GetDamageForce() Gets the damage force.
GetDamagePosition Vector CTakeDamageInfo::GetDamagePosition() Gets the damage position.
GetDamageStats int CTakeDamageInfo::GetDamageStats() Gets the damage stats.
GetDamageType int CTakeDamageInfo::GetDamageType() Gets the damage type.
GetDamagedOtherPlayers int CTakeDamageInfo::GetDamagedOtherPlayers() Gets whether other players have been damaged.
GetInflictor handle CTakeDamageInfo::GetInflictor() Gets the inflictor.
GetMaxDamage float CTakeDamageInfo::GetMaxDamage() Gets the max damage.
GetPlayerPenetrationCount int CTakeDamageInfo::GetPlayerPenetrationCount() Gets the player penetration count.
GetReportedPosition Vector CTakeDamageInfo::GetReportedPosition() Gets the reported damage position.
GetWeapon handle CTakeDamageInfo::GetWeapon() Gets the weapon.
IsForceFriendlyFire bool CTakeDamageInfo::IsForceFriendlyFire() Gets force friendly fire.
ScaleDamage void CTakeDamageInfo::ScaleDamage(float) Scales the damage.
ScaleDamageForce void CTakeDamageInfo::ScaleDamageForce(float) Scales the damage force.
SetAmmoType void CTakeDamageInfo::SetAmmoType(int) Sets the ammo type.
SetAttacker void CTakeDamageInfo::SetAttacker(handle) Sets the attacker.
SetDamage void CTakeDamageInfo::SetDamage(float) Sets the damage.
SetDamageBonus void CTakeDamageInfo::SetDamageBonus(float) Sets the damage bonus.
SetDamageCustom void CTakeDamageInfo::SetDamageCustom(int) Sets the damage custom.
SetDamageForce void CTakeDamageInfo::SetDamageForce(Vector) Sets the damage force.
SetDamagePosition void CTakeDamageInfo::SetDamagePosition(Vector) Sets the damage position.
SetDamageStats void CTakeDamageInfo::SetDamageStats(int) Sets the damage stats.
SetDamageType void CTakeDamageInfo::SetDamageType(int) Sets the damage type.
SetDamagedOtherPlayers void CTakeDamageInfo::SetDamagedOtherPlayers(int) Sets whether other players have been damaged.
SetForceFriendlyFire void CTakeDamageInfo::SetForceFriendlyFire(bool) Sets force friendly fire.
SetInflictor void CTakeDamageInfo::SetInflictor(handle) Sets the inflictor.
SetMaxDamage void CTakeDamageInfo::SetMaxDamage(float) Sets the max damage.
SetPlayerPenetrationCount void CTakeDamageInfo::SetPlayerPenetrationCount(int) Sets the player penetration count.
SetReportedPosition void CTakeDamageInfo::SetReportedPosition(Vector) Sets the reported damage position.
SetWeapon void CTakeDamageInfo::SetWeapon(handle) Sets the weapon.
SubtractDamage void CTakeDamageInfo::SubtractDamage(float) Removes from the damage.

EmitSound_t

Function Signature Description
ClearOrigin void EmitSound_t::ClearOrigin() Clears the sound's origin override if it has one.
GetChannel int EmitSound_t::GetChannel()
GetEmitCloseCaption float EmitSound_t::GetEmitCloseCaption() Gets whether or not the sound will emit closed captioning/subtitles.
GetFlags int EmitSound_t::GetFlags() Gets the sound's flags. See the 'SND_' set of constants.
GetOrigin Vector EmitSound_t::GetOrigin() Gets the sound's origin override.
GetSoundLevel int EmitSound_t::GetSoundLevel() Gets the sound's level in decibels. (Note that this may not apply to soundscripts)
GetSoundName string EmitSound_t::GetSoundName() Gets the sound's file path or soundscript name.
GetSoundScriptHandle int EmitSound_t::GetSoundScriptHandle()
GetSoundTime float EmitSound_t::GetSoundTime() Gets the time the sound will begin, relative to Time().
GetSpeakerEntity int EmitSound_t::GetSpeakerEntity() Gets the sound's original source if it is being transmitted by a microphone.
GetSpecialDSP int EmitSound_t::GetSpecialDSP()
GetVolume float EmitSound_t::GetVolume() (Note that this may not apply to soundscripts)
GetWarnOnDirectWaveReference float EmitSound_t::GetWarnOnDirectWaveReference() Gets whether or not the sound will send a message to the console if it references a direct sound file instead of a soundscript.
GetWarnOnMissingCloseCaption float EmitSound_t::GetWarnOnMissingCloseCaption() Gets whether or not the sound will send a message to the console if there is no corresponding closed captioning token.
HasOrigin bool EmitSound_t::HasOrigin() Returns true if the sound has an origin override.
SetChannel void EmitSound_t::SetChannel(int)
SetEmitCloseCaption void EmitSound_t::SetEmitCloseCaption(bool) Sets whether or not the sound will emit closed captioning/subtitles.
SetFlags void EmitSound_t::SetFlags(int) Sets the sound's flags. See the 'SND_' set of constants.
SetOrigin void EmitSound_t::SetOrigin(Vector) Sets the sound's origin override.
SetSoundLevel void EmitSound_t::SetSoundLevel(int) Sets the sound's level in decibels. (Note that this may not apply to soundscripts)
SetSoundName void EmitSound_t::SetSoundName(string) Sets the sound's file path or soundscript name.
SetSoundScriptHandle void EmitSound_t::SetSoundScriptHandle(int)
SetSoundTime void EmitSound_t::SetSoundTime(float) Sets the time the sound will begin, relative to Time().
SetSpeakerEntity void EmitSound_t::SetSpeakerEntity(int) Sets the sound's original source if it is being transmitted by a microphone.
SetSpecialDSP void EmitSound_t::SetSpecialDSP(int)
SetVolume void EmitSound_t::SetVolume(float) (Note that this may not apply to soundscripts)
SetWarnOnDirectWaveReference void EmitSound_t::SetWarnOnDirectWaveReference(bool) Sets whether or not the sound will send a message to the console if it references a direct sound file instead of a soundscript.
SetWarnOnMissingCloseCaption void EmitSound_t::SetWarnOnMissingCloseCaption(bool) Sets whether or not the sound will send a message to the console if there is no corresponding closed captioning token.

CRagdollProp

Extends CBaseAnimating

Ragdoll physics prop.

Function Signature Description
GetRagdollObject handle CRagdollProp::GetRagdollObject(int) Gets the ragdoll object of the specified index.
GetRagdollObjectCount int CRagdollProp::GetRagdollObjectCount() Gets the number of ragdoll objects on this ragdoll.
GetSourceClassName string CRagdollProp::GetSourceClassName() Gets the ragdoll's source classname.
HasPhysgunInteraction bool CRagdollProp::HasPhysgunInteraction(string, string) Checks if the ragdoll has the specified interaction.
SetSourceClassName void CRagdollProp::SetSourceClassName(string) Sets the ragdoll's source classname.

csurface_t

Function Signature Description
Name string csurface_t::Name()
SurfaceProps handle csurface_t::SurfaceProps() The surface's properties.

Data Types

Quaternion

A quaternion.

Function Signature Description
w float Quaternion.w The quaternion's scalar component.
x float Quaternion.x The quaternion's i axis component.
y float Quaternion.y The quaternion's j axis component.
z float Quaternion.z The quaternion's k axis component.
Function Signature Description
Init void Quaternion::Init(float, float, float, float) Creates a quaternion with the given values.

Vector

Basic 3-float Vector class.

Function Signature Description
x float Vector.x The vector's X coordinate on the cartesian X axis.
y float Vector.y The vector's Y coordinate on the cartesian Y axis.
z float Vector.z The vector's Z coordinate on the cartesian Z axis.
Function Signature Description
Cross float Vector::Cross(vector) Return the vector product of two vectors.
Dot float Vector::Dot(vector) Return the dot/scalar product of two vectors.
Length float Vector::Length() Return the vector's length.
Length2D float Vector::Length2D() Return the vector's 2D length.
Length2DSqr float Vector::Length2DSqr() Return the vector's squared 2D length.
LengthSqr float Vector::LengthSqr() Return the vector's squared length.
Norm void Vector::Norm() Normalize the vector in place.
Normalized float Vector::Normalized() Return a normalized version of the vector.
Scale vector Vector::Scale(float) Scale the vector's magnitude and return the result.
ToKVString string Vector::ToKVString() Return a vector as a string in KeyValue form, without separation commas.

Color

Function Signature Description
a char Color.a Member variable for alpha. (transparency)
b char Color.b Member variable for blue.
g char Color.g Member variable for green.
r char Color.r Member variable for red.
Function Signature Description
GetRawColor int Color::GetRawColor() Gets the raw color integer.
SetColor void Color::SetColor(int, int, int, int) Sets the color.
SetRawColor void Color::SetRawColor(int) Sets the raw color integer.

Global Functions

Function Signature Description
AddPhysVelocity void AddPhysVelocity(handle, Vector, Vector) Adds physics velocity for the given VPhysics object
AddThinkToEnt void AddThinkToEnt(handle, string) This will put a think function onto an entity, or pass null to remove it. This is NOT chained, so be careful.
AngleDiff float AngleDiff(float, float) Returns the degrees difference between two yaw angles.
AngleDistance float AngleDistance(float, float)
AngleIMatrix void AngleIMatrix(Vector, Vector, handle) Sets the inverted angles and position of a matrix.
AngleMatrix void AngleMatrix(Vector, Vector, handle) Sets the angles and position of a matrix.
AngleNormalize float AngleNormalize(float) Clamps an angle to be in between -360 and 360.
AngleNormalizePositive float AngleNormalizePositive(float) Clamps an angle to be in between 0 and 360.
AngleVectors Vector AngleVectors(Vector) Turns an angle into a direction vector.
AnglesAreEqual bool AnglesAreEqual(float, float, float) Checks if two angles are equal based on a given tolerance value.
AppearsToBeANumber bool AppearsToBeANumber(string) Checks if the given string appears to be a number.
Approach float Approach(float, float, float)
ApproachAngle float ApproachAngle(float, float, float) Returns an angle which approaches the target angle from the input angle with the specified speed.
Bias float Bias(float, float) The curve is biased towards 0 or 1 based on biasAmt, which is between 0 and 1.
CalcClosestPointOnAABB Vector CalcClosestPointOnAABB(Vector, Vector, Vector) Returns the closest point on a bounding box.
CalcClosestPointOnLine Vector CalcClosestPointOnLine(Vector, Vector, Vector) Returns the closest point on a line.
CalcClosestPointOnLineSegment Vector CalcClosestPointOnLineSegment(Vector, Vector, Vector) Returns the closest point on a line segment.
CalcDistanceToLine float CalcDistanceToLine(Vector, Vector, Vector) Returns the distance to a line.
CalcDistanceToLineSegment float CalcDistanceToLineSegment(Vector, Vector, Vector) Returns the distance to a line segment.
CalcSqrDistanceToAABB float CalcSqrDistanceToAABB(Vector, Vector, Vector) Returns the squared distance to a bounding box.
CalculateBulletDamageForce void CalculateBulletDamageForce(handle, int, Vector, Vector, float) Fill out a damage info handle with a damage force for a bullet impact.
CalculateExplosiveDamageForce void CalculateExplosiveDamageForce(handle, Vector, Vector, float) Fill out a damage info handle with a damage force for an explosive.
CalculateMeleeDamageForce void CalculateMeleeDamageForce(handle, Vector, Vector, float) Fill out a damage info handle with a damage force for a melee impact.
CancelEntityIOEvent bool CancelEntityIOEvent(int) Remove entity I/O event.
ClearSavedTable void ClearSavedTable(string) Removes the table with the given context.
ConcatTransforms void ConcatTransforms(handle, handle, handle) Concatenates two transformation matrices into another matrix.
CreateDamageInfo handle CreateDamageInfo(handle, handle, Vector, Vector, float, int)
CreateFireBulletsInfo handle CreateFireBulletsInfo(int, Vector, Vector, Vector, float, handle)
CreateProp handle CreateProp(string, Vector, string, int) Create a physics prop
CreateRope handle CreateRope(handle, handle, int, int, float, string, int, int) Creates a single rope between two entities. Can optionally follow specific attachments.
CreateRopeWithSecondPointDetached handle CreateRopeWithSecondPointDetached(handle, int, int, float, string, int, bool, int) Creates a single detached rope hanging from a point. Can optionally follow a specific start attachment.
CreateSceneEntity handle CreateSceneEntity(string) Create a scene entity to play the specified scene.
DecalTrace void DecalTrace(handle, string) Creates a dynamic decal based on the given trace info. The trace information can be generated by TraceLineComplex() and the decal name must be from decals_subrect.txt.
DestroyDamageInfo void DestroyDamageInfo(handle)
DestroyFireBulletsInfo void DestroyFireBulletsInfo(handle)
DispatchParticleEffect null Dispatches a one-off particle system
DispatchSpawn void DispatchSpawn(handle) Spawns an unspawned entity.
DoIncludeScript bool DoIncludeScript(string, handle) Execute a script (internal)
EmitSoundOn void EmitSoundOn(string, handle) Play named sound on an entity.
EmitSoundOnClient void EmitSoundOnClient(string, handle, handle) Play named sound only on the client for the specified player.
EmitSoundParamsOn void EmitSoundParamsOn(handle, handle) Play EmitSound_t params on an entity.
EntFire null Generate an entity i/o event
EntFireByHandle null Generate an entity i/o event. First parameter is an entity instance.
EntIndexToHScript handle EntIndexToHScript(int) Returns the script handle for the given entity index.
EntitiesAtPoint void EntitiesAtPoint(handle, int, Vector, int) Gets all entities which are intersecting a point in space. This function copies them to an array with a maximum number of elements.
EntitiesInBox void EntitiesInBox(handle, int, Vector, Vector, int) Gets all entities which are within a worldspace box. This function copies them to an array with a maximum number of elements.
EntitiesInSphere void EntitiesInSphere(handle, int, Vector, float, int) Gets all entities which are within a sphere. This function copies them to an array with a maximum number of elements.
ExponentialDecay float ExponentialDecay(float, float, float) decayTo is factor the value should decay to in decayTime
FLerp float FLerp(float, float, float, float, float)
FileExists bool FileExists(string) Returns true if the file exists.
FileToKeyValues handle FileToKeyValues(string) Returns the CScriptKeyValues from the file, null if no file or file is too big.
FileToString string FileToString(string) Returns the string from the file, null if no file or file is too big.
FireGameEvent void FireGameEvent(string, handle) Fire a game event.
FireGameEventLocal void FireGameEventLocal(string, handle) Fire a game event without broadcasting to the client.
FrameTime float FrameTime() Get the time spent on the server in the last frame
FreeMatrixInstance void FreeMatrixInstance(handle) Frees an allocated matrix instance.
FreeQuaternionInstance void FreeQuaternionInstance(handle) Frees an allocated quaternion instance.
Gain float Gain(float, float) Gain is similar to Bias, but biasAmt biases towards or away from 0.5.
GameOver handle GameOver(string, float, float, float, int, int, int) Ends the game and reloads the last save.
GetActivityName string GetActivityName(int) Gets the name of the specified activity index.
GetCPUUsage float GetCPUUsage() Get CPU usage percentage.
GetEntityIOEventTimeLeft float GetEntityIOEventTimeLeft(int) Get time left on entity I/O event.
GetFrameCount int GetFrameCount() Absolute frame counter
GetLoadType int GetLoadType() Get the way the current game was loaded (corresponds to the MapLoad enum)
GetMapName string GetMapName() Get the name of the map.
GetPhysAngVelocity Vector GetPhysAngVelocity(handle) Gets physics angular velocity for the given VPhysics object
GetPhysVelocity Vector GetPhysVelocity(handle) Gets physics velocity for the given VPhysics object
GuessDamageForce void GuessDamageForce(handle, Vector, Vector, float) Try and guess the physics force to use.
ImpulseScale float ImpulseScale(float, float) Returns an impulse scale required to push an object.
InsertAISound void InsertAISound(int, Vector, int, float, handle, int, handle) Inserts an AI sound.
IntervalPerTick float IntervalPerTick() Simulation tick interval
IsClient bool IsClient() Returns true if the script is being run on the client.
IsDedicatedServer bool IsDedicatedServer() Is this a dedicated server?
IsLinux bool IsLinux() Returns true if the game is being run on a Linux machine.
IsOSX bool IsOSX() Returns true if the game is being run on an OSX machine.
IsPosix bool IsPosix() Returns true if the game is being run on a Posix machine.
IsServer bool IsServer() Returns true if the script is being run on the server.
IsWindows bool IsWindows() Returns true if the game is being run on a Windows machine.
KeyValuesToFile bool KeyValuesToFile(string, handle) Stores the CScriptKeyValues into the file
Lerp float Lerp(float, float, float)
ListenToGameEvent int ListenToGameEvent(string, handle, string) Register as a listener for a game event from script.
Matcher_Match bool Matcher_Match(string, string) Compares a string to a query using Mapbase's matcher system, supporting wildcards, RS matchers, etc.
Matcher_NamesMatch bool Matcher_NamesMatch(string, string) Compares a string to a query using Mapbase's matcher system using wildcards only.
MatricesAreEqual void MatricesAreEqual(handle, handle) Checks if two matrices are equal.
MatrixAngles void MatrixAngles(handle, Vector, Vector) Gets the angles and position of a matrix.
MatrixCopy void MatrixCopy(handle, handle) Copies a matrix to another matrix.
MatrixGetColumn Vector MatrixGetColumn(handle, int) Gets the column of a matrix.
MatrixGetTranslation Vector MatrixGetTranslation(handle) Gets a matrix's translation.
MatrixInvert void MatrixInvert(handle, handle) Inverts a matrix and copies the result to another matrix.
MatrixQuaternion void MatrixQuaternion(handle, handle) Converts a matrix to a quaternion.
MatrixScaleBy void MatrixScaleBy(float, handle) Scales a matrix.
MatrixScaleByZero void MatrixScaleByZero(handle) Scales a matrix by zero.
MatrixSetColumn void MatrixSetColumn(Vector, int, handle) Sets the column of a matrix.
MatrixSetTranslation void MatrixSetTranslation(Vector, handle) Sets a matrix's translation.
MaxPlayers int MaxPlayers() Get the maximum number of players allowed on this server
MegaPhyscannonActive bool MegaPhyscannonActive() Checks if supercharged gravity gun mode is enabled.
Msg void Msg(string)
NPrint void NPrint(int, string) Notification print
NXPrint void NXPrint(int, int, int, int, bool, float, string) Notification print, customised
PrecacheEntityFromTable void PrecacheEntityFromTable(string, handle) Precache an entity from KeyValues in a table.
PrecacheMaterial void PrecacheMaterial(string) Precaches a material for later usage.
PrecacheModel int PrecacheModel(string, bool) Precaches a model for later usage.
PrecacheOther void PrecacheOther(string, string) Precaches an entity class for later usage.
PrecacheParticleSystem void PrecacheParticleSystem(string) Precaches a particle system for later usage.
PredictedPosition Vector PredictedPosition(handle, float) Predicts what an entity's position will be in a given amount of time.
QuaternionAdd void QuaternionAdd(handle, handle, handle) Adds two quaternions together into another quaternion.
QuaternionAngles Vector QuaternionAngles(handle) Converts a quaternion to angles.
QuaternionMatrix void QuaternionMatrix(handle, handle) Converts a quaternion to a matrix.
RandomFloat float RandomFloat(float, float) Generate a random floating point number within a range, inclusive.
RandomInt int RandomInt(int, int) Generate a random integer within a range, inclusive.
RegisterActivityConstants void RegisterActivityConstants() Registers all activity IDs as usable constants.
RemapVal float RemapVal(float, float, float, float, float)
RemapValClamped float RemapValClamped(float, float, float, float, float)
RestoreTable void RestoreTable(string, handle) Retrieves a table from storage. Write into input table.
SaveEntityKVToTable void SaveEntityKVToTable(handle, handle) Saves an entity's keyvalues to a table.
SaveTable void SaveTable(string, handle) Store a table with primitive values that will persist across level transitions and save loads.
SendToConsole void SendToConsole(string) Send a string to the console as a command
SendToConsoleServer void SendToConsoleServer(string) Send a string to the server console as a command
SetIdentityMatrix void SetIdentityMatrix(handle) Turns a matrix into an identity matrix.
SetPhysVelocity void SetPhysVelocity(handle, Vector, Vector) Sets physics velocity for the given VPhysics object
SetScaleMatrix void SetScaleMatrix(float, float, float, handle) Builds a scale matrix.
ShowMessage void ShowMessage(string) Print a hud message on all clients
SimpleSpline float SimpleSpline(float)
SimpleSplineRemapVal float SimpleSplineRemapVal(float, float, float, float, float) remaps a value in [startInterval, startInterval+rangeInterval] from linear to spline using SimpleSpline
SimpleSplineRemapValClamped float SimpleSplineRemapValClamped(float, float, float, float, float) remaps a value in [startInterval, startInterval+rangeInterval] from linear to spline using SimpleSpline
SmoothCurve float SmoothCurve(float) SmoothCurve maps a 0-1 value into another 0-1 value based on a cosine wave
SmoothCurve_Tweak float SmoothCurve_Tweak(float, float, float) SmoothCurve peaks at flPeakPos, flPeakSharpness controls the sharpness of the peak
SpawnEntityFromKeyValues handle SpawnEntityFromKeyValues(string, handle) Spawns an entity with the keyvalues in a CScriptKeyValues handle.
SpawnEntityFromTable handle SpawnEntityFromTable(string, handle) Native function for entity spawning.
StopListeningToAllGameEvents void StopListeningToAllGameEvents(string) Stop listening to all game events within a specific context.
StopListeningToGameEvent bool StopListeningToGameEvent(int) Stop the specified event listener.
StringToFile bool StringToFile(string, string) Stores the string into the file
Time float Time() Get the current server time
TraceHullComplex handle TraceHullComplex(Vector, Vector, Vector, Vector, handle, int, int) Takes 2 points, min/max hull bounds, an ent to ignore, a trace mask, and a collision group to trace to a point using a hull. Returns a handle which can access all trace info.
TraceLine float TraceLine(Vector, Vector, handle) given 2 points & ent to ignore, return fraction along line that hits world or models
TraceLineComplex handle TraceLineComplex(Vector, Vector, handle, int, int) Complex version of TraceLine which takes 2 points, an ent to ignore, a trace mask, and a collision group. Returns a handle which can access all trace info.
UniqueString null Generate a string guaranteed to be unique across the life of the script VM, with an optional root string. Useful for adding data to tables when not sure what keys are already in use in that table.
VectorAngles Vector VectorAngles(Vector) Turns a direction vector into an angle.
VectorIRotate Vector VectorIRotate(Vector, handle) Rotates a vector with the inverse of a matrix.
VectorITransform Vector VectorITransform(Vector, handle) Transforms a vector with the inverse of a matrix.
VectorRotate Vector VectorRotate(Vector, handle) Rotates a vector with a matrix.
VectorTransform Vector VectorTransform(Vector, handle) Transforms a vector with a matrix.
clamp float clamp(float, float, float)
max float max(float, float)
min float min(float, float)
printc void printc(int, int, int, string) Version of print() which takes a color before the message.
printcl void printcl(int, int, int, string) Version of printl() which takes a color before the message.

See also