Entities¶
There are different Classes for Server and Client. Classes that start with C_
are exclusive to the Client VM and classes that only have the C
Prefix are only usable in the Server VM.
Most entries have three sub entries: The class available to the SERVER, the CLIENT and methods that are available on both VMs.
For a graphic reprasentation of the Server and Client class inheritance, refer to this chart
Note
Pay attention to the extends
keyword for each class! You can use every property of that the parent class has access to!
This List of Classes and their Methods is incomplete!
CBaseEntity / C_BaseEntity¶
Basic entity that most other entities inherit from.
Shared¶
CBaseEntity / C_BaseEntity
void Hide()
Hides the ent. (invisible)
void Show()
Shows the ent. (visible)
void Destroy()
Destroys this entity.
void Signal( string signal )
:doc:../../native/async
Signals on this entity
void EndSignal( string signal )
Ends this thread when the identifier is signaled on this entity
void WaitSignal( string signal )
Halts this thread until a signal is activated for this entity
void ConnectOutput( string event, void functionref( entity trigger, entity activator, entity caller, var value ) callback )
Executes the callback function when the signal is fired.
void DisconnectOutput( string event, void functionref( entity trigger, entity activator, entity caller, var value ) callback )
Disconnects the callback from the signal.
void AddOutput( string outputName, string | entity target, string inputName, string parameter = "", float delay = 0, float maxFires = 0 )
Connects an output on this entity to an input on another entity via code. The target
can be a name or a named entity.
vector GetOrigin()
Returns the Coordinates of this entity
vector EyeAngles()
Returns the direction this entity is facing to
vector EyePosition()
Returns the position of this entities eyes
entity GetOwner()
Returns the owner of this entity. Set the owner with SetOwner
entity GetBossPlayer()
void SetBossPlayer( entity boss )
string GetClassName()
Internal class name of the parent class. May return the identifier name for some classes
bool IsNPC()
Returns true
if this entity is an NPC
bool IsTitan()
Returns true
if this entity is a Titan
bool IsHuman()
Returns true if this entity is a gameplay-wise a human.
For example, returns true
if the entity is a grunt but false
if the entity is a Titan or spectre etc.
However, players will always be Human, even when they are spectating or their playermodel is robotic (for example when playing as stim)
bool IsMechanical()
Returns true
if this entity is mechanical. Examples are Titans and spectres
Note
This returns true
for players that are playing mechanical classes
bool IsPhaseShifted()
Returns true
if this entity is currently phase shifting
bool IsPlayer()
Returns true
if this entity is a player
bool IsProjectile()
Returns true
if this entity is a projectile
asset GetModelName()
Returns the asset this entity is being rendered with
void SetParent( entity parent, ..., string type = "" )
Binds this entity to the parent. The child inherits the position and rotation of the parent
void ClearParent( entity parent )
Make this entity independent from its parent
entity GetParent()
Returns this entities parent
void SetValueForModelKey( asset model )
Set the model of this entity.
void SetValueForEffectNameKey( asset effect )
Similar to SetValueForModelKey
but for FX.
table CreateTableFromModelKeyValues()
int GetArmorType()
Returns 0
for light armor and 1
for heavy armor
Titans use heavy armor while pilots and similar use light armor
int GetMaxHealth()
Returns the max health of this entity
int GetHealth()
Returns the current health
int GetShieldHealth()
Returns the current shield health
int GetShieldHealthMax()
Returns the maximum shield health of this entity
bool HasGibModel()
Returns true
if this entity has gib models
bool HasKey( string key )
bool IsMarkedForDeletion()
void SetOrigin( vector position )
Set the position of this entity
string GetTargetName()
int GetTeam()
Returns the team of this entity
vector GetAngles()
Returns the rotation of this entity
void SetAngles( vector angle)
Set the rotation of this entity
var GetValueForKey( string key )
var Get( string key )
The same as GetValueForKey
void SetValueForKey( var key, var val )
var Set( string key )
The same as SetValueForKey
vector GetVelocity()
Returns the velocity of this entity
void Kill_Deprecated_UseDestroyInstead()
Kill this entity: this function is deprecated because it has a one-frame delay; instead, call ent.Destroy()
vector GetBoundingMaxs()
vector GetBoundingMins()
bool IsInvulnerable()
returns true
if this entity is invulnerable
vector GetWorldSpaceCenter()
int Highlight_GetCurrentContext()
float Highlight_GetCurrentInsideOpacity()
float Highlight_GetCurrentOutlineOpacity()
unknown Highlight_GetInheritHighlight()
int Highlight_GetInsideFunction( int contextID )
int Highlight_GetOutlineFunction( int contextID )
float Highlight_GetOutlineRadius()
unknown Highlight_GetParam( int contextID, int parameterNum )
int Highlight_GetState( int contextID )
void Highlight_HideInside( float duration )
void Highlight_HideOutline( float duration )
bool Highlight_IsAfterPostProcess( int contextID )
bool Highlight_IsEntityVisible( int contextID )
void Highlight_SetCurrentContext( int contextID )
void Highlight_SetFunctions( int contextID, int hightlightFillID, bool entityVisible, int colorMode, float radius, int highlightID, bool afterPostProcess)
void Highlight_SetParam( int contextID, int parameterID, vector highlightColor )
void Highlight_ShowInside( float duration )
void Highlight_ShowOutline( float duration )
void Highlight_SetInheritHighlight( bool set )
void HighlightDisableForTeam( int team )
void HighlightEnableForTeam( int team )
void HighlightSetTeamBitField( int bitField )
int GetEntIndex()
Returns the index of this entity
array
entity GetLinkEnt()
void LinkToEnt( entity ent )
entity GetLinkParent()
void Code_SetTeam( int team )
Set the team for this entity
Skins based on team do not get updated. Use SetSkin
for this
bool IsCloaked()
Returns true
if this entity is cloaked
bool IsEntAlive()
Returns true
if this entity is alive
bool IsValidInternal()
Returns true
if this entity is Valid.
IsValid( ent )
is a good alternative
vector GetForwardVector()
Returns a normalized vector pointing forwards away from this entity.
vector GetRightVector()
Returns a normalized vector pointing to the right of this entity.
vector GetUpVector()
Returns a normalized vector pointing upwards from this entity.
entity constructor( unknown )
Depends on the class.
Returns a new instance of a class.
You can invoke the constructor with brackets as well, for example like this: CBaseEntity()
void SetDoDestroyCallback( bool doCallBack )
int GetLifeState()
void DisableDraw()
void EnableDraw()
void SetCanCloak( bool canCloak )
Allow or disallow this entity to cloak itself
bool GetCritsPrevented()
Returns true
if this entity can't be critted.
bool IsHologram()
Returns true
if this entity is a hologram
bool IsOnGround()
Returns true
if this entity is touching the ground
void SetModel( asset model )
Set the model this entity is being rendered with
void MarkAsNonMovingAttachment()
string GetScriptName()
Returns the script name of this entity.
void SetScriptName( string name )
Set the script name of this entity.
bool IsBreakableGlass()
Returns true
if this entity is breakable glass
bool IsWorld()
Returns `true```if this entity is the gameworld
void DispatchImpactEffects( entity ent, vector startPos, vector endPos, vector hitNormal, entity prop, int propIndex, int damageType, int impactIndex, entity orig, int impactEffectFlags )
void IsPlayerDecoy()
Returns true
if this entity is a decoy
void SetPassThroughDirection( float dir )
void SetPassThroughThickness( float thickness )
void SetTakeDamageType( int takeDamageType )
DAMAGE_NO
, DAMAGE_YES
, DAMAGE_EVENTS_ONLY
void SetPreventCrits( bool prevent )
Set if this entity takes crit damage.
void SetVelocity( vector vel )
Set the velocity of this entity.
void EnableRenderAlways()
Always render this entity
void DisableRenderAlways()
Disable always rendering this entity
entity GetParentAttachment()
void SetFadeDistance( int distance )
Sets the distance between a player and the entity at which the ent will begin to fade out.
void SetLocalOrigin( vector origin )
bool HasPusherRootParent()
void StopPhysics()
Disable all physics for this entity
void SetLocalAngles( vector angles )
void SetParentWithHitbox( entity parent, int hitGroup, bool unknown )
void RenderWithViewModels( bool renderWith )
void SetValueForTextureKey( asset texture )
asset GetValueForModelKey()
vector GetLocalAngles()
bool GetNoTarget()
void SetForceVisibleInPhaseShift( bool visible )
table GetScriptScope()
CBaseEntity¶
CBaseEntity
int SetHealth( int health )
Set current health of this entity
int SetMaxHealth( int health )
Set max health of this entity
void SetOwner( entity owner )
Set the owner of this entity
entity GetSpawner()
void Die()
Kill this entity in the game sense - all callbacks and signals get triggered
bool NotSolid()
Returns false
if this entity is solid
void MoveTo( vector pos, float moveTime, float easeIn = 0, float easeOut = 0 )
Moves this entity to pos
over the duration of moveTime
with ease in and ease out
Note
Entites that are not movers get teleported instantly
void RotateTo( vector pos, float moveTime, float easeIn = 0, float easeOut = 0 )
Rotate to the specified angles over time with ease in and ease out.
void ClearInvulnerable()
Make this entity vulnerable again
void SetInvulnerable()
Make this entity invulnerable
void SetNextThinkNow()
Trigger AI now
void SetNoTarget( bool noTarget )
void SetNoTargetSmartAmmo( bool noTarget )
void Minimap_SetClampToEdge( bool clamp )
void Minimap_SetCustomState( int state )
void Minimap_SetZOrder( int order )
void Minimap_SetAlignUpright( bool align )
void Minimap_SetObjectScale( float scale )
void SetShieldHealth( int )
void SetShieldHealthMax( int )
int GetEncodedEHandle()
void SetUsable( bool usable )
Make this entity usable
void SetUsableByGroup( string group )
Make this entity usable only for a specific group
void SetUsableRadius( float distance )
Set the radius in which this entity can be interacted with
void UnsetUsable()
Make this entity unusable
void SetUsableValue( int val )
void Solid()
Make this entity solid
void Fire( string output, string param = "", float delay = 0, entity activator = null, entity caller = null )
Fire an output on this entity, with optional parm and delay
void FireNow( string output, string param = "", float delay = 0, entity activator = null, entity caller = null )
Fire an output on this entity, with optional parm and delay (synchronous)
void DisableHibernation()
void SetSize( float width, float height )
void SetCloakFlicker( float intensity, float duration )
Trigger cloak flicker effect
void TakeDamage( int damageAmount, entity attacker_1, entity attacker_2, table { int scriptType, int damageType, int damageSourceId, vector origin, vector force } )
vector GetCenter()
void TraceAttackToTriggers( int damageAmount, entity attacker_1, entity attacker_2, table { int scriptType, int damageType, int damageSourceId, vector force }, vector startPos, vector endPos, vector direction )
void SetBlocksRadiusDamage( bool blocks )
void SetDamageNotifications( bool getNotifs )
entity NextMovePeer()
void SetNameVisibleToEnemy( bool visible )
void SetNameVisibleToFriendly( bool visible )
void SetNameVisibleToOwner( bool visible )
entity FirstMoveChild()
entity GetRootMoveParent()
void RemoveFromSpatialPartition()
void SetUsePrompts( string pc_prompt, string console_prompt)
void SetAngularVelocity( float x, float y, float z )
void MakeInvisible()
Make this entity invisible
void MakeVisible()
Make this entity visible
entity GetGroundEntity()
vector GetGroundRelativePos()
int GetPhysicsSolidMask()
void EnableAttackableByAI( int ai_priority_no_threat, int unknown, int ai_ap_flag )
Set if this entity can be attacked by AI
void SetDeathNotifications( bool notifs )
void SetTitle( string title )
void SetAbsAngles( vector angles )
void SetAbsOrigin( void origin )
void Minimap_AlwaysShow( int team, entity ent )
void RoundOriginAndAnglesToNearestNetworkValue()
void ClearBossPlayer()
Remove boss player reference from this entity.
void Minimap_DisplayDefault( int team, entity ent )
void _typeof()
Prints ent index, classname and target name of this entity to the console.
void DisableDraw()
"consider this the mega hide"
void EnableDraw()
"it's back!"
string CreateStringForFunction( function func )
this is a general purpose function that returns a string which, when executed, runs the given function on this entity.
the function must be called (or the entity deleted) at some point to avoid leaking the new slot we make in this Table.
compile with output with compilestring
C_BaseEntity¶
C_BaseEntity
string GetSignifierName()
string GetBossPlayerName()
void ForceShadowVisible( bool visible )
void clKill()
Kill this client side prop.
float Highlight_GetNearFadeDist()
void Highlight_ResetFlags()
void Highlight_SetFadeInTime( float time )
void Highlight_SetFadeOutTime( float time )
void Highlight_SetFarFadeDist( float dist )
void Highlight_SetFlag( int highlightFlag, bool enable )
void Highlight_SetLifeTime( float time )
void Highlight_SetNearFadeDist( float dist )
void Highlight_SetVisibilityType( int type )
void Highlight_StartOn()
Starts the highlight with the set configuration
void DisableRenderWithViewModelsNoZoom()
void EnableRenderWithCockpit()
void EnableRenderWithHud()
void SetAttachOffsetAngles( vector angles )
void SetAttachOffsetOrigin( vector origin )
void SetVisibleForLocalPlayer( int visible )
void InitHudElem( var key )
string GetTitleForUI()
float GetCloakFadeFactor()
int Dev_GetEncodedEHandle()
Returns the EHandle of this entity.
int Minimap_GetCustomState()
int Minimap_GetZOrder()
void DoDeathCallback( bool doCallback )
void EnableHealthChangedCallback()
void HideHUD()
Hide HUD elements
void ShowHUD()
Show HUD elements
bool IsHUDVisible()
Return true
if HUD is shown on this entity
CDynamicProp / C_DynamicProp¶
Shared¶
CDynamicProp / C_DynamicProp : extends CBaseAnimating / C_BaseAnimating
CDynamicProp¶
CDynamicProp : extends CBaseAnimating
void SetFullBodygroup( int group )
C_DynamicProp¶
C_DynamicProp : extends C_BaseAnimating
CScriptProp / C_ScriptProp¶
Shared¶
CScriptProp / C_ScriptProp : extends CDynamicProp / C_DynamicProp
void SetSmartAmmoLockType( int salt )
int GetScriptPropFlags()
CScriptProp¶
CScriptProp : extends CDynamicProp
void SetFootstepType( int type )
void SetArmorType( int armor )
void SetScriptPropFlags( int flags )
C_ScriptProp¶
CBaseCombatWeapon / C_BaseCombatWeapon¶
Shared¶
CBaseCombatWeapon / C_BaseCombatWeapon : extends CBaseAnimating / C_BaseAnimating
string GetWeaponDescription()
Returns the weapon description
CBaseCombatWeapon¶
CBaseCombatWeapon : extends CBaseAnimating
C_BaseCombatWeapon¶
C_BaseCombatWeapon : extends C_BaseAnimating
CWeaponX / C_WeaponX¶
Weapons hold by a player or that are lying on the ground are of this type.
Shared¶
CWeaponX / C_WeaponX : extends CBaseCombatWeapon / C_BaseCombatWeapon
entity GetWeaponOwner()
Returns the owner of this weapon
bool GetAllowHeadShots()
Returns true
if this weapon can deal crits
float GetMaxDamageFarDist()
Returns the max damage at the maximum travel distance
bool GetWeaponSettingBool( int setting )
Get a weapon setting
float GetWeaponSettingFloat( int setting )
Get a weapon setting
int GetWeaponSettingInt( int setting )
Get a weapon setting
vector GetAttackDirection()
vector GetAttackPosition()
int GetWeaponPrimaryAmmoCount()
Return the amount of ammo in a weapon
int GetWeaponPrimaryClipCount()
Returns the amount of clips remaining in a weapon
int GetWeaponPrimaryClipCountMax()
Returns the maximum ammo in a clip of a primary weapon
bool IsChargeWeapon()
Returns true
if this weapon is a charge weapon
void SetNextAttackAllowedTime( float time )
You need to set a game time as time.
void SetWeaponChargeFractionForced( float frac )
void SetWeaponPrimaryClipCount( int )
string GetWeaponClassName()
Returns the weapon class name
var GetWeaponInfoFileKeyField( string key )
float GetCoreDuration()
int GetWeaponType()
array
Get all mods of this weapon
bool IsWeaponOffhand()
Returns true
if this weapon is equipped as a offhand weapon
float GetWeaponChargeFraction()
Returns the percent this weapon has been charged
float GetWeaponChargeTime()
Returns the time this weapon needs to be charged
bool HasMod( string mod )
Check if the array of mods for this weapon contains mod
int GetWeaponCurrentEnergyCost()
Returns the amount of energy consumed per use.
bool GetMeleeCanHitHumanSized()
bool GetMeleeCanHitTitans()
void DoMeleeHitConfirmation( float severityScale )
void EmitWeaponNpcSound_DontUpdateLastFiredTime( int volume, float time )
int GetDamageAmountForArmorType( int armor )
float GetMeleeAttackRange()
float GetMeleeLungeTargetRange()
void SetMods( array
Set the mods this weapon.
void EmitWeaponNpcSound( int volume, float duration )
int GetWeaponDamageFlags()
Returns a bitflag of damage types this weapon has.
bool SmartAmmo_IsEnabled( bool enabled )
int SmartAmmo_GetNumTrackersOnEntity( entity target )
array
bool SmartAmmo_IsVisibleTarget( entity trackedEnt )
string GetWeaponClass()
void SetWeaponSkin( int skin )
entity FireWeaponGrenade( vector attackPos, vector throwVelocity, vector angularVelocity, float fuseTime, int contactDamageType, int explosionDamageType, bool isPredicted, bool isLagCompensated, bool bounce? )
int GetScriptFlags0()
Returns script flags of this weapon.
bool ShouldPredictProjectiles()
Returns true
if clients should be predicting the projectiles fired from this weapon.
float GetScriptTime0()
Returns the script time of this weapon.
void SetScriptTime0( float gameTime )
gameTime
needs to be game time. The current game time can be retrieved with Time()
bool IsReloading()
Returns true
if this weapon is currently being reloaded.
void SetForcedADS()
Force the holder to ADS this weapon.
void ClearForcedADS()
Allow the holder to hipfire.
void EmitWeaponSound_1p3p(string sound1P, string sound3P)
int GetChargeAnimIndex()
void PlayWeaponEffectNoCull(asset effect1P, asset effect3P, string tagName)
void RegenerateAmmoReset()
void SetChargeAnimIndex( int index )
void SetWeaponPrimaryAmmoCount( int count )
Set the ammo of a primary weapon.
void StopWeaponEffect(asset effect1P, asset effect3P)
Stops the effects.
int GetReloadMilestoneIndex()
Reload progress. Reloading continues from there.
int GetAmmoPerShot()
Returns the amount of ammo that is being used per shot.
bool IsBurstFireInProgress()
void PlayWeaponEffect(asset effect1P, asset effect3P, string tagName)
void StopWeaponSound(string sound)
float GetSustainedDischargeDuration()
void SetSustainedDischargeFractionForced(float frac)
entity FireWeaponMissile(vector origin, vector dir, float missileSpeed, int contactDamageType, int explosionDamageType, bool doPopup, bool predict)
int GetBurstFireShotsPending()
bool AllowUse()
Allow entities to use the weapon.
void RemoveMod( string mod )
Remove the passed mod from this weapon.
array
void SmartAmmo_TrackEntity(entity hitEnt, LMG_SMART_AMMO_TRACKER_TIME)
void EmitWeaponSound( string sound )
Play a sound on this weapon.
float GetWeaponChargeLevel()
void SetWeaponBurstFireCount(int amount)
int GetCurrentAltFireIndex()
void ForceRelease()
float SetWeaponChargeFraction()
int GetProjectilesPerShot()
entity FireWeaponBolt(vector origin, vector dir, float projectileSpeed, int contactDamageType, int explosionDamageType, bool predict, int index)
bool IsWeaponInAds()
Returns true
if this weapon is in ADS.
void ResetWeaponToDefaultEnergyCost()
Reset the amount of energy consumed per use
void SetWeaponEnergyCost( int cost )
Set the amount of energy consumed per use.
entity FireWeaponBullet( vector origin, vector dir, int numBullets, damageType )
Fires a hitscan bullet from this weapon.
bool IsWeaponAdsButtonPressed()
Returns true
while the ADS button is pressed.
float GetWeaponChargeLevelMax()
bool IsReadyToFire()
Returns true
if the weapon can be fired.
void SetAttackKickRollScale(float scale)
int GetShotCount()
void AddMod( string mod )
Add a mod to this weapon
void FireWeaponBullet_Special(vector origin, vector direction, int numShots, int damageType, bool noAntilag, bool noSpread, bool onlyDamageEntitiesOnce, bool noImpactFX, bool noTracers, bool activeShot, bool doTraceBrushOnly)
string GetWeaponSettingString( string setting )
void SmartAmmo_UntrackEntity( entity target )
string GetSmartAmmoWeaponType()
Check if weaponType is valid: Assert( weaponType in VALID_WEAPON_TYPES )
int GetWeaponBurstFireCount()
void SmartAmmo_Clear( bool unknown_purpose, bool clearPartialLocks )
vector SmartAmmo_GetFirePosition( entity target, int burstIndex )
array
void SmartAmmo_StoreTargets()
bool IsSustainedDischargeWeapon()
int GetDamageSourceID()
float GetGrenadeFuseTime()
Note that fuse time of 0 means the grenade won't explode on its own, instead it depends on OnProjectileCollision() functions to be defined and explode there.
void SetWeaponPrimaryClipCountAbsolute(int clipsize)
entity GetWeaponUtilityEntity()
bool IsForceRelease()
bool IsWeaponRegenDraining()
void SetWeaponPrimaryClipCountNoRegenReset(int clipsize)
CWeaponX¶
CWeaponX : extends CBaseCombatWeapon
void SetWeaponUtilityEntity( entity ent )
void ForceDryfireEvent()
Force this weapon to dry fire
void PlayWeaponEffectOnOwner( asset effect, int bodypart )
Play an effect on the weapon owner
void ForceReleaseFromServer()
Will eventually result in Grenade_OnWeaponToss_()
or equivalent function
bool IsForceReleaseFromServer()
returns true
if this weapon has been forced to be released
C_WeaponX¶
C_WeaponX : extends C_BaseCombatWeapon
void PlayWeaponEffectReturnViewEffectHandle( asset fpEffect, asset unknown_purpose, string tag )
the second asset is probably the third person effect played.
void SetViewmodelAmmoModelIndex( int index )
index
may be the number of rounds in the clip etc.
CProjectile / C_Projectile¶
Projectiles.
Shared¶
CProjectile / C_Projectile : extends CDynamicProp / C_DynamicProp
bool GetProjectileWeaponSettingBool( string setting )
float GetProjectileWeaponSettingFloat( string setting )
int GetProjectileWeaponSettingInt( string setting )
string ProjectileGetWeaponClassName()
void SetImpactEffectTable( string fxTableHandle )
array
Returns an array of every mod this projectile has equipped
void SetProjectilTrailEffectIndex( int index )
Set the projectile trail by index
void SetProjectileLifetime( float lifetime )
Set the time after which this projectile gets destroyed programmatically
string ProjectileGetWeaponInfoFileKeyField( string key )
void SetReducedEffects()
Only use reduced effects for this projectile
asset GetProjectileWeaponSettingAsset( string setting )
void SetVortexRefired( bool refired )
Tells the code that the projectile was refired from the vortex so that it uses "projectile_vortex_vscript"
float GetProjectileCreationTime()
Get the gametime when this projectile has been created
asset ProjectileGetWeaponInfoFileKeyFieldAsset( string key )
CProjectile¶
CProjectile : extends CDynamicProp
int ProjectileGetDamageSourceID()
void ProjectileSetDamageSourceID( int id )
void SetWeaponClassName( string name )
void SetProjectileImpactDamageOverride( int flag )
C_Projectile¶
C_Projectile : extends C_DynamicProp
CBaseGrenade / C_BaseGrenade¶
Grenade entities in worldspace. Grenades that are equipped ("cooked") by players are instances from the CWeaponX class.
Shared¶
CBaseGrenade / C_BaseGrenade : extends CProjectile / C_Projectile
float GetDamageRadius()
Get the damage radius
float GetExplosionRadius()
Get the explosion radius
void GrenadeExplode( vector normal )
Explode this grenade now
entity GetThrower()
Get the entity that has thrown this grenade
bool GrenadeHasIgnited()
Returns true
if this grenade has already been ignited
void GrenadeIgnite()
void SetDoesExplode( bool explodes )
void InitMagnetic( float force, string attractKey )
void ExplodeForCollisionCallback( vector normal )
void MarkAsAttached()
CBaseGrenade¶
CBaseGrenade : extends CProjectile
void SetGrenadeTimer( float fuseTime )
Set fuse time for this grenade
void SetGrenadeIgnitionDuration( float fuseTime )
Set the ignition duration for this grenade
C_BaseGrenade¶
C_BaseGrenade : extends C_Projectile
CMissile / C_Missile¶
Shared¶
CMissile / C_Missile : extends CProjectile / C_Projectile
void MissileExplode()
Make this missile explode now
void InitMissileForRandomDriftFromWeaponSettings( vector pos, vector dir )
void SetHomingSpeeds( int speed, int speed_for_dodging_player )
void SetMissileTarget( enity target, vector offset )
void SetMissileTargetPosition( vector pos )
void InitMissileSpiral( vector pos, vector dir, int missileNumber, bool unknown_purpose1, bool unknown_purpose2 )
If both slowAndExpand
and consistentSpacing
are true, missiles fly faster instead of normal slowAndExpand
behavior.
void SetSpeed( float speed )
entity GetMissileTarget()
void InitMissileExpandContract( vector outward, vector inward, float launchOutTime, float launchInLerpTime, float launchInTime, float launchStraightLerpTime, vector missileEndPos, bool applyRandSpread )
void InitMissileForRandomDrift( vector pos, vector dir )
CMissile¶
CMissile : extends CProjectile
C_Missile¶
C_Missile : extends C_Projectile
CPlayer / C_Player¶
Shared¶
CPlayer / C_Player : extends CBaseCombatCharacter / C_BaseCombatCharacter
int GetGen()
Returns the gen of the player account.
int GetLevel()
Returns the level of the player account.
int GetXP()
Returns the xp of the player account.
entity GetFirstPersonProxy()
string GetPlayerClass()
void Lunge_ClearTarget()
bool Lunge_IsActive()
Returns true
if the player is currently lunging to a melee victim.
bool GetForcedDialogueOnly()
float GetLastPingTime()
int GetNumPingsAvailable()
int GetPingGroupAccumulator()
float GetPingGroupStartTime()
void SetLastPingTime( float time)
void SetNumPingsAvailable( int num )
void SetNumPingsUsed( int num )
void SetPingGroupAccumulator( int acc )
void SetPingGroupStartTime( float gametime )
string GetPlayerName()
Returns the player account name
int GetPlayerGameStat( int PGS )
Returns the score of the player in the provided category. some categories are: PGS_KILLS, PGS_DEATHS, PGS_SCORE etc.
entity GetPetTitan()
Returns the soul of the player's autotitan.
bool GetTitanDisembarkEnabled()
bool GetTitanEmbarkEnabled()
bool IsBot()
void SetTitanDisembarkEnabled( bool enabled )
void SetTitanEmbarkEnabled( bool enabled )
string GetPlayerSettings()
int GetActiveBurnCardIndex()
Returns the index of the selected burn card.
int Code_GetActiveBurnCardIndex()
Use GetActiveBurnCardIndex
instead
string GetPlayerSettingsField( string field )
int GetCinematicEventFlags()
entity GetObserverTarget()
vector GetViewRight()
vector GetViewVector()
vector GetViewForward()
vector GetViewUp()
int GetPersistentVarAsInt( string key )
entity GetViewModelEntity()
int GetOutOfBoundsDeadTime()
entity GetTitanSoulBeingRodeoed()
vector CameraAngles()
Returns the angles of this player's camera.
float GetObjectiveEndTime()
entity GetObjectiveEntity()
int GetObjectiveIndex()
entity GetPredictedFirstPersonProxy()
int GetPetTitanMode()
bool IsWallHanging()
Returns true
if the player is wall hanging.
float GetNextTitanRespawnAvailable()
var GetPersistentVar( string key )
bool HasBadReputation()
int GetObserverMode()
float GetPlayerModHealth()
bool IsInputCommandHeld( int flag )
int GetPlayerNetInt( string state )
float GetPlayerNetFloat( string state )
entity GetHardpointEntity()
bool GetPlayerNetBool( string key )
bool IsCrouched()
Returns true
if the player is crouching.
bool IsStanding()
Returns true
if the player is standing
void IsTraversing()
void IsWallRunning()
Returns true
if the player is wallrunning.
bool IsZiplining()
Returns true
if the player is currently attached to a zipline
vector Lunge_GetStartPositionOffset()
void Lunge_SetTargetEntity( entity target, bool unknown_purpose )
int PlayerMelee_GetState()
bool PlayerMelee_IsAttackActive()
void PlayerMelee_SetState( int state )
void Lunge_EnableFlying()
vector Lunge_GetEndPositionOffset()
bool Lunge_IsGroundExecute()
bool Lunge_IsLungingToEntity()
void Lunge_LockPitch( bool lock )
void Lunge_SetEndPositionOffset( vector offset )
void Lunge_SetTargetPosition( vector pos )
void PlayerMelee_EndAttack()
entity PlayerMelee_GetAttackHitEntity()
void PlayerMelee_SetAttackHitEntity( entity ent )
void PlayerMelee_SetAttackRecoveryShouldBeQuick( bool beQuick )
void PlayerMelee_StartAttack( int attackState )
void SetSelectedOffhandToMelee()
void Weapon_StartCustomActivity( string animation, bool unknown_purpose )
float GetPlayerNetTime( string key )
vector CameraPosition()
Returns the camera position of this player.
entity GetPlayerNetEnt( string key )
bool HasPassive( int passive )
void Lunge_SetSmoothTime( float time )
float SmartAmmo_GetHighestLockOnMeFraction()
array
float SmartAmmo_GetPreviousHighestLockOnMeFraction()
void Grapple( vector direction )
bool MayGrapple()
int GetSuitGrapplePower()
void SetSuitGrapplePower( float power )
array
void ClearMeleeDisabled()
void SetMeleeDisabled()
void RumbleEffect( int x, int y, int z )
float GetInputAxisForward()
Y Axis
float GetInputAxisRight()
X Axis
int GetDodgePower()
void HolsterWeapon()
Holsters this weapon. The player can't use it until it's deployed again with DeployWeapon
void DeployWeapon()
May not work with DeployAndEnableWeapons()
and HolsterAndDisableWeapons()
float GetZoomFrac()
Returns the fractal of the current weapon zoom. 1.0 is fully zoomed in.
entity GetRemoteTurret()
CPlayer¶
CPlayer : extends CBaseCombatCharacter
void CockpitStartDisembark()
void NotifyDidDamage( entity damagedEnt, int hitbox, vector damagePosition, int customDamageType, float damage, int damageFlags, int hitGroup, entity weapon, float distanceFromAttackOrigin )
void Server_SetDodgePower( float dodgePower )
void SetDodgePowerDelayScale( float delay )
void SetPowerRegenRateScale( float scale )
void SetPersistentVar( string key, var val )
void ForceStand()
Force this player to stand up
void UnforceStand()
Allow crouching
void SetPlayerNetBool( string key, bool val )
void Anim_StopGesture( int gesture )
void PlayerCone_Disable()
void PlayerCone_FromAnim()
void PlayerCone_SetLerpTime( float time )
void PlayerCone_SetMaxPitch( int maxPitch )
void PlayerCone_SetMaxYaw( int maxYaw )
void PlayerCone_SetMinPitch( int min )
void PlayerCone_SetMinYaw( int min )
entity CreateAnimatedPlayerDecoy( string decoyType )
Decoy Types: pt_mp_execution_attacker_hologram_01
, pt_mp_execution_attacker_hologram_02
, pt_mp_execution_attacker_hologram_03
void StopObserverMode()
void CockpitStartEject()
void FreezeControlsOnServer()
void UnfreezeControlsOnServer()
void CockpitStartBoot()
void SetStaggering()
void ForceCrouch()
Force this player to crouch.
void UnforceCrouch()
Allow this player to stand.
bool IsNoclipping()
Returns true
if noclip is enabled.
void SetCinematicEventFlags( int flag )
void SetSyncedEntity( entity synced )
void SnapEyeAngles( vector angles )
void SnapFeetToEyes()
void TouchGround()
Allows the player to double jump again.
void ViewOffsetEntity_Clear()
entity CreatePlayerDecoy( float stickPercentToRun )
void SetPlayerSettingsWithMods( string settings, array
void Server_TurnOffhandWeaponsDisabledOff()
void Server_TurnOffhandWeaponsDisabledOn()
void SetPlayerNetInt( string key, int val )
void Anim_PlayGesture( string anim3p, float unknown_purpose, float unknown_purpose1, float unknown_purpose2 )
void Server_TurnDodgeDisabledOff()
void Server_TurnDodgeDisabledOn()
void SetGroundFrictionScale( int scale )
void PlayerCone_SetSpecific( vector viewAngles )
void GiveExtraWeaponMod( string mod )
C_Player¶
C_Player : extends C_BaseCombatCharacter
void ClientCommand( string command )
Executes a command on the player's client. For a server to execute a console command on a client, the client has to launch the game with the norestrictservercommands
launch argument for security reasons.
entity GetCockpit()
string GetBodyType()
float GetAdsFraction()
bool IsInThirdPersonReplay()
float GetHotDropImpactTime( entity titan = this.titan, string animation = HOTDROP_TURBO_ANIM )
If called without paramets returns time for the player's titan drop.
string GetPlayerNameWithClanTag()
bool HasMic()
bool InPartyChat()
bool IsMuted()
bool IsPartyLeader()
bool IsTalking()
void CockpitJolt( vector joltDir, float severity )
play a jolt effect on the player
void SetScriptMenuOff()
void SetScriptMenuOn()
EntityScreenSpaceBounds GetEntScreenSpaceBounds( entity ent, int padding )
void HideCrosshairNames()
Disable showing crosshair names of entities when aiming at them.
void UnhideCrosshairNames()
Enable showing crosshair names of entities when aiming at them. (default)
void FreezeControlsOnClient()
Stop player input.
void Rodeo_StartCameraSmoothing( float factor )
void Rodeo_StopCameraSmoothing( float factor )
void StartArcCannon()
void StopArcCannon()
CTitanSoul / C_TitanSoul¶
Shared¶
CTitanSoul / C_TitanSoul : extends CBaseEntity / C_BaseEntity
entity GetTitan()
bool HasValidTitan()
bool IsDoomed()
Returns true
if this soul is in doomed state
float GetTitanSoulNetFloat( string key )
entity GetInvalidHealthBarEnt()
Returns an instance of CNPC_Titan
int GetTitanSoulNetInt( string key )
float GetLastRodeoHitTime()
bool IsEjecting()
int GetStance()
int GetPlayerSettingsNum()
float GetCoreChargeExpireTime()
float GetCoreChargeStartTime()
float GetNextCoreChargeAvailable()
CTitanSoul¶
CTitanSoul : extends CBaseEntity
void SetEjecting( bool ejecting )
void SetPlayerSettingsNum( int enum )
void SetStance( int stance )
void SoulDestroy()
void SetCoreChargeExpireTime( float gametime )
void SetTitanSoulNetFloat( string key, float val )
void SetTitanSoulNetFloatOverTime( string key, float val, float time )
float GetCoreUseDuration()
void SetTitanSoulNetInt( string key, int val )
void SetLastRodeoHitTime( float gametime )
void SetCoreChargeStartTime( float gametime )
void SetCoreUseDuration( float duration )
void SetNextCoreChargeAvailable( float time )
C_TitanSoul¶
C_TitanSoul : extends C_BaseEntity
CBaseCombatCharacter / C_BaseCombatCharacter¶
Shared¶
CBaseCombatCharacter / C_BaseCombatCharacter : extends CBaseAnimating / C_BaseAnimating
entity GetTitanSoul()
void ContextAction_ClearBusy()
bool ContextAction_IsActive()
bool ContextAction_IsBusy()
void ContextAction_SetBusy()
vector Anim_GetStartForRefEntity_Old( string anim, vector reference, string optionalTag )
array
entity GetOffhandWeapon( int slot )
entity GetActiveWeapon()
entity GetLatestPrimaryWeapon()
int GetSkin()
int LookupSequence( string sequence )
void SetSkin( int skin )
entity GetAntiTitanWeapon()
AnimRefPoint Anim_GetStartForRefPoint( string anim, vector origin, vector angles )
vector GetPlayerOrNPCViewVector()
vector Anim_GetStartForRefPoint_Old( animation, origin, angles )
void Anim_PlayWithRefPoint( string animation, vector origin, vector angles, float blendTime )
bool IsWeaponDisabled()
int GetActiveWeaponPrimaryAmmoLoaded()
bool ContextAction_IsMeleeExecution()
int GetWeaponAmmoStockpile( entity weapon )
entity GetMeleeWeapon()
bool ContextAction_IsMeleeExecutionTarget()
entity GetFirstRodeoRider()
Returns the first rodeo rider found or null if there are none.
int GetNumRodeoSlots()
Returns number of rodeo slots available on this entity.
entity GetRodeoRider()
Returns rodeo rider (if there is one) at the given slot.
void PhaseShiftBegin( float warmUpTime, float duration )
void PhaseShiftCancel()
vector OffsetPositionFromView( vector startPos, vector offset )
int GetWeaponAmmoLoaded( entity weapon )
int GetWeaponAmmoMaxLoaded( entity weapon )
float GetAttackSpreadAngle()
array
bool ContextAction_IsLeeching()
void DisablePhaseShiftFlags()
void EnablePhaseShiftFlags()
entity GetEntityAtPhaseShiftExitPosition()
float PhaseShiftTimeRemaining()
bool CanUseSharedEnergy( int curCost )
bool CanUseSharedEnergy( int curCost )
void AddSharedEnergy( int amount )
int GetSharedEnergyTotal()
int GetSharedEnergyCount()
void SetSharedEnergyRegenDelay( float delay )
void TakeSharedEnergy( int amount )
CBaseCombatCharacter¶
CBaseCombatCharacter : extends CBaseAnimating
void SetFullBodygroup( int group )
void GetSettingsHeadshotFX()
Looks for "headshotFX" in an AI settings file or a player set file
void GiveOffhandWeapon( string ordnanceName, int slot, array
void GiveWeapon( string weapon )
void SetActiveWeaponByName( string weapon )
void TakeOffhandWeapon( int slot )
void TakeWeaponNow( string weapon )
void TakeWeapon( string weapon )
int GetOutOfBoundsDeadTime()
void SetNumRodeoSlots( int )
Sets the maximum number of rodeo slots available on this entity.
void SetRodeoRider( int slot, entity rider )
Sets the rodeo rider at the given slot
void SetNPCPriorityOverride_NoThreat()
void SetTitanSoul( entity soul )
vector GetPlayerOrNPCViewRight()
void ResetHealthChangeRate()
C_BaseCombatCharacter¶
C_BaseCombatCharacter : extends C_BaseAnimating
TraceResults TraceToLocalPlayer()
float TraceToLocalPlayerSimple()
CAI_BaseNPC / C_AI_BaseNPC¶
Shared¶
CAI_BaseNPC / C_AI_BaseNPC : extends CBaseCombatCharacter
var Dev_GetAISettingByKeyField( string key )
Expect as string
bool IsInterruptable()
int GetAIClass()
AIC_SMALL_TURRET
, AIC_MARVIN
, AIC_SPECTRE
, AIC_STALKER_CRAWLING
, AIC_FRAG_DRONE
, AIC_HUMAN
string GetBodyType()
string GetAISettingsName()
int GetMeleeDamageMaxForTarget( entity target )
float AISetting_MaxFlyingSpeed()
get the current flying speed of the npc.
string AISetting_LeechAnimSet()
string AISetting_LeechDataKnifeTag()
CAI_BaseNPC¶
CAI_BaseNPC : extends C_BaseCombatCharacter
void AssaultPoint( vector point )
void EnableBehavior( string behaviour )
void DisableBehavior( string behaviour )
Possible behaviours: Follow
, Assault
void SetThinkEveryFrame( bool think )
void ClearEnemy( entity enemy )
Clears the enemy of this npc.
void SetEnemy( entity enemy )
Sets the enemy this npc will attack.
void Anim_ScriptedPlay( string anim )
void ForceCheckGroundEntity()
string GetNPCState()
float GetMaxEnemyDist()
Max pilot engagement distance
float GetMaxEnemyDistHeavyArmor()
Max titan engagement distance
float GetMaxTurretYaw()
void SetSecondaryEnemy( entity enemy )
void DisableNPCMoveFlag( int flag )
void EnableNPCMoveFlag( int flag )
void SetAISettings( string settings )
void SetCapabilityFlag( int flag, bool active )
Sets if a capability is available to the player
void Anim_ScriptedPlayActivityByName( string activity, bool unknown_purpose1, float unknown_purpose2 )
entity GetEnemy()
bool CanSee( entity ent )
Returns true
if the npc can see the ent
.
bool IsCrouching()
bool IsSecondaryAttack()
entity GetFollowTarget()
void InitFollowBehavior( entity followMe, string followBehaviour )
void DisableNPCFlag( int flag )
void EnableNPCFlag( int flag )
void Freeze()
Freezes all animations and movement of this entity.
void Unfreeze()
unfreezes all animations and movement of this entity.
bool HasXRaySupport()
Returns if this.supportsXRay
not null.
void ForceCombat()
Force into combat state by updating NPC's memory of the player.
bool InCombat()
Returns true if NPC is in combat.
C_AI_BaseNPC¶
C_AI_BaseNPC : extends C_BaseCombatCharacter
CNPC_Titan / C_NPC_Titan¶
Shared¶
CNPC_Titan / C_NPC_Titan : extends CAI_BaseNPC / C_AI_BaseNPC
bool GetCanStand()
CNPC_Titan¶
CNPC_Titan : extends CAI_BaseNPC
void SetCanStand( bool canStand )
void GrappleNPC( vector dir )
C_NPC_Titan¶
CNPC_Dropship / C_NPC_Dropship¶
Shared¶
CNPC_Dropship / C_NPC_Dropship : extends CAI_BaseNPC / C_AI_BaseNPC
bool IsJetWakeFXEnabled()
CNPC_Dropship¶
CNPC_Dropship : extends CAI_BaseNPC
C_NPC_Dropship¶
C_NPC_Dropship : extends C_AI_BaseNPC
CNPC_Drone¶
CNPC_Drone : extends CAI_BaseNPC
void SetAttackMode( bool attack )
Set to false
to not attack enemies.
CNPC_SentryTurret / C_NPC_SentryTurret
Shared¶
CNPC_SentryTurret / C_NPC_SentryTurret : extends CAI_BaseNPC / C_AI_BaseNPC
int GetTurretState()
entity GetControlPanel()
CNPC_SentryTurret¶
CNPC_SentryTurret : extends CAI_BaseNPC
void StartDeployed()
C_NPC_SentryTurret¶
C_NPC_SentryTurret : extends C_AI_BaseNPC
CFirstPersonProxy / C_FirstPersonProxy¶
Shared¶
CFirstPersonProxy / C_FirstPersonProxy : extends CBaseAnimating / C_BaseAnimating
CFirstPersonProxy¶
CFirstPersonProxy : extends CBaseAnimating
C_FirstPersonProxy¶
C_FirstPersonProxy : extends C_BaseAnimating
CBaseAnimating / C_BaseAnimating¶
Shared¶
CBaseAnimating / C_BaseAnimating : extends CBaseEntity / C_BaseEntity
vector GetAttachmentOrigin()
int LookupAttachment( string attachment )
int FindBodyGroup( string group )
int GetBodyGroupState( int bodyGroupIndex )
int GetBodyGroupModelCount( int bodyGroupIndex )
void SetBodygroup( int groupIndex, int newIndex )
vector GetAttachmentAngles()
Attachment Anim_GetAttachmentAtTime( string animation, string attachmentName, float time )
float GetScriptedAnimEventCycleFrac( string anim, string event )
float GetSequenceDuration( string anim )
bool Anim_IsActive()
void Anim_Play( string anim )
void Anim_SetInitialTime( float time )
void Anim_Stop()
vector Anim_GetStartForRefEntity_Old( string anim, vector reference, string optionalTag )
int GetSkin()
int LookupSequence( string sequence )
void SetSkin( int skin )
AnimRefPoint Anim_GetStartForRefPoint( string anim, vector origin, vector angles )
vector Anim_GetStartForRefPoint_Old( animation, origin, angles )
void Anim_PlayWithRefPoint( string animation, vector origin, vector angles, float blendTime )
void Anim_NonScriptedPlay( string animation )
bool Anim_HasSequence( string animation )
void SetPlaybackRate( float rate )
void Anim_SetStartTime( float time )
void LerpSkyScale( float skyScale, float time )
void SetPoseParameter( int pose, float offset )
vector GetAttachmentForward( int attachID )
CBaseAnimating¶
CBaseAnimating : extends CBaseEntity
int GetFullBodygroup()
void BecomeRagdoll( vector push, bool skipAnim )
void Dissolve( int dissolveID, vector normal, int unknown_purpose )
void Gib( vector forceVec )
void SetContinueAnimatingAfterRagdoll( bool cont )
void PlayRecordedAnimation( asset animation, vector unknown_purpose1, vecor unknown_purpose2, float blendTime, entity ref )
void SetRecordedAnimationPlaybackRate( float rate )
void Anim_EnablePlanting()
int LookupPoseParameterIndex( string poseParam )
void Anim_DisableUpdatePosition()
C_BaseAnimating¶
C_BaseAnimatin : extends C_BaseEntity
void SetGroundEffectTable( string tableIdentifier )
float GetAttachmentOrigin_ViewModelNoFOVAdjust( int index )
void Anim_SetPaused( bool pause )
void SetCycle( float cycle )
void DoBodyGroupChangeScriptCallback( bool doCallback, int bodygroup )
CPlayerDecoy / C_PlayerDecoy¶
Shared¶
CPlayerDecoy / C_PlayerDecoy : extends CBaseAnimating / C_BaseAnimating
CPlayerDecoy¶
CPlayerDecoy : extends CBaseAnimating
void Decoy_Dissolve()
Dissolve this decoy. You might want to clear decoy fx with CleanupFXAndSoundsForDecoy( entity decoy )
afterwards.
void SetTimeout( float duration )
Set the time after which the decoy gets automatically dissolved.
void SetDecoyRandomPulseRateMax( float pulse_amount_per_second )
void SetFriendlyFire( bool enabled )
Sets if friendly fire is enabled for this decoy.
void SetKillOnCollision( bool kill )
Sets if this decoy gets killed when colliding with props or geometry.
C_PlayerDecoy¶
CPlayerDecoy : extends CBaseAnimating
CTurret¶
CTurret : extends CBaseAnimating
void ClearDriver()
entity GetDriver()
voit SetDriver( entity driver )
C_Titan_Cockpit¶
C_Titan_Cockpit : extends C_BaseEntity
void AddToTitanHudDamageHistory( int panel, int damage )
void SetCaptureScreenBeforeViewmodels( bool cap )
float GetTimeInCockpit()
Returns the total time of time spent in this cockpit.
Cockpit booting takes 1.3 seconds, so anything less than 1.3 seconds is still playing the booting animation. You can use TitanCockpit_IsBooting( entity cockpit )
to determine this state.
void SetOpenViewmodelOffset( float x, float y, float z )
CParticleSystem¶
CParticleSystem : extends CBaseEntity
void FXEnableRenderAlways()
void SetStopType( string type )
void SetControlPointEnt( int controlPoint, entity destEnt )
CVortexSphere / C_VortexSphere¶
Shared¶
CVortexSphere / C_VortexSphere : extends CBaseEntity / C_BaseEntity
int GetBulletAbsorbedCount()
int GetProjectileAbsorbedCount()
CVortexSphere¶
CVortexSphere : extends CBaseEntity
void SetGunVortexAngles( vector angles )
void SetGunVortexAttachment( string attach )
void SetOwnerWeapon( entity owner )
void SetVortexEffect( entity fx )
void DisableVortexBlockLOS()
entity GetOwnerWeapon()
void AddBulletToSphere()
void AddProjectileToSphere()
void ClearAllBulletsFromSphere()
void RemoveBulletFromSphere()
void RemoveProjectileFromSphere()
C_VortexSphere¶
C_VortexSphere : extends C_BaseEntity
CEnvExplosion¶
CEnvExplosion : extends CBaseEntity