SteamVR/Environments/Scripting/API: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Added functions from wall clock script)
m (Setting bug notice hidetested=1 param on page where the bug might not need tested in param specified)
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This is the [[VScript]] API for [[Destinations]].
This is the [[VScript]] API for [[SteamVR/Environments|SteamVR Home]].
    
    
==='''Accessing the Scripting API from Lua'''===
===Accessing the Scripting API from Lua===


While Lua is [http://en.wikipedia.org/wiki/Dynamically_typed dynamically typed], the Source 2 engine is written primarily in C++, which is [http://en.wikipedia.org/wiki/Type_system#Static_type-checking statically typed]. Thus, you'll need to be conscious of your data types when calling the API. (If you try to pass the wrong type to an API function, you'll get an error message in Vconsole telling you what you passed and what it was expecting.)
While Lua is [http://en.wikipedia.org/wiki/Dynamically_typed dynamically typed], the Source 2 engine is written primarily in C++, which is [http://en.wikipedia.org/wiki/Type_system#Static_type-checking statically typed]. Thus, you'll need to be conscious of your data types when calling the API. (If you try to pass the wrong type to an API function, you'll get an error message in Vconsole telling you what you passed and what it was expecting.)
Line 8: Line 8:


== Global ==
== Global ==
Global functions.  These can be called without any class
 
Global functions.  These can be called without any class.
 
=== Math ===
 
{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Function  
! Function  
Line 14: Line 18:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.AngleDiff | AngleDiff]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.AngleDiff|AngleDiff]]
| <code>float AngleDiff(float ang1, float ang2) </code>
| <code>float AngleDiff(float ''ang1'', float ''ang2'') </code>
| Returns the number of degrees difference between two yaw angles
| Returns the number of degrees difference between two yaw angles
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.AppendToLogFile | AppendToLogFile]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.AxisAngleToQuaternion|AxisAngleToQuaternion]]
| <code>void AppendToLogFile(string string_1, string string_2) </code>
| <code>Quaternion AxisAngleToQuaternion(Vector ''Vector_1'', float ''float_2'') </code>
| Appends a ''string'' to a log file on the server
| (''vector'',''float'') constructs a quaternion representing a rotation by angle around the specified ''vector'' axis. {{bug|hidetested=1| The Quaternion class is non-functional}}
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.AxisAngleToQuaternion | AxisAngleToQuaternion]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.CalcClosestPointOnEntityOBB|CalcClosestPointOnEntityOBB]]
| <code>Quaternion AxisAngleToQuaternion(Vector Vector_1, float float_2) </code>
| <code>Vector CalcClosestPointOnEntityOBB(handle ''entity'', Vector ''position'') </code>
| (''vector'',''float'') constructs a quaternion representing a rotation by angle around the specified ''vector'' axis
| Compute the closest point relative to a vector on the OBB of an entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.CalcClosestPointOnEntityOBB | CalcClosestPointOnEntityOBB]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.CalcDistanceBetweenEntityOBB|CalcDistanceBetweenEntityOBB]]
| <code>Vector CalcClosestPointOnEntityOBB(handle handle_1, Vector Vector_2) </code>
| <code>float CalcDistanceBetweenEntityOBB(handle ''entity1'', handle ''entity2'') </code>
| Compute the closest point on the OBB of an entity.
| Compute the distance between two entity OBB. A negative return value indicates an input error. A return value of zero indicates that the OBBs are overlapping.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.CalcDistanceBetweenEntityOBB | CalcDistanceBetweenEntityOBB]]
| [[SteamVR/Environments/Scripting/API/Global.CrossVectors|CrossVectors]]
| <code>float CalcDistanceBetweenEntityOBB(handle handle_1, handle handle_2) </code>
| <code>Vector CrossVectors(Vector ''v1'', Vector ''v2'') </code>
| Compute the distance between two entity OBB. A negative return value indicates an input error. A return value of zero indicates that the OBBs are overlapping.
| Calculate the cross product between two vectors (also available as a Vector class method).  
|-
|-
| [[Destinations/Scripting/API/Global.CalcDistanceToLineSegment2D| CalcDistanceToLineSegment2D]]
| [[SteamVR/Environments/Scripting/API/Global.CalcDistanceToLineSegment2D|CalcDistanceToLineSegment2D]]
| <code>float CalcDistanceToLineSegment2D(Vector ''unknown1'', handle Vector ''unknown2'', Vector ''unknown3'') </code>
| <code>float CalcDistanceToLineSegment2D(Vector ''unknown1'', Vector ''unknown2'', Vector ''unknown3'') </code>
| {{todo|Calculates the distance from a point to a line}}
| {{todo|Calculates the distance from a point to a line}}
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.CancelEntityIOEvents | CancelEntityIOEvents]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.ExponentialDecay|ExponentialDecay]]
| <code>void CancelEntityIOEvents(ehandle ehandle_1) </code>
| <code>float ExponentialDecay(float ''inValue'', float ''startValue'', float ''lambda'') </code>
| Create all I/O events for a particular entity
| Smooth curve decreasing slower as it approaches zero.
|-
|-
| [[Destinations/Scripting/API/Global.CreateDamageInfo | CreateDamageInfo ]]
| [[SteamVR/Environments/Scripting/API/Global.LerpVectors|LerpVectors]]
| <code>DamageInfo CreateDamageInfo (handle, ''hInflictor'', handle''hAttacker'',Vector ''force'', Vector ''hitPos'', float ''flDamage'', int ''damageTypes'') </code>
| <code>Vector LerpVectors(Vector ''v1'', Vector ''v2'', float ''t'') </code>
| Allocate a DamageInfo object, used as an argument to CBaseEntity::TakeDamage(). Call DestroyDamageInfo( hInfo ) to free the object.
| Linear interpolation of vector values over [0,1].
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.CreateEffect | CreateEffect]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.RandomFloat|RandomFloat]]
| <code>bool CreateEffect(handle ''handle_1'') </code>
| <code>float RandomFloat(float ''min'', float ''max'') </code>
| Pass ''table'' - Inputs: entity, effect
| Get a random ''float'' within a range.
|-
|-
| [[Destinations/Scripting/API/Global.CreateSceneEntity | CreateSceneEntity]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.RandomInt|RandomInt]]
| <code>handle CreateSceneEntity(string ''sceneName'') </code>
| <code>int RandomInt(int ''min'', int ''max'') </code>
| Create a scene entity to play the specified scene.
| Get a random ''int'' within a range.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.CreateTrigger | CreateTrigger]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.RotateOrientation|RotateOrientation]]
| <code>handle CreateTrigger(Vector ''Vector_1'', Vector ''Vector_2'', Vector ''Vector_3'') </code>
| <code>QAngle RotateOrientation(QAngle ''angle1'', QAngle ''angle2'') </code>
| CreateTrigger( vecMin, vecMax ) : Creates and returns an AABB trigger
| Rotate a ''QAngle'' by another ''QAngle''.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.CreateTriggerRadiusApproximate | CreateTriggerRadiusApproximate]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.RotatePosition|RotatePosition]]
| <code>handle CreateTriggerRadiusApproximate(Vector ''Vector_1'', float ''float_2'') </code>
| <code>Vector RotatePosition(Vector ''rotationOrigin'', QAngle ''rotationAngle'', Vector ''vectorToRotate'') </code>
| CreateTriggerRadiusApproximate( vecOrigin, flRadius ) : Creates and returns an AABB trigger thats bigger than the radius provided
| Rotate a ''Vector'' around a point.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.cvar_getf | cvar_getf]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.RotateQuaternionByAxisAngle|RotateQuaternionByAxisAngle]]
| <code>float cvar_getf(string string_1) </code>
| <code>Quaternion RotateQuaternionByAxisAngle(Quaternion Quaternion_1, Vector Vector_2, float float_3) </code>
| Gets the value of the given cvar, as a ''float''.
| Rotates a quaternion by the specified angle around the specified ''vector'' axis. {{bug|hidetested=1| The Quaternion class is non-functional}}
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.cvar_setf | cvar_setf]]
| [[SteamVR/Environments/Scripting/API/Global.RotationDelta|RotationDelta]]
| <code>bool cvar_setf(string string_1, float float_2) </code>
| <code>QAngle RotationDelta(Qangle ''angle1'', Qangle ''angle2'',) </code>
| Sets the value of the given cvar, as a ''float''.
| Find the delta between two QAngles.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugBreak | DebugBreak]]
| [[SteamVR/Environments/Scripting/API/Global.RotationDeltaAsAngularVelocity|RotationDeltaAsAngularVelocity]]
| <code>void DebugBreak() </code>
| <code>Vector RotationDeltaAsAngularVelocity(Qangle ''angle1'', Qangle ''angle2'',) </code>
| Breaks in the debugger
| converts delta QAngle to an angular velocity Vector.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawBox | DebugDrawBox]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.SplineQuaternions|SplineQuaternions]]
| <code>void DebugDrawBox(Vector origin, Vector min, Vector max, int r, int g, int b, int a, float duration) </code>
| <code>Quaternion SplineQuaternions(Quaternion ''q0'', Quaternion ''q1'', float 't') </code>
| Draw a debug overlay box
| Very basic interpolation of quaternions ''q0'' to ''q1'' over time 't' on [0,1]. {{bug|hidetested=1| The Quaternion class is non-functional}}
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawBoxDirection | DebugDrawBoxDirection]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.SplineVectors|SplineVectors]]
| <code>void DebugDrawBoxDirection(Vector Vector_1, Vector Vector_2, Vector Vector_3, Vector Vector_4, Vector Vector_5, float float_6, float float_7) </code>
| <code>Vector SplineVectors(Vector ''v0'', Vector ''v1'', float ''t'') </code>
| Draw a debug forward box (cent, min, max, forward, vRgb, a, duration)
| Very basic interpolation of vectors ''v0'' to ''v1'' over time t on [0,1].
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawCircle | DebugDrawCircle]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.VectorToAngles|VectorToAngles]]
| <code>void DebugDrawCircle(Vector Vector_1, Vector Vector_2, float float_3, float float_4, bool bool_5, float float_6) </code>
| <code>QAngle VectorToAngles(Vector ''input'') </code>
| Draw a debug circle (center, vRgb, a, rad, ztest, duration)
| Get Qangles (with no roll) for a ''Vector''.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawClear | DebugDrawClear]]
|}
| <code>void DebugDrawClear() </code>
 
| Try to clear all the debug overlay info
==== utilsinit.lua ====
 
Functions automatically included from the utilsinit.lua core library.
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawLine | DebugDrawLine]]
| [[SteamVR/Environments/Scripting/API/Global.abs|abs]]
| <code>void DebugDrawLine(Vector Vector_1, Vector Vector_2, int int_3, int int_4, int int_5, bool bool_6, float float_7) </code>
| <code>float abs(float ''val'') </code>
| Draw a debug overlay line (origin, target, r, g, b, ztest, duration)
| Absolute value.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawLine_vCol | DebugDrawLine_vCol]]
| [[SteamVR/Environments/Scripting/API/Global.Clamp|Clamp]]
| <code>void DebugDrawLine_vCol(Vector Vector_1, Vector Vector_2, Vector Vector_3, bool bool_4, float float_5) </code>
| <code>float Clamp(float ''val'', float ''min'', float ''max'') </code>
| Draw a debug line using color vec (start, end, vRgb, a, ztest, duration)
| Clamp the value between the min and max.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawScreenTextLine | DebugDrawScreenTextLine]]
| [[SteamVR/Environments/Scripting/API/Global.Deg2Rad|Deg2Rad]]
| <code>void DebugDrawScreenTextLine(float float_1, float float_2, int int_3, string string_4, int int_5, int int_6, int int_7, int int_8, float float_9) </code>
| <code>float Deg2Rad(float ''deg'') </code>
| Draw text with a line offset (x, y, lineOffset, text, r, g, b, a, duration)
| Convert degrees to radians.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawSphere | DebugDrawSphere]]
| [[SteamVR/Environments/Scripting/API/Global.Rad2Deg|Rad2Deg]]
| <code>void DebugDrawSphere(Vector Vector_1, Vector Vector_2, float float_3, float float_4, bool bool_5, float float_6) </code>
| <code>float Rad2Deg(float ''rad'') </code>
| Draw a debug sphere (center, vRgb, a, rad, ztest, duration)
| Convert radians to degrees.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawText | DebugDrawText]]
| [[SteamVR/Environments/Scripting/API/Global.Lerp|Lerp]]
| <code>void DebugDrawText(Vector Vector_1, string string_2, bool bool_3, float float_4) </code>
| <code>float Lerp(float ''t'', float ''a'', float ''b'') </code>
| Draw text in 3d (origin, text, bViewCheck, duration)
| Linear interpolation of float values over [0,1].
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugScreenTextPretty | DebugScreenTextPretty]]
| [[SteamVR/Environments/Scripting/API/Global.max|max]]
| <code>void DebugScreenTextPretty(float float_1, float float_2, int int_3, string string_4, int int_5, int int_6, int int_7, int int_8, float float_9, string string_10, int int_11, bool bool_12) </code>
| <code>float max(float ''x'', float ''x'') </code>
| Draw pretty debug text (x, y, lineOffset, text, r, g, b, a, duration, font, size, bBold)
| Returns the largest value of the inputs.
|-
|-
| [[Destinations/Scripting/API/Global.DestroyDamageInfo| DestroyDamageInfo]]
| [[SteamVR/Environments/Scripting/API/Global.min|min]]
| <code>void DestroyDamageInfo(damageinfo) </code>
| <code>float min(float ''x'', float ''x'') </code>
| Free a damageinfo object that was created with CreateDamageInfo().
| Returns the smallest value of the inputs.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DoEntFire | DoEntFire]]
| [[SteamVR/Environments/Scripting/API/Global.Merge|Merge]]
| <code>void DoEntFire(string string_1, string string_2, string string_3, float float_4, handle handle_5, handle handle_6) </code>
| <code>table Merge(table ''t1'', table ''t2'') </code>
| EntFire: Generate an entity i/o event ( szTarget, szAction, szValue, flDelay, hActivator, hCaller )
| Merges two tables into a third, overwriting any matching keys.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DoEntFireByInstanceHandle | DoEntFireByInstanceHandle]]
| [[SteamVR/Environments/Scripting/API/Global.RemapVal|RemapVal]]
| <code>void DoEntFireByInstanceHandle(handle handle_1, string string_2, string string_3, float float_4, handle handle_5, handle handle_6) </code>
| <code>float RemapVal(float ''input'', float ''a'', float ''b'', float ''c'', float ''d'') </code>
| EntFireByHandle:Generate and entity i/o event
| Remap a value in the range [a,b] to [c,d].
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DoIncludeScript | DoIncludeScript]]
| [[SteamVR/Environments/Scripting/API/Global.RemapValClamped|RemapValClamped]]
| <code>bool DoIncludeScript(string string_1, handle handle_2) </code>
| <code>float RemapValClamped(float ''input'', float ''a'', float ''b'', float ''c'', float ''d'') </code>
| Execute a script (internal)
| Remap a value in the range [a,b] to [c,d], clamping the output to the range.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DoScriptAssert | DoScriptAssert]]
| [[SteamVR/Environments/Scripting/API/Global.VectorDistanceSq|VectorDistanceSq]]
| <code>void DoScriptAssert(bool bool_1, string string_2) </code>
| <code>float VectorDistanceSq(Vector ''v1'', Vector ''v2'') </code>
| ScriptAssert:Asserts the passed in value. Prints out a message and brings up the assert dialog.
| Distance between two vectors squared (faster than calculating the plain distance).
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DoUniqueString | DoUniqueString]]
| [[SteamVR/Environments/Scripting/API/Global.VectorDistance|VectorDistance]]
| <code>string DoUniqueString(string string_1) </code>
| <code>float VectorDistance(Vector ''v1'', Vector ''v2'') </code>
| UniqueString:Generate a string guaranteed to be unique across the life of the script VM, with an optional root string. Useful for adding data to table's when not sure what keys are already in use in that table.
| Distance between two vectors.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.EmitGlobalSound| EmitGlobalSound]]
| [[SteamVR/Environments/Scripting/API/Global.VectorLerp|VectorLerp]]
| <code>void EmitGlobalSound(string ''soundName'') </code>
| <code>Vector VectorLerp(float ''t'', Vector ''v1'', Vector ''v2'') </code>
| Play named sound for all players.
| Linear interpolation of vector values over [0,1]. The native function LerpVectors performs the same task.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.EmitSoundOn | EmitSoundOn]]
| [[SteamVR/Environments/Scripting/API/Global.VectorIsZero|VectorIsZero]]
| <code>void EmitSoundOn(string string_1, handle handle_2) </code>
| <code>bool VectorIsZero(Vector ''vec'') </code>
| Play named sound on Entity
| Check if the vector is a zero vector.
|}
 
 
=== Printing & Drawing ===
 
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.EmitSoundOnClient | EmitSoundOnClient]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.AppendToLogFile|AppendToLogFile]]
| <code>void EmitSoundOnClient(string string_1, handle handle_2) </code>
| <code>void AppendToLogFile(string string_1, string string_2) </code>
| Play named sound only on the client for the passed in player
| Appends a ''string'' to a log file on the server
|-|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawBox|DebugDrawBox]]
| <code>void DebugDrawBox(Vector origin, Vector min, Vector max, int r, int g, int b, int a, float duration) </code>
| Draw a debug overlay box
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.EntIndexToHScript | EntIndexToHScript]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawBoxDirection|DebugDrawBoxDirection]]
| <code>handle EntIndexToHScript(int int_1) </code>
| <code>void DebugDrawBoxDirection(Vector Vector_1, Vector Vector_2, Vector Vector_3, Vector Vector_4, Vector Vector_5, float float_6, float float_7) </code>
| Turn an entity index integer to an HScript representing that entity's script instance.
| Draw a debug forward box (cent, min, max, forward, vRgb, a, duration)
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.ExponentialDecay | ExponentialDecay]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawCircle|DebugDrawCircle]]
| <code>float ExponentialDecay(float float_1, float float_2, float float_3) </code>
| <code>void DebugDrawCircle(Vector Vector_1, Vector Vector_2, float float_3, float float_4, bool bool_5, float float_6) </code>
| Smooth curve decreasing slower as it approaches zero
| Draw a debug circle (center, vRgb, a, rad, ztest, duration)
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.FileToString | FileToString]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawClear|DebugDrawClear]]
| <code>string FileToString(string a) </code>
| <code>void DebugDrawClear() </code>
| Reads a string from a file to send to script
| Try to clear all the debug overlay info
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.FireEntityIOInputNameOnly | FireEntityIOInputNameOnly]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawLine|DebugDrawLine]]
| <code>void FireEntityIOInputNameOnly(ehandle ehandle_1, string string_2) </code>
| <code>void DebugDrawLine(Vector Vector_1, Vector Vector_2, int int_3, int int_4, int int_5, bool bool_6, float float_7) </code>
| Fire Entity's Action Input w/no data
| Draw a debug overlay line (origin, target, r, g, b, ztest, duration)
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.FireEntityIOInputString | FireEntityIOInputString]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawLine vCol|DebugDrawLine_vCol]]
| <code>void FireEntityIOInputString(ehandle ehandle_1, string string_2, string string_3) </code>
| <code>void DebugDrawLine_vCol(Vector Vector_1, Vector Vector_2, Vector Vector_3, bool bool_4, float float_5) </code>
| Fire Entity's Action Input with passed String - you own the memory
| Draw a debug line using color vec (start, end, vRgb, a, ztest, duration)
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.FireEntityIOInputVec | FireEntityIOInputVec]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawScreenTextLine|DebugDrawScreenTextLine]]
| <code>void FireEntityIOInputVec(ehandle ehandle_1, string string_2, Vector Vector_3) </code>
| <code>void DebugDrawScreenTextLine(float float_1, float float_2, int int_3, string string_4, int int_5, int int_6, int int_7, int int_8, float float_9) </code>
| Fire Entity's Action Input with passed ''Vector'' ( hEntity, szActionName, vector )
| Draw text with a line offset (x, y, lineOffset, text, r, g, b, a, duration)
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.FireGameEvent | FireGameEvent]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawSphere|DebugDrawSphere]]
| <code>void FireGameEvent(string eventName, handle parameterTable) </code>
| <code>void DebugDrawSphere(Vector Vector_1, Vector Vector_2, float float_3, float float_4, bool bool_5, float float_6) </code>
| Fire a pre-defined event, which can be found either in custom_events.txt or in dota's resource/*.res
| Draw a debug sphere (center, vRgb, a, rad, ztest, duration)
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.FireGameEventLocal | FireGameEventLocal]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugDrawText|DebugDrawText]]
| <code>void FireGameEventLocal(string string_1, handle handle_2) </code>
| <code>void DebugDrawText(Vector Vector_1, string string_2, bool bool_3, float float_4) </code>
| Fire a game event without broadcasting to the client.
| Draw text in 3d (origin, text, bViewCheck, duration)
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.FrameTime | FrameTime]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugScreenTextPretty|DebugScreenTextPretty]]
| <code>float FrameTime() </code>
| <code>void DebugScreenTextPretty(float float_1, float float_2, int int_3, string string_4, int int_5, int int_6, int int_7, int int_8, float float_9, string string_10, int int_11, bool bool_12) </code>
| Get the time spent on the server in the last frame
| Draw pretty debug text (x, y, lineOffset, text, r, g, b, a, duration, font, size, bBold)
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.GetFrameCount | GetFrameCount]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.Msg|Msg]]
| <code>int GetFrameCount() </code>
| <code>void Msg(string ''message'') </code>
| Returns the engines current frame count
| Print a message to the console.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.GetListenServerHost | GetListenServerHost]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.PrintLinkedConsoleMessage|PrintLinkedConsoleMessage]]
| <code>handle GetListenServerHost() </code>
| <code>void PrintLinkedConsoleMessage(string string_1, string string_2) </code>
| Get the local player on a listen server.
| Print a console message with a linked console command
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.GetMapName | GetMapName]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.Say|Say]]
| <code>string GetMapName() </code>
| <code>void Say(handle entity, string message, bool teamOnly) </code>
| Get the name of the map.
| Have Entity say ''string'', and teamOnly or not
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.GetMaxOutputDelay | GetMaxOutputDelay]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.ShowMessage|ShowMessage]]
| <code>float GetMaxOutputDelay(ehandle ehandle_1, string string_2) </code>
| <code>void ShowMessage(string string_1) </code>
| Get the longest delay for all events attached to an output
| Print a hud message on all clients
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.GetPhysAngularVelocity | GetPhysAngularVelocity]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL MessageText|UTIL_MessageText]]
| <code>Vector GetPhysAngularVelocity(CBaseEntity ''entity'') </code>
| <code>void UTIL_MessageText(int playerId, string message, int r, int g, int b, int a) </code>
| Get Angular Velocity for VPHYS or normal object. Returns a vector of the axis of rotation, multiplied by the degrees of rotation per second.
| Displays a message for a specific player
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.GetPhysVelocity | GetPhysVelocity]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL MessageText WithContext|UTIL_MessageText_WithContext]]
| <code>Vector GetPhysVelocity(CBaseEntity ''entity'') </code>
| <code>void UTIL_MessageText_WithContext(int playerId, string message, int r, int g, int b, int a, table context) </code>
| Get Velocity for VPHYS or normal object.
| Sends a message to a specific player in the message box with a context table
|-
|-
| [[Destinations/Scripting/API/Global.GetPlayerFromUserID| GetPlayerFromUserID]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL MessageTextAll|UTIL_MessageTextAll]]
| <code>CBasePlayer GetPlayerFromUserID(int ''userID'') </code>
| <code>void UTIL_MessageTextAll(string message, int r, int g, int b, int a) </code>
| Given a user ID, return the script handle for the entity, or nil.
| Sends a message to everyone in the message box
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.InitLogFile | InitLogFile]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL MessageTextAll WithContext|UTIL_MessageTextAll_WithContext]]
| <code>void InitLogFile(string string_1, string string_2) </code>
| <code>void UTIL_MessageTextAll_WithContext(string message, int r, int g, int b, int a, table context) </code>
| If the given file doesn't exist, creates it with the given contents; does nothing if it exists
| Sends a message to everyone in the message box with a context table
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.IsClient | IsClient]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL ResetMessageText|UTIL_ResetMessageText]]
| <code>bool IsClient() </code>
| <code>void UTIL_ResetMessageText(int playerId) </code>
| Returns true if this is lua running from the client.dll.
| Resets the message text for the player
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.IsDedicatedServer | IsDedicatedServer]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL ResetMessageTextAll|UTIL_ResetMessageTextAll]]
| <code>bool IsDedicatedServer() </code>
| <code>void UTIL_ResetMessageTextAll() </code>
| Returns true if this server is a dedicated server.
| Resets the message text for all players
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.IsMarkedForDeletion | IsMarkedForDeletion]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.Warning|Warning]]
| <code>bool IsMarkedForDeletion(handle handle_1) </code>
| <code>void Warning(string string_1) </code>
| Returns true if the entity is valid and marked for deletion.
| Print a warning
|}
 
 
=== Entity Manipulation ===
 
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.IsServer | IsServer]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.CancelEntityIOEvents|CancelEntityIOEvents]]
| <code>bool IsServer() </code>
| <code>void CancelEntityIOEvents(ehandle ehandle_1) </code>
| Returns true if this is lua running from the server.dll.
| Create all I/O events for a particular entity
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.IsValidEntity | IsValidEntity]]
| [[SteamVR/Environments/Scripting/API/Global.ConnectOutputs|ConnectOutputs]]
| <code>bool IsValidEntity(handle handle_1) </code>
| <code>void ConnectOutputs(table ''scope'') </code>
| Checks to see if the given hScript is a valid entity
| Connects all output script functions of the passed entity script scope to the entity outputs. {{todo | Document function name format: "^On.*Output$"}}
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.IsInToolsMode | IsInToolsMode]]
| [[SteamVR/Environments/Scripting/API/Global.CreateDamageInfo|CreateDamageInfo]]
| <code>bool IsInToolsMode() </code>
| <code>DamageInfo CreateDamageInfo (handle, ''hInflictor'', handle''hAttacker'',Vector ''force'', Vector ''hitPos'', float ''flDamage'', int ''damageTypes'') </code>
| Returns true if this is lua running from the dota2 workshop tools.
| Allocate a DamageInfo object, used as an argument to CBaseEntity::TakeDamage(). Call DestroyDamageInfo( hInfo ) to free the object.
|-
|-
| [[Destinations/Scripting/API/Global.IsInVRMode | IsInVRMode]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.CreateEffect|CreateEffect]]
| <code>bool IsInVRMode() </code>
| <code>bool CreateEffect(handle ''handle_1'') </code>
| Checks if the game is running in VR mode.
| Pass ''table'' - Inputs: entity, effect
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.ListenToGameEvent | ListenToGameEvent]]
| [[SteamVR/Environments/Scripting/API/Global.CreateSceneEntity|CreateSceneEntity]]
| <code>int ListenToGameEvent(string EventName, handle functionNameToCall, handle context) </code>
| <code>handle CreateSceneEntity(string ''sceneName'') </code>
| Register as a listener for a game event from script.
| Create a scene entity to play the specified scene.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.LoadKeyValues | LoadKeyValues]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.CreateTrigger|CreateTrigger]]
| <code>table LoadKeyValues(string string_1) </code>
| <code>handle CreateTrigger(Vector ''Vector_1'', Vector ''Vector_2'', Vector ''Vector_3'') </code>
| Creates a ''table'' from the specified keyvalues text file
| CreateTrigger( vecMin, vecMax ) : Creates and returns an AABB trigger
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.LoadKeyValuesFromString | LoadKeyValuesFromString]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.CreateTriggerRadiusApproximate|CreateTriggerRadiusApproximate]]
| <code>table LoadKeyValuesFromString(string string_1) </code>
| <code>handle CreateTriggerRadiusApproximate(Vector ''Vector_1'', float ''float_2'') </code>
| Creates a ''table'' from the specified keyvalues ''string''
| CreateTriggerRadiusApproximate( vecOrigin, flRadius ) : Creates and returns an AABB trigger thats bigger than the radius provided
|-
|-
| [[Destinations/Scripting/API/Global.LocalTime | LocalTime]]
| [[SteamVR/Environments/Scripting/API/Global.DestroyDamageInfo|DestroyDamageInfo]]
| <code>table LocalTime() </code>
| <code>void DestroyDamageInfo(damageinfo) </code>
| Returns the local system time as a table with the format {Hours  = int; Minutes = int; Seconds = int}
| Free a damageinfo object that was created with CreateDamageInfo().
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.MakeStringToken | MakeStringToken]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DoEntFire|DoEntFire]]
| <code>int MakeStringToken(string string_1) </code>
| <code>void DoEntFire(string ''target'', string ''action'', string ''value'', float ''delay'', handle ''activator'', handle ''caller'') </code>
| Checks to see if the given hScript is a valid entity
| Internal native function for <code>EntFire()</code>.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.Msg | Msg]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DoEntFireByInstanceHandle|DoEntFireByInstanceHandle]]
| <code>void Msg(string string_1) </code>
| <code>void DoEntFireByInstanceHandle(handle ''target'', string ''action'', string ''value'', float ''delay'', handle ''activator'', handle ''caller'') </code>
| Print a message
| Internal native function for <code>EntFireByHandle()</code>.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.PlayerInstanceFromIndex | PlayerInstanceFromIndex]]
| [[SteamVR/Environments/Scripting/API/Global.EntFire|EntFire]]
| <code>handle PlayerInstanceFromIndex(int int_1) </code>
| <code>void EntFire(table ''scope'', string ''target'', string ''action'', string ''value'' = "", float ''delay'' = 0.0, handle ''activator'' = scope.thisEntity) </code>
| Get a script instance of a player by index.
| Generate an entity I/O event on all entities matching the specified target name. The script scope of the calling entity should be passed to the first parameter.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.PrecacheEntityFromTable | PrecacheEntityFromTable]]
| [[SteamVR/Environments/Scripting/API/Global.EntFireByHandle|EntFireByHandle]]
| <code>void PrecacheEntityFromTable(string string_1, handle handle_2, handle handle_3) </code>
| <code>void EntFireByHandle(handle ''self'', handle ''target'', string ''action'', string ''value'' = "", float ''delay'' = 0.0, handle ''activator'' = self) </code>
| Precache an entity from KeyValues in ''table''
| Generate an entity I/O event on the specified entity. The calling entity should be passed to the first parameter.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.PrecacheEntityListFromTable | PrecacheEntityListFromTable]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.EntIndexToHScript|EntIndexToHScript]]
| <code>void PrecacheEntityListFromTable(handle handle_1, handle handle_2) </code>
| <code>handle EntIndexToHScript(int int_1) </code>
| Precache a list of entity KeyValues table's
| Turn an entity index integer to an HScript representing that entity's script instance.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.PrecacheModel | PrecacheModel]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.FireEntityIOInputNameOnly|FireEntityIOInputNameOnly]]
| <code>void FireEntityIOInputNameOnly(ehandle ehandle_1, string string_2) </code>
| Fire Entity's Action Input w/no data
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.FireEntityIOInputString|FireEntityIOInputString]]
| <code>void FireEntityIOInputString(ehandle ehandle_1, string string_2, string string_3) </code>
| Fire Entity's Action Input with passed String - you own the memory
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.FireEntityIOInputVec|FireEntityIOInputVec]]
| <code>void FireEntityIOInputVec(ehandle ehandle_1, string string_2, Vector Vector_3) </code>
| Fire Entity's Action Input with passed ''Vector'' ( hEntity, szActionName, vector )
|-
| [[SteamVR/Environments/Scripting/API/Global.GetHandHoldingEntity|GetHandHoldingEntity]]
| <code>CPropVRHand GetHandHoldingEntity(handle ''entity'') </code>
| Returns the hand holding the entity, or nil if its not currently held.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.GetMaxOutputDelay|GetMaxOutputDelay]]
| <code>float GetMaxOutputDelay(ehandle ehandle_1, string string_2) </code>
| Get the longest delay for all events attached to an output
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.GetPhysAngularVelocity|GetPhysAngularVelocity]]
| <code>Vector GetPhysAngularVelocity(CBaseEntity ''entity'') </code>
| Get Angular Velocity for VPHYS or normal object. Returns a vector of the axis of rotation, multiplied by the degrees of rotation per second.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.GetPhysVelocity|GetPhysVelocity]]
| <code>Vector GetPhysVelocity(CBaseEntity ''entity'') </code>
| Get Velocity for VPHYS or normal object.
|-
| [[SteamVR/Environments/Scripting/API/Global.GetPlayerFromUserID|GetPlayerFromUserID]]
| <code>CBasePlayer GetPlayerFromUserID(int ''userID'') </code>
| Given a user ID, return the script handle for the entity, or nil.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.IsValidEntity|IsValidEntity]]
| <code>bool IsValidEntity(handle handle_1) </code>
| Checks to see if the given hScript is a valid entity
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.PlayerInstanceFromIndex|PlayerInstanceFromIndex]]
| <code>handle PlayerInstanceFromIndex(int int_1) </code>
| Get a script instance of a player by index.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.PrecacheEntityFromTable|PrecacheEntityFromTable]]
| <code>void PrecacheEntityFromTable(string string_1, handle handle_2, handle handle_3) </code>
| Precache an entity from KeyValues in ''table''
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.PrecacheEntityListFromTable|PrecacheEntityListFromTable]]
| <code>void PrecacheEntityListFromTable(handle handle_1, handle handle_2) </code>
| Precache a list of entity KeyValues table's
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.PrecacheModel|PrecacheModel]]
| <code>void PrecacheModel(string ''modelName'', handle ''context'')</code>
| <code>void PrecacheModel(string ''modelName'', handle ''context'')</code>
| Manually precache a single model.
| Manually precache a single model.
|-
|-
| [[Destinations/Scripting/API/Global.PrecacheModelFolder | PrecacheModelFolder]]
| [[SteamVR/Environments/Scripting/API/Global.PrecacheModelFolder|PrecacheModelFolder]]
| <code>void PrecacheModelFolder(string ''folderName'', handle ''context'')</code>
| <code>void PrecacheModelFolder(string ''folderName'', handle ''context'')</code>
| Recursively precache models within a folder.
| Recursively precache models within a folder.
|-
|-
| [[Destinations/Scripting/API/Global.PrecacheParticle | PrecacheParticle]]  
| [[SteamVR/Environments/Scripting/API/Global.PrecacheParticle|PrecacheParticle]]  
| <code>void PrecacheParticle(string ''particleName'', handle ''context'')</code>
| <code>void PrecacheParticle(string ''particleName'', handle ''context'')</code>
| Manually precache a single particle.
| Manually precache a single particle.
|-
|-
| [[Destinations/Scripting/API/Global.PrecacheParticleFolder | PrecacheParticleFolder]]
| [[SteamVR/Environments/Scripting/API/Global.PrecacheParticleFolder|PrecacheParticleFolder]]
| <code>void PrecacheParticleFolder( string ''folderName'', handle ''context'')</code>
| <code>void PrecacheParticleFolder( string ''folderName'', handle ''context'')</code>
| Recursively precache particles within a folder
| Recursively precache particles within a folder
|-
|-
| [[Destinations/Scripting/API/Global.PrecacheSoundFile | PrecacheSoundFile]]
| [[SteamVR/Environments/Scripting/API/Global.PrecacheResource|PrecacheResource]]
| <code>void PrecacheResource(string ''resourceType'', string ''resourcePath'', handle ''context'')</code>
| Manually precache a single resource. Types: "model|model_folder|sound|soundfile|particle|particle_folder"
|-
| [[SteamVR/Environments/Scripting/API/Global.PrecacheSoundFile|PrecacheSoundFile]]
| <code>void PrecacheSoundFile(string ''soundFileName'', handle ''context'')</code>
| <code>void PrecacheSoundFile(string ''soundFileName'', handle ''context'')</code>
| Manually precache a single sound file
| Manually precache a single sound file
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.PrintLinkedConsoleMessage | PrintLinkedConsoleMessage]]
| [[SteamVR/Environments/Scripting/API/Global.SetPhysAngularVelocity|SetPhysAngularVelocity]]
| <code>void PrintLinkedConsoleMessage(string string_1, string string_2) </code>
| <code>void SetPhysAngularVelocity(CBaseEntity ''entity'', Vector ''angVel'') </code>
| Print a console message with a linked console command
| Set Angular Velocity for VPHYS or normal object, from a vector of the axis of rotation, multiplied by the degrees of rotation per second.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.RandomFloat | RandomFloat]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.SetRenderingEnabled|SetRenderingEnabled]]
| <code>float RandomFloat(float float_1, float float_2) </code>
| <code>void SetRenderingEnabled(ehandle ''entityEhandle'', bool ''enabled'') </code>
| Get a random ''float'' within a range
| Set rendering on/off for an ''EHANDLE''.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.RandomInt | RandomInt]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.SpawnEntityFromTableSynchronous|SpawnEntityFromTableSynchronous]]
| <code>int RandomInt(int int_1, int int_2) </code>
| <code>handle SpawnEntityFromTableSynchronous(string string_1, handle handle_2) </code>
| Get a random ''int'' within a range
| Synchronously spawns a single entity from a ''table''
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.RegisterSpawnGroupFilterProxy | RegisterSpawnGroupFilterProxy]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.SpawnEntityGroupFromTable|SpawnEntityGroupFromTable]]
| <code>void RegisterSpawnGroupFilterProxy(string string_1) </code>
| <code>bool SpawnEntityGroupFromTable(handle groupSpawnTables, bool bAsync, handle hCallback) </code>
| Create a C proxy for a script-based spawn group filter
| Hierarchically spawn an entity group from a set of spawn tables.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.ReloadMOTD | ReloadMOTD]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.SpawnEntityListFromTableAsynchronous|SpawnEntityListFromTableAsynchronous]]
| <code>void ReloadMOTD() </code>
| <code>int SpawnEntityListFromTableAsynchronous(handle handle_1, handle handle_2) </code>
| Reloads the MotD file
| Asynchronously spawn an entity group from a list of spawn table's. A callback will be triggered when the spawning is complete
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.RemoveSpawnGroupFilterProxy | RemoveSpawnGroupFilterProxy]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.SpawnEntityListFromTableSynchronous|SpawnEntityListFromTableSynchronous]]
| <code>void RemoveSpawnGroupFilterProxy(string string_1) </code>
| <code>handle SpawnEntityListFromTableSynchronous(handle handle_1) </code>
| Remove the C proxy for a script-based spawn group filter
| Synchronously spawn an entity group from a list of spawn table's.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.RotateOrientation | RotateOrientation]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.StopEffect|StopEffect]]
| <code>QAngle RotateOrientation(QAngle QAngle_1, QAngle QAngle_2) </code>
| <code>void StopEffect(handle handle_1, string string_2) </code>
| Rotate a ''QAngle'' by another ''QAngle''.
| (hEntity, szEffectName)
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.RotatePosition | RotatePosition]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL Remove|UTIL_Remove]]
| <code>Vector RotatePosition(Vector Vector_1, QAngle QAngle_2, Vector Vector_3) </code>
| <code>void UTIL_Remove(handle handle_1) </code>
| Rotate a ''Vector'' around a point.
| Removes the specified entity
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.RotateQuaternionByAxisAngle | RotateQuaternionByAxisAngle]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL RemoveImmediate|UTIL_RemoveImmediate]]
| <code>Quaternion RotateQuaternionByAxisAngle(Quaternion Quaternion_1, Vector Vector_2, float float_3) </code>
| <code>void UTIL_RemoveImmediate(handle handle_1) </code>
| Rotates a quaternion by the specified angle around the specified ''vector'' axis
| Do Not use this function.  Use UTIL_Remove() instead.  This will crash your game.
|-
|-
| [[Destinations/Scripting/API/Global.RotationDelta | RotationDelta]]
 
| <code>QAngle RotationDelta(Qangle ''angle1'', Qangle ''angle2'',) </code>
|}
| Find the delta between two QAngles.
 
|-
 
| [[Destinations/Scripting/API/Global.RotationDeltaAsAngularVelocity| RotationDeltaAsAngularVelocity]]
=== Tracing ===
| <code>Vector RotationDeltaAsAngularVelocity(Qangle ''angle1'', Qangle ''angle2'',) </code>
 
| converts delta QAngle to an angular velocity Vector.
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.rr_AddDecisionRule | rr_AddDecisionRule]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.TraceCollideable|TraceCollideable]]
| <code>bool rr_AddDecisionRule(handle handle_1) </code>
| <code>bool TraceCollideable(table ''parameters'') </code>
| Add a rule to the decision database.
| Does a raytrace against a single entity. Input and output parameters are stored in the specified table.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.rr_CommitAIResponse | rr_CommitAIResponse]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.TraceHull|TraceHull]]
| <code>bool rr_CommitAIResponse(handle handle_1, handle handle_2) </code>
| <code>bool TraceHull(table ''parameters'') </code>
| Commit the result of QueryBestResponse back to the given entity to play. Call with params (entity, airesponse)
| Traces a axis aligned bounding box along a line. Input and output parameters are stored in the specified table.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.rr_GetResponseTargets | rr_GetResponseTargets]]
| [[SteamVR/Environments/Scripting/API/Global.TraceInteractibles|TraceInteractibles]]
| <code>handle rr_GetResponseTargets() </code>
| <code>bool TraceInteractibles(table ''parameters'') </code>
| Retrieve a ''table'' of all available expresser targets, in the form { name : ''handle'', name: ''handle'' }.
| {{todo|Pass table - Inputs: startpos, endpos, mask, ignore  -- outputs: pos, fraction, hit, enthit, startsolid}}
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.rr_QueryBestResponse | rr_QueryBestResponse]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.TraceLine|TraceLine]]
| <code>bool rr_QueryBestResponse(handle handle_1, handle handle_2, handle handle_3) </code>
| <code>bool TraceLine(table ''parameters'') </code>
| Params: ( hEnt, hQuery, hResult ) // Static : tests 'query' against entity's response system and returns the best response found (or ''nil'' if none found).
| Does a raytrace along a line. Input and output parameters are stored in the specified table.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.Say | Say]]
|}
| <code>void Say(handle entity, string message, bool teamOnly) </code>
 
| Have Entity say ''string'', and teamOnly or not
 
=== Sound ===
 
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.ScreenShake | ScreenShake]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.EmitGlobalSound|EmitGlobalSound]]
| <code>void ScreenShake(Vector Vector_1, float float_2, float float_3, float float_4, float float_5, int int_6, bool bool_7) </code>
| <code>void EmitGlobalSound(string ''soundName'') </code>
| Start a screenshake with the following parameters. vecCenter, flAmplitude, flFrequency, flDuration, flRadius, eCommand( SHAKE_START = 0, SHAKE_STOP = 1 ), bAirShake
| Play named sound for all players.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.SendToConsole | SendToConsole]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.EmitSoundOn|EmitSoundOn]]
| <code>void SendToConsole(string string_1) </code>
| <code>void EmitSoundOn(string string_1, handle handle_2) </code>
| Send a ''string'' to the console as a client command
| Play named sound on Entity
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.SendToServerConsole | SendToServerConsole]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.EmitSoundOnClient|EmitSoundOnClient]]
| <code>void SendToServerConsole(string string_1) </code>
| <code>void EmitSoundOnClient(string string_1, handle handle_2) </code>
| Send a ''string'' to the console as a server command
| Play named sound only on the client for the passed in player
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.SetOpvarFloatAll | SetOpvarFloatAll]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.SetOpvarFloatAll|SetOpvarFloatAll]]
| <code>void SetOpvarFloatAll(string string_1, string string_2, string string_3, float float_4) </code>
| <code>void SetOpvarFloatAll(string string_1, string string_2, string string_3, float float_4) </code>
| Sets an opvar value for all players
| Sets an opvar value for all players
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.SetOpvarFloatPlayer | SetOpvarFloatPlayer]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.SetOpvarFloatPlayer|SetOpvarFloatPlayer]]
| <code>void SetOpvarFloatPlayer(string string_1, string string_2, string string_3, float float_4, handle handle_5) </code>
| <code>void SetOpvarFloatPlayer(string string_1, string string_2, string string_3, float float_4, handle handle_5) </code>
| Sets an opvar value for a single player ( szStackName, szOperatorName, szOpvarName, flOpvarValue, hEnt )
| Sets an opvar value for a single player ( szStackName, szOperatorName, szOpvarName, flOpvarValue, hEnt )
|-
|-
| [[Destinations/Scripting/API/Global.SetPhysAngularVelocity| SetPhysAngularVelocity]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.StartSoundEvent|StartSoundEvent]]
| <code>void SetPhysAngularVelocity(CBaseEntity ''entity'', Vector ''angVel'') </code>
| <code>void StartSoundEvent(string string_1, handle handle_2) </code>
| Set Angular Velocity for VPHYS or normal object, from a vector of the axis of rotation, multiplied by the degrees of rotation per second.
| Start a sound event
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.SetQuestName | SetQuestName]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.StartSoundEventFromPosition|StartSoundEventFromPosition]]
| <code>void SetQuestName(string string_1) </code>
| <code>void StartSoundEventFromPosition(string string_1, Vector Vector_2) </code>
| Set the current quest name.
| Start a sound event from position
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.SetQuestPhase | SetQuestPhase]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.StartSoundEventFromPositionReliable|StartSoundEventFromPositionReliable]]
| <code>void SetQuestPhase(int int_1) </code>
| <code>void StartSoundEventFromPositionReliable(string string_1, Vector Vector_2) </code>
| Set the current quest phase.
| Start a sound event from position with reliable delivery
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.SetRenderingEnabled | SetRenderingEnabled]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.StartSoundEventFromPositionUnreliable|StartSoundEventFromPositionUnreliable]]
| <code>void SetRenderingEnabled(ehandle ehandle_1, bool bool_2) </code>
| <code>void StartSoundEventFromPositionUnreliable(string string_1, Vector Vector_2) </code>
| Set rendering on/off for an ''ehandle''
| Start a sound event from position with optional delivery
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.ShowMessage | ShowMessage]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.StartSoundEventReliable|StartSoundEventReliable]]
| <code>void ShowMessage(string string_1) </code>
| <code>void StartSoundEventReliable(string string_1, handle handle_2) </code>
| Print a hud message on all clients
| Start a sound event with reliable delivery
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.SpawnEntityFromTableSynchronous | SpawnEntityFromTableSynchronous]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.StartSoundEventUnreliable|StartSoundEventUnreliable]]
| <code>handle SpawnEntityFromTableSynchronous(string string_1, handle handle_2) </code>
| <code>void StartSoundEventUnreliable(string string_1, handle handle_2) </code>
| Synchronously spawns a single entity from a ''table''
| Start a sound event with optional delivery
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.SpawnEntityGroupFromTable | SpawnEntityGroupFromTable]]
| [[SteamVR/Environments/Scripting/API/Global.StopGlobalSound|StopGlobalSound]]
| <code>bool SpawnEntityGroupFromTable(handle groupSpawnTables, bool bAsync, handle hCallback) </code>
| <code>void StopGlobalSound(string ''soundName'') </code>
| Hierarchically spawn an entity group from a set of spawn tables.
| Stop named sound for all players.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.StopSoundEvent|StopSoundEvent]]
| <code>void StopSoundEvent(string string_1, handle handle_2) </code>
| Stops a sound event
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.SpawnEntityListFromTableAsynchronous | SpawnEntityListFromTableAsynchronous]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.StopSoundOn|StopSoundOn]]
| <code>int SpawnEntityListFromTableAsynchronous(handle handle_1, handle handle_2) </code>
| <code>void StopSoundOn(string soundName, handle playingEntity) </code>
| Asynchronously spawn an entity group from a list of spawn table's. A callback will be triggered when the spawning is complete
| Stop named sound on Entity
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.SpawnEntityListFromTableSynchronous | SpawnEntityListFromTableSynchronous]]
 
| <code>handle SpawnEntityListFromTableSynchronous(handle handle_1) </code>
|}
| Synchronously spawn an entity group from a list of spawn table's.
 
 
=== Miscellaneous ===
 
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.SplineQuaternions | SplineQuaternions]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.cvar getf|cvar_getf]]
| <code>Quaternion SplineQuaternions(Quaternion Quaternion_1, Quaternion Quaternion_2, float float_3) </code>
| <code>float cvar_getf(string string_1) </code>
| (quaternion,quaternion,''float'') very basic interpolation of v0 to v1 over t on [0,1]
| Gets the value of the given cvar, as a ''float''.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.SplineVectors | SplineVectors]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.cvar setf|cvar_setf]]
| <code>Vector SplineVectors(Vector Vector_1, Vector Vector_2, float float_3) </code>
| <code>bool cvar_setf(string string_1, float float_2) </code>
| (''vector'',''vector'',''float'') very basic interpolation of v0 to v1 over t on [0,1]
| Sets the value of the given cvar, as a ''float''.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.StartSoundEvent | StartSoundEvent]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DebugBreak|DebugBreak]]
| <code>void StartSoundEvent(string string_1, handle handle_2) </code>
| <code>void DebugBreak() </code>
| Start a sound event
| Breaks in the debugger
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.StartSoundEventFromPosition | StartSoundEventFromPosition]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DoIncludeScript|DoIncludeScript]]
| <code>void StartSoundEventFromPosition(string string_1, Vector Vector_2) </code>
| <code>bool DoIncludeScript(string ''scriptFileName'', handle ''scope'') </code>
| Start a sound event from position
| Internal native function for <code>IncludeScript()</code>.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.StartSoundEventFromPositionReliable | StartSoundEventFromPositionReliable]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DoScriptAssert|DoScriptAssert]]
| <code>void StartSoundEventFromPositionReliable(string string_1, Vector Vector_2) </code>
| <code>void DoScriptAssert(bool ''assertion'', string ''message'') </code>
| Start a sound event from position with reliable delivery
| Internal native function for <code>ScriptAssert()</code>.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.StartSoundEventFromPositionUnreliable | StartSoundEventFromPositionUnreliable]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.DoUniqueString|DoUniqueString]]
| <code>void StartSoundEventFromPositionUnreliable(string string_1, Vector Vector_2) </code>
| <code>string DoUniqueString(string ''root'') </code>
| Start a sound event from position with optional delivery
| Internal native function for <code>UniqueString()</code>.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.StartSoundEventReliable | StartSoundEventReliable]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.FileToString|FileToString]]
| <code>void StartSoundEventReliable(string string_1, handle handle_2) </code>
| <code>string FileToString(string a) </code>
| Start a sound event with reliable delivery
| Reads a string from a file to send to script
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.StartSoundEventUnreliable | StartSoundEventUnreliable]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.FireGameEvent|FireGameEvent]]
| <code>void StartSoundEventUnreliable(string string_1, handle handle_2) </code>
| <code>void FireGameEvent(string eventName, handle parameterTable) </code>
| Start a sound event with optional delivery
| Fire a pre-defined event, which can be found either in custom_events.txt or in dota's resource/*.res
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.StopEffect | StopEffect]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.FireGameEventLocal|FireGameEventLocal]]
| <code>void StopEffect(handle handle_1, string string_2) </code>
| <code>void FireGameEventLocal(string string_1, handle handle_2) </code>
| (hEntity, szEffectName)
| Fire a game event without broadcasting to the client.
|-
|-
| [[Destinations/Scripting/API/Global.StopGlobalSound | StopGlobalSound]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.FrameTime|FrameTime]]
| <code>void StopGlobalSound(string ''soundName'') </code>
| <code>float FrameTime() </code>
| Stop named sound for all players.
| Get the time spent on the server in the last frame
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.StopListeningToAllGameEvents | StopListeningToAllGameEvents]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.GetFrameCount|GetFrameCount]]
| <code>void StopListeningToAllGameEvents(handle handle_1) </code>
| <code>int GetFrameCount() </code>
| Stop listening to all game events within a specific context.
| Returns the engines current frame count
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.StopListeningToGameEvent | StopListeningToGameEvent]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.GetListenServerHost|GetListenServerHost]]
| <code>bool StopListeningToGameEvent(int int_1) </code>
| <code>handle GetListenServerHost() </code>
| Stop listening to a particular game event.
| Get the local player on a listen server.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.StopSoundEvent | StopSoundEvent]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.GetMapName|GetMapName]]
| <code>void StopSoundEvent(string string_1, handle handle_2) </code>
| <code>string GetMapName() </code>
| Stops a sound event
| Get the name of the map.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.StopSoundOn | StopSoundOn]]
| [[SteamVR/Environments/Scripting/API/Global.GetPerInputTutorialActions|GetPerInputTutorialActions]]
| <code>void StopSoundOn(string soundName, handle playingEntity) </code>
| <code>table GetPerInputTutorialActions(string ''unknown'') </code>
| Stop named sound on Entity
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.StringToFile | StringToFile]]
| [[SteamVR/Environments/Scripting/API/Global.IncludeScript|IncludeScript]]
| <code>bool StringToFile(string a, string b) </code>
| <code>bool IncludeScript(string ''scriptFileName'', handle ''scope'' = nil) </code>
| * Directory traversal doesn't seem to work. The characters '.', '/' and '\\' are ignored.
| Execute a script file. Included in the current scope by default.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.Time | Time]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.InitLogFile|InitLogFile]]
| <code>float Time() </code>
| <code>void InitLogFile(string string_1, string string_2) </code>
| Get the current server time
| If the given file doesn't exist, creates it with the given contents; does nothing if it exists
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.TraceCollideable | TraceCollideable]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.IsClient|IsClient]]
| <code>bool TraceCollideable(table ''parameters'') </code>
| <code>bool IsClient() </code>
| Does a raytrace against a single entity. Input and output parameters are stored in the specified table.
| Returns true if this is lua running from the client.dll.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.TraceHull | TraceHull]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.IsDedicatedServer|IsDedicatedServer]]
| <code>bool TraceHull(table ''parameters'') </code>
| <code>bool IsDedicatedServer() </code>
| Traces a bounding box along a line. Input and output parameters are stored in the specified table.
| Returns true if this server is a dedicated server.
|-
|-
| [[Destinations/Scripting/API/Global.TraceInteractibles | TraceInteractibles]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.IsMarkedForDeletion|IsMarkedForDeletion]]
| <code>bool TraceInteractibles(table ''parameters'') </code>
| <code>bool IsMarkedForDeletion(handle handle_1) </code>
| {{todo|Pass table - Inputs: startpos, endpos, mask, ignore  -- outputs: pos, fraction, hit, enthit, startsolid}}
| Returns true if the entity is valid and marked for deletion.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.TraceLine | TraceLine]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.IsServer|IsServer]]
| <code>bool TraceLine(table ''parameters'') </code>
| <code>bool IsServer() </code>
| Does a raytrace along a line. Input and output parameters are stored in the specified table.
| Returns true if this is lua running from the server.dll.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.UnloadSpawnGroup | UnloadSpawnGroup]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.IsInToolsMode|IsInToolsMode]]
| <code>void UnloadSpawnGroup(string string_1) </code>
| <code>bool IsInToolsMode() </code>
| Unload a spawn group by name
| Returns true if this is lua running from the dota2 workshop tools.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.UnloadSpawnGroupByHandle | UnloadSpawnGroupByHandle]]
| [[SteamVR/Environments/Scripting/API/Global.IsInVRMode|IsInVRMode]]
| <code>void UnloadSpawnGroupByHandle(int int_1) </code>
| <code>bool IsInVRMode() </code>
| Unload a spawn group by ''handle''
| Checks if the game is running in VR mode.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.UpdateEventPoints | UpdateEventPoints]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.ListenToGameEvent|ListenToGameEvent]]
| <code>void UpdateEventPoints(handle handle_1) </code>
| <code>int ListenToGameEvent(string EventName, handle functionNameToCall, handle context) </code>
| No Description Set
| Register as a listener for a game event from script.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL_MessageText | UTIL_MessageText]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.LoadKeyValues|LoadKeyValues]]
| <code>void UTIL_MessageText(int playerId, string message, int r, int g, int b, int a) </code>
| <code>table LoadKeyValues(string string_1) </code>
| Displays a message for a specific player
| Creates a ''table'' from the specified keyvalues text file
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL_MessageText_WithContext | UTIL_MessageText_WithContext]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.LoadKeyValuesFromString|LoadKeyValuesFromString]]
| <code>void UTIL_MessageText_WithContext(int playerId, string message, int r, int g, int b, int a, table context) </code>
| <code>table LoadKeyValuesFromString(string string_1) </code>
| Sends a message to a specific player in the message box with a context table
| Creates a ''table'' from the specified keyvalues ''string''
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL_MessageTextAll | UTIL_MessageTextAll]]
| [[SteamVR/Environments/Scripting/API/Global.LocalTime|LocalTime]]
| <code>void UTIL_MessageTextAll(string message, int r, int g, int b, int a) </code>
| <code>table LocalTime() </code>
| Sends a message to everyone in the message box
| Returns the local system time as a table with the format {Hours = int; Minutes = int; Seconds = int}
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL_MessageTextAll_WithContext | UTIL_MessageTextAll_WithContext]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.MakeStringToken|MakeStringToken]]
| <code>void UTIL_MessageTextAll_WithContext(string message, int r, int g, int b, int a, table context) </code>
| <code>int MakeStringToken(string string_1) </code>
| Sends a message to everyone in the message box with a context table
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL_Remove | UTIL_Remove]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.RegisterSpawnGroupFilterProxy|RegisterSpawnGroupFilterProxy]]
| <code>void UTIL_Remove(handle handle_1) </code>
| <code>void RegisterSpawnGroupFilterProxy(string string_1) </code>
| Removes the specified entity
| Create a C proxy for a script-based spawn group filter
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL_RemoveImmediate | UTIL_RemoveImmediate]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.ReloadMOTD|ReloadMOTD]]
| <code>void UTIL_RemoveImmediate(handle handle_1) </code>
| <code>void ReloadMOTD() </code>
| Do Not use this function.  Use UTIL_Remove() instead.  This will crash your game.
| Reloads the MotD file
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL_ResetMessageText | UTIL_ResetMessageText]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.RemoveSpawnGroupFilterProxy|RemoveSpawnGroupFilterProxy]]
| <code>void UTIL_ResetMessageText(int playerId) </code>
| <code>void RemoveSpawnGroupFilterProxy(string string_1) </code>
| Resets the message text for the player
| Remove the C proxy for a script-based spawn group filter
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.UTIL_ResetMessageTextAll | UTIL_ResetMessageTextAll]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.rr AddDecisionRule|rr_AddDecisionRule]]
| <code>void UTIL_ResetMessageTextAll() </code>
| <code>bool rr_AddDecisionRule(handle handle_1) </code>
| Resets the message text for all players
| Add a rule to the decision database.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.VectorToAngles | VectorToAngles]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.rr CommitAIResponse|rr_CommitAIResponse]]
| <code>QAngle VectorToAngles(Vector Vector_1) </code>
| <code>bool rr_CommitAIResponse(handle handle_1, handle handle_2) </code>
| Get Qangles (with no roll) for a ''Vector''.
| Commit the result of QueryBestResponse back to the given entity to play. Call with params (entity, airesponse)
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Global.Warning | Warning]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.rr GetResponseTargets|rr_GetResponseTargets]]
| <code>void Warning(string string_1) </code>
| <code>handle rr_GetResponseTargets() </code>
| Print a warning
| Retrieve a ''table'' of all available expresser targets, in the form { name : ''handle'', name: ''handle'' }.
|}
 
== Classes ==
 
=== CBaseEntity ===
The base class for entities.
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.AddEffects | AddEffects]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.rr QueryBestResponse|rr_QueryBestResponse]]
| <code>void AddEffects(int nFlags) </code>
| <code>bool rr_QueryBestResponse(handle handle_1, handle handle_2, handle handle_3) </code>
| AddEffects( int ): Adds the render effect flag.
| Params: ( hEnt, hQuery, hResult ) // Static : tests 'query' against entity's response system and returns the best response found (or ''nil'' if none found).
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.ApplyAbsVelocityImpulse | ApplyAbsVelocityImpulse]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.ScreenShake|ScreenShake]]
| <code>void ApplyAbsVelocityImpulse(Vector vecImpulse) </code>
| <code>void ScreenShake(Vector Vector_1, float float_2, float float_3, float float_4, float float_5, int int_6, bool bool_7) </code>
| Apply a Velocity Impulse
| Start a screenshake with the following parameters. vecCenter, flAmplitude, flFrequency, flDuration, flRadius, eCommand( SHAKE_START = 0, SHAKE_STOP = 1 ), bAirShake
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.ApplyLocalAngularVelocityImpulse | ApplyLocalAngularVelocityImpulse]]
| [[SteamVR/Environments/Scripting/API/GlobaloScriptAssert|ScriptAssert]]
| <code>void ApplyLocalAngularVelocityImpulse(Vector angImpulse) </code>
| <code>void ScriptAssert(bool ''assertion'', string ''message'' = "") </code>
| Apply an Ang Velocity Impulse
| Asserts the passed in value. Prints out a message and brings up the assert dialog.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Attribute_GetFloatValue | Attribute_GetFloatValue]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.SendToConsole|SendToConsole]]
| <code>float Attribute_GetFloatValue(string pName, float flDefault) </code>
| <code>void SendToConsole(string string_1) </code>
| Get float value for an entity attribute.
| Send a ''string'' to the console as a client command
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Attribute_GetIntValue | Attribute_GetIntValue]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.SendToServerConsole|SendToServerConsole]]
| <code>float Attribute_GetIntValue(string pName, int nDefault) </code>
| <code>void SendToServerConsole(string string_1) </code>
| Get int value for an entity attribute.
| Send a ''string'' to the console as a server command
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Attribute_SetFloatValue | Attribute_SetFloatValue]]
| [[SteamVR/Environments/Scripting/API/Global.SetInSteamVRTutorialMode|SetInSteamVRTutorialMode]]
| <code>void Attribute_SetFloatValue(string pName, float flValue) </code>
| <code>void SetInSteamVRTutorialMode(bool ''inTutorialMode'')</code>
| Set float value for an entity attribute.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Attribute_SetIntValue | Attribute_SetIntValue]]
| [[SteamVR/Environments/Scripting/API/Global.SetNearZ|SetNearZ]]
| <code>void Attribute_SetIntValue(string pName, int nValue) </code>
| <code>void SetNearZ(handle ''player'', float ''distance'') </code>
| Set int value for an entity attribute.
| Sets near z value for the given player.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.DeleteAttribute | DeleteAttribute]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.SetQuestName|SetQuestName]]
| <code>void DeleteAttribute(string pName) </code>
| <code>void SetQuestName(string string_1) </code>
| Delete an entity attribute.
| Set the current quest name.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.EmitSound | EmitSound]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.SetQuestPhase|SetQuestPhase]]
| <code>void EmitSound(string soundName) </code>
| <code>void SetQuestPhase(int int_1) </code>
|
| Set the current quest phase.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.EmitSoundParams | EmitSoundParams]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.StopListeningToAllGameEvents|StopListeningToAllGameEvents]]
| <code>void EmitSoundParams(string soundName, int pitch, float volume, float soundTime) </code>
| <code>void StopListeningToAllGameEvents(handle handle_1) </code>
| Plays/modifies a sound from this entity. changes sound if Pitch and/or Volume or SoundTime is > 0.
| Stop listening to all game events within a specific context.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.EyeAngles | EyeAngles]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.StopListeningToGameEvent|StopListeningToGameEvent]]
| <code>QAngle EyeAngles() </code>
| <code>bool StopListeningToGameEvent(int int_1) </code>
| Get the qangles that this entity is looking at.
| Stop listening to a particular game event.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.EyePosition | EyePosition]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.StringToFile|StringToFile]]
| <code>Vector EyePosition() </code>
| <code>bool StringToFile(string a, string b) </code>
| Get ''vector'' to eye position - absolute coords
| * Directory traversal doesn't seem to work. The characters '.', '/' and '\\' are ignored.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.FirstMoveChild | FirstMoveChild]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.Time|Time]]
| <code>handle FirstMoveChild() </code>
| <code>float Time() </code>
| No Description Set
| Get the current server time
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.FollowEntity| FollowEntity]]
| [[SteamVR/Environments/Scripting/API/Global.UniqueString|UniqueString]]
| <code>void FollowEntity(handle ''hEntity'', bool ''bBoneMerge'') </code>
| <code>string UniqueString(string ''root'' = "") </code>
| hEntity to follow, bool bBoneMerge
| Generate a string guaranteed to be unique across the life of the script VM, with an optional root string. Useful for adding data to table's when not sure what keys are already in use in that table.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GatherCriteria | GatherCriteria]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.UnloadSpawnGroup|UnloadSpawnGroup]]
| <code>void GatherCriteria(handle hResult) </code>
| <code>void UnloadSpawnGroup(string string_1) </code>
| Returns a ''table'' containing the criteria that would be used for response queries on this entity. This is the same as the ''table'' that is passed to response rule script function callbacks.
| Unload a spawn group by name
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetAbsOrigin | GetAbsOrigin]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.UnloadSpawnGroupByHandle|UnloadSpawnGroupByHandle]]
| <code>Vector GetAbsOrigin() </code>
| <code>void UnloadSpawnGroupByHandle(int int_1) </code>
| No Description Set
| Unload a spawn group by ''handle''
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetAngles | GetAngles]]
| [[Dota 2 Workshop Tools/Scripting/API/Global.UpdateEventPoints|UpdateEventPoints]]
| <code>QAngle GetAngles() </code>
| <code>void UpdateEventPoints(handle handle_1) </code>
| No Description Set
| No Description Set
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetAnglesAsVector | GetAnglesAsVector]]
|}
| <code>Vector GetAnglesAsVector() </code>
 
| Get entity pitch, yaw, roll as a ''vector''
 
=== VLua ===
 
Functions automatically included from the library.lua core library. Located in the <code>vlua</code> table rather than directly in the global scope.
 
''Library functions to support Lua code generated by Sq2Lua.exe''
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
| [[SteamVR/Environments/Scripting/API/Global.vlua.clear|vlua.clear]]
| <code>table vlua.clear(table ''t'') </code>
| Implements Squirrel clear table method.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetAngularVelocity | GetAngularVelocity]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.compare|vlua.compare]]
| <code>Vector GetAngularVelocity() </code>
| <code>int vlua.compare(float ''a'', float ''b'') </code>
| Get the local angular velocity - returns a ''vector'' of pitch,yaw,roll
| Implements Squirrel three way compare operator ( <=> ).
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetBaseVelocity | GetBaseVelocity]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.contains|vlua.contains]]
| <code>Vector GetBaseVelocity() </code>
| <code>bool vlua.contains(table ''t'', variable ''key'') </code>
| Get Base velocity
| Implements Squirrel ''in'' operator.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetBoundingMaxs | GetBoundingMaxs]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.delete|vlua.delete]]
| <code>Vector GetBoundingMaxs() </code>
| <code>int vlua.delete(table ''t'', variable ''key'') </code>
| Get a ''vector'' containing max bounds, centered on object
| Implements Squirrel slot delete operator.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetBoundingMins | GetBoundingMins]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.clone|vlua.clone]]
| <code>Vector GetBoundingMins() </code>
| <code>int vlua.clone(table ''t'') </code>
| Get a ''vector'' containing min bounds, centered on object
| Implements Squirrel clone operator.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetBounds | GetBounds]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.rawdelete|vlua.rawdelete]]
| <code>table GetBounds() </code>
| <code>int vlua.rawdelete(table ''t'', variable ''key'') </code>
| Get a ''table'' containing the 'Mins' & 'Maxs' ''vector'' bounds, centered on object
| Implements Squirrel rawdelete library function.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetCenter | GetCenter]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.rawin|vlua.rawin]]
| <code>Vector GetCenter() </code>
| <code>int vlua.rawin(table ''t'', variable ''key'') </code>
| Get ''vector'' to center of object - absolute coords
| Implements Squirrel rawin library function.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetChildren | GetChildren]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.find|vlua.find]]
| <code>handle GetChildren() </code>
| <code>variable vlua.find([table/string] ''o'', variable ''value'', [int ''startIndex'']) </code>
| Get the entities parented to this entity.
| Implements Squirrel find method for tables and strings. (o, substr, [startidx]) for strings, (o, value) for tables
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetContext | GetContext]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.slice|vlua.slice]]
| <code>table GetContext(string name) </code>
| <code>variable vlua.slice([table/string] ''o'', int ''startIndex'', [int ''endIndex'']) </code>
| GetContext( name ): looks up a context and returns it if available. May return ''string'', ''float'', or ''nil'' (if the context isn't found)
| Implements Squirrel slice method for tables and strings.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetForwardVector | GetForwardVector]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.reverse|vlua.reverse]]
| <code>Vector GetForwardVector() </code>
| <code>table vlua.reverse(table ''o'') </code>
| Get the forward ''vector'' of the entity
| Implements Squirrel reverse method for tables.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetHealth | GetHealth]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.resize|vlua.resize]]
| <code>int GetHealth() </code>
| <code>table vlua.resize(string ''o'', int ''size'', [variable ''fill'']) </code>
| No Description Set
| Implements Squirrel resize method for tables.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetLocalAngularVelocity | GetLocalAngularVelocity]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.extend|vlua.extend]]
| <code>QAngle GetLocalAngularVelocity() </code>
| <code>table vlua.extend(table ''o'', array ''array'') </code>
| Maybe local angvel
| Implements Squirrel extend method for tables.
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.GetLocalAngles| GetLocalAngles]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.map|vlua.map]]
| <code>QAngle GetLocalAngles() </code>
| <code>table vlua.map(table ''o'', function ''mapFunc'') </code>
| Get entity local pitch, yaw, roll as a QAngle.
| Implements Squirrel map method for tables.
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.GetLocalOrigin | GetLocalOrigin]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.reduce|vlua.reduce]]
| <code>Vector GetLocalOrigin() </code>
| <code>table vlua.reduce(table ''o'', function ''reduceFunc'') </code>
| Get entity local origin as a Vector.
| Implements Squirrel reduce method for tables.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetLocalVelocity | GetLocalVelocity]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.tableadd|vlua.tableadd]]
| <code>Vector GetLocalVelocity() </code>
| <code>table vlua.tableadd (table ''t1'', table ''t2'') </code>
| Get Entity relative velocity
| Implements tableadd function to support += paradigm used in Squirrel.
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.GetMass | GetMass]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.split|vlua.split]]
| <code>float GetMass() </code>
| <code>table vlua.split(string ''input'', string ''separator'') </code>
| Get the mass of an entity. (returns 0 if it doesn't have a physics object)
| Implements Squirrel split function for strings.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetMaxHealth | GetMaxHealth]]
| [[SteamVR/Environments/Scripting/API/Global.vlua.select|vlua.select]]
| <code>int GetMaxHealth() </code>
| <code>variable vlua.select(bool ''conditional'', variable ''valueIfTrue'', variable ''valueIfFalse'') </code>
| No Description Set
| Safe Ternary operator. The Lua version will return the wrong value if the value if true is nil.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetModelName | GetModelName]]
|}
| <code>string GetModelName() </code>
 
| Returns the name of the model
== Classes ==
 
=== CBaseEntity ===
The base class for entities.
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetMoveParent | GetMoveParent]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.AddEffects|AddEffects]]
| <code>handle GetMoveParent() </code>
| <code>void AddEffects(int nFlags) </code>
| If in hierarchy, retrieves the entity's parent
| AddEffects( int ): Adds the render effect flag.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetOrigin | GetOrigin]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.ApplyAbsVelocityImpulse|ApplyAbsVelocityImpulse]]
| <code>Vector GetOrigin() </code>
| <code>void ApplyAbsVelocityImpulse(Vector vecImpulse) </code>
| No Description Set
| Apply a Velocity Impulse.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetOwner | GetOwner]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.ApplyLocalAngularVelocityImpulse|ApplyLocalAngularVelocityImpulse]]
| <code>handle GetOwner() </code>
| <code>void ApplyLocalAngularVelocityImpulse(Vector angImpulse) </code>
| Gets this entity's owner
| Apply an Angular Velocity Impulse.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetOwnerEntity | GetOwnerEntity]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Attribute GetFloatValue|Attribute_GetFloatValue]]
| <code>handle GetOwnerEntity() </code>
| <code>float Attribute_GetFloatValue(string pName, float flDefault) </code>
| Get the owner entity, if there is one
| Get float value for an entity attribute.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetRightVector | GetRightVector]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Attribute GetIntValue|Attribute_GetIntValue]]
| <code>Vector GetRightVector() </code>
| <code>float Attribute_GetIntValue(string pName, int nDefault) </code>
| Get the right ''vector'' of the entity
| Get int value for an entity attribute.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Attribute SetFloatValue|Attribute_SetFloatValue]]
| <code>void Attribute_SetFloatValue(string pName, float flValue) </code>
| Set float value for an entity attribute.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Attribute SetIntValue|Attribute_SetIntValue]]
| <code>void Attribute_SetIntValue(string pName, int nValue) </code>
| Set int value for an entity attribute.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetRootMoveParent | GetRootMoveParent]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.DeleteAttribute|DeleteAttribute]]
| <code>handle GetRootMoveParent() </code>
| <code>void DeleteAttribute(string pName) </code>
| If in hierarchy, walks up the hierarchy to find the root parent
| Delete an entity attribute.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetSoundDuration | GetSoundDuration]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.EmitSound|EmitSound]]
| <code>float GetSoundDuration(string soundName, string actormodelname) </code>
| <code>void EmitSound(string soundName) </code>
| Returns ''float'' duration of the sound. Takes soundname and optional actormodelname.
|
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetTeam | GetTeam]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.EmitSoundParams|EmitSoundParams]]
| <code>int GetTeam() </code>
| <code>void EmitSoundParams(string soundName, int pitch, float volume, float soundTime) </code>
| No Description Set
| Plays/modifies a sound from this entity. changes sound if Pitch and/or Volume or SoundTime is > 0.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetTeamNumber | GetTeamNumber]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.EyeAngles|EyeAngles]]
| <code>int GetTeamNumber() </code>
| <code>QAngle EyeAngles() </code>
| Get the team number of this entity.
| Get the QAngles that this entity is looking at.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetUpVector | GetUpVector]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.EyePosition|EyePosition]]
| <code>Vector GetUpVector() </code>
| <code>Vector EyePosition() </code>
| Get the up ''vector'' of the entity
| Get ''vector'' to eye position - absolute coords
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetVelocity | GetVelocity]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.FirstMoveChild|FirstMoveChild]]
| <code>Vector GetVelocity() </code>
| <code>handle FirstMoveChild() </code>
| No Description Set
| No Description Set
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.HasAttribute | HasAttribute]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.FollowEntity|FollowEntity]]
| <code>bool HasAttribute(string pName) </code>
| <code>void FollowEntity(handle ''hEntity'', bool ''bBoneMerge'') </code>
| See if an entity has a particular attribute.
| hEntity to follow, bool bBoneMerge
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.IsAlive | IsAlive]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GatherCriteria|GatherCriteria]]
| <code>bool IsAlive() </code>
| <code>void GatherCriteria(handle hResult) </code>
| No Description Set.
| Returns a ''table'' containing the criteria that would be used for response queries on this entity. This is the same as the ''table'' that is passed to response rule script function callbacks.
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.IsNPC | IsNPC]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetAbsOrigin|GetAbsOrigin]]
| <code>bool IsNPC() </code>
| <code>Vector GetAbsOrigin() </code>
| Is this entity an CAI_BaseNPC?
| Returns the world space origin of the entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.IsNull | IsNull]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.GetAbsScale|GetAbsScale]]
| <code>bool IsNull() </code>
| <code>float GetAbsScale() </code>
| Detect entity has been deleted from C++
| Get the absolute entity scale.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.IsPlayer | IsPlayer]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetAngles|GetAngles]]
| <code>bool IsPlayer() </code>
| <code>QAngle GetAngles() </code>
| Is this a player entity?
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Kill | Kill]]
| <code>void Kill() </code>
| No Description Set
| No Description Set
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.NextMovePeer | NextMovePeer]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetAnglesAsVector|GetAnglesAsVector]]
| <code>handle NextMovePeer() </code>
| <code>Vector GetAnglesAsVector() </code>
| No Description Set
| Get entity pitch, yaw, roll as a ''vector''
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.OverrideFriction | OverrideFriction]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetAngularVelocity|GetAngularVelocity]]
| <code>void OverrideFriction(float duration, float friction) </code>
| <code>Vector GetAngularVelocity() </code>
| Takes duration, value for a temporary override
| Get the local angular velocity - returns a ''vector'' of pitch,yaw,roll
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.PrecacheScriptSound | PrecacheScriptSound]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetBaseVelocity|GetBaseVelocity]]
| <code>void PrecacheScriptSound(string soundname) </code>
| <code>Vector GetBaseVelocity() </code>
| Precache a sound for later playing.
| Get Base velocity. Only functional on prop_dynamic entities with the Scripted Movement property set.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.RemoveEffects | RemoveEffects]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetBoundingMaxs|GetBoundingMaxs]]
| <code>void RemoveEffects(int nFlags) </code>
| <code>Vector GetBoundingMaxs() </code>
| RemoveEffects( int ): Removes the render effect flag.
| Get a ''vector'' containing max bounds, centered on object
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.SetAbsAngles | SetAbsAngles]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetBoundingMins|GetBoundingMins]]
| <code>void SetAbsAngles(float ''fPitch'', float ''fYaw'', float ''fRoll'')</code>
| <code>Vector GetBoundingMins() </code>
| Set entity world space pitch, yaw, roll by component.
| Get a ''vector'' containing min bounds, centered on object
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetAbsOrigin | SetAbsOrigin]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetBounds|GetBounds]]
| <code>void SetAbsOrigin(Vector origin) </code>
| <code>table GetBounds() </code>
| Sets the world space entity origin.
| Get a ''table'' containing the 'Mins' & 'Maxs' ''vector'' bounds, centered on object
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetAngles | SetAngles]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetCenter|GetCenter]]
| <code>void SetAngles(float pitch, float yaw, float roll) </code>
| <code>Vector GetCenter() </code>
| Set entity pitch, yaw, roll by component. If parented, this is set relative to the parents local space.
| Get ''vector'' to center of object - absolute coords
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetAngularVelocity | SetAngularVelocity]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetChildren|GetChildren]]
| <code>void SetAngularVelocity(float pitch, float yaw, float roll) </code>
| <code>handle GetChildren() </code>
| Set the local angular velocity - takes ''float'' pitch,yaw,roll velocities
| Get the entities parented to this entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetConstraint | SetConstraint]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetContext|GetContext]]
| <code>void SetConstraint(Vector vPos) </code>
| <code>table GetContext(string name) </code>
| Set the position of the constraint.
| GetContext( name ): looks up a context and returns it if available. May return ''string'', ''float'', or ''nil'' (if the context isn't found)
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetContext | SetContext]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetForwardVector|GetForwardVector]]
| <code>void SetContext(string pName, string pValue, float duration) </code>
| <code>Vector GetForwardVector() </code>
| SetContext( name , value, duration ): store any key/value pair in this entity's dialog contexts. Value must be a ''string''. Will last for duration (set 0 to mean 'forever').
| Get the forward ''Vector'' of the entity
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetContextNum | SetContextNum]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetHealth|GetHealth]]
| <code>void SetContextNum(string pName, float fValue, float duration) </code>
| <code>int GetHealth() </code>
| SetContext( name , value, duration ): store any key/value pair in this entity's dialog contexts. Value must be a number (''int'' or ''float''). Will last for duration (set 0 to mean 'forever').
| No Description Set
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetContextThink | SetContextThink]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetLocalAngularVelocity|GetLocalAngularVelocity]]
| <code>void SetContextThink(string pszContextName, handle hThinkFunc, float flInterval) </code>
| <code>QAngle GetLocalAngularVelocity() </code>
| Set a think function on this entity.
| Get entity relative angular velocity. Only functional on prop_dynamic entities with the Scripted Movement property set.
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.SetEntityName| SetEntityName]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.GetLocalAngles|GetLocalAngles]]
| <code>void SetEntityName(string ''pName'') </code>
| <code>QAngle GetLocalAngles() </code>
| Set the name (targetname) of an entity.
| Get entity pitch, yaw, roll as a QAngle, in the space of the entity's parent or attachment point
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetForwardVector | SetForwardVector]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.GetLocalOrigin|GetLocalOrigin]]
| <code>void SetForwardVector(Vector forwardVec) </code>
| <code>Vector GetLocalOrigin() </code>
| Set the orientation of the entity to have this forward ''forwardVec''
| Get entity origin as a Vector, in the space of the entity's parent or attachment point.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetFriction | SetFriction]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.GetLocalScale|GetLocalScale]]
| <code>void SetFriction(float flFriction) </code>
| <code>float GetLocalScale() </code>
| Set PLAYER friction, ignored for objects
| Get the entity scale relative to that of its parent.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetGravity | SetGravity]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetLocalVelocity|GetLocalVelocity]]
| <code>void SetGravity(float flGravity) </code>
| <code>Vector GetLocalVelocity() </code>
| Set PLAYER gravity, ignored for objects
| Get Entity relative velocity. Only functional on prop_dynamic entities with the Scripted Movement property set.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetHealth | SetHealth]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.GetMass|GetMass]]
| <code>void SetHealth(int hp) </code>
| <code>float GetMass() </code>
| Get the mass of an entity. (returns 0 if it doesn't have a physics object)
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetMaxHealth|GetMaxHealth]]
| <code>int GetMaxHealth() </code>
| No Description Set
| No Description Set
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.SetLocalAngles| SetLocalAngles]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetModelName|GetModelName]]
| <code>void SetLocalAngles(float ''pitch'', float ''yaw'', float ''roll'') </code>
| <code>string GetModelName() </code>
| Set entity local pitch, yaw, roll by component.
| Returns the name of the model.
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.SetLocalOrigin| SetLocalOrigin]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetMoveParent|GetMoveParent]]
| <code>void SetLocalOrigin(Vector ''origin'')</code>
| <code>handle GetMoveParent() </code>
| Set entity local origin from a Vector.
| If in hierarchy, retrieves the entity's parent
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.SetMass | SetMass]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetOrigin|GetOrigin]]
| <code>void SetMass(float ''flMass'') </code>
| <code>Vector GetOrigin() </code>
| Set the mass of an entity. (does nothing if it doesn't have a physics object)
| Returns the origin of the entity, either in world space ot in its parents space if parented.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetMaxHealth | SetMaxHealth]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetOwner|GetOwner]]
| <code>void SetMaxHealth(int maxHP) </code>
| <code>handle GetOwner() </code>
| No Description Set
| Gets this entity's owner
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetOrigin | SetOrigin]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetOwnerEntity|GetOwnerEntity]]
| <code>void SetOrigin(Vector origin) </code>
| <code>handle GetOwnerEntity() </code>
| No Description Set
| Get the owner entity, if there is one
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetOwner | SetOwner]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetRightVector|GetRightVector]]
| <code>void SetOwner(handle owningEntity) </code>
| <code>Vector GetRightVector() </code>
| Sets this entity's owner.
| Get the right ''vector'' of the entity
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetParent | SetParent]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetRootMoveParent|GetRootMoveParent]]
| <code>void SetParent(handle hParent, string pAttachmentname) </code>
| <code>handle GetRootMoveParent() </code>
| Set the parent for this entity. The attachment is optional, pass an empty string or nil to not use it.
| If in hierarchy, walks up the hierarchy to find the root parent
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetTeam | SetTeam]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetSoundDuration|GetSoundDuration]]
| <code>void SetTeam(int team) </code>
| <code>float GetSoundDuration(string soundName, string actormodelname) </code>
| No Description Set
| Returns ''float'' duration of the sound. Takes soundname and optional actormodelname.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetVelocity | SetVelocity]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetTeam|GetTeam]]
| <code>void SetVelocity(Vector vecVelocity) </code>
| <code>int GetTeam() </code>
| No Description Set
| No Description Set
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.StopSound | StopSound]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetTeamNumber|GetTeamNumber]]
| <code>void StopSound(string soundName) </code>
| <code>int GetTeamNumber() </code>
| Stops the named sound playing from this entity.
| Get the team number of this entity.
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.TakeDamage | TakeDamage]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetUpVector|GetUpVector]]
| <code>int TakeDamage(damageinfo ''hInfo'') </code>
| <code>Vector GetUpVector() </code>
| Apply damage to this entity. Use CreateDamageInfo() to create a damageinfo object.
| Get the up ''vector'' of the entity
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Trigger | Trigger]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.GetVelocity|GetVelocity]]
| <code>void Trigger() </code>
| <code>Vector GetVelocity() </code>
| Fires off this entity's OnTrigger responses.
| World space velocity of the entity. Only functional on prop_dynamic entities with the Scripted Movement property set.
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.ValidatePrivateScriptScope | ValidatePrivateScriptScope]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.HasAttribute|HasAttribute]]
| <code>void ValidatePrivateScriptScope() </code>
| <code>bool HasAttribute(string pName) </code>
| Validates the private script scope and creates it if one doesn't exist.
| See if an entity has a particular attribute.
|}
 
==== Hooks ====
Adding a function with this signature to the entity script causes it to be called from code at the appropriate moment.
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.Activate| Activate]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.IsAlive|IsAlive]]
| <code>void Activate() </code>
| <code>bool IsAlive() </code>
| Called on [[Activate()]], after the entity has spawned. If the entity is spawned on map load, Activate() is called after all entities have spawned.
| No Description Set.
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.OnBreak| OnBreak]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.IsNPC|IsNPC]]
| <code>void OnBreak() </code>
| <code>bool IsNPC() </code>
| Called when a breakable entity is broken. {{todo|Find out what entity classes this works for?}}
| Is this entity an CAI_BaseNPC?
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.OnEntText| OnEntText]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.IsNull|IsNull]]
| <code>string OnEntText() </code>
| <code>bool IsNull() </code>
| Called every frame when [[ent_text]] is enabled on the entity. Return a string to be added to the ent_text printout.
| Detect entity has been deleted from C++
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.Precache| Precache]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.IsPlayer|IsPlayer]]
| <code>void Precache(CScriptPrecacheContext ''context'') </code>
| <code>bool IsPlayer() </code>
| Called when the entity is precached. Used to precache any additional resources needed by the script using the global Precache family of script functions.
| Is this a player entity?
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.Spawn| Spawn]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Kill|Kill]]
| <code>void Spawn(CScriptKeyValues ''spawnkeys'') </code>
| <code>void Kill() </code>
| Called on [[Spawn()]], just after the entity has been created, but before it has been initialized. Passes a CScriptKeyValues handle that can be used to query the entity spawn keyvalues.
| No Description Set
|-
|-
| [[Destinations/Scripting/API/CBaseEntity.UpdateOnRemove| UpdateOnRemove]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.NextMovePeer|NextMovePeer]]
| <code>void UpdateOnRemove() </code>
| <code>handle NextMovePeer() </code>
| Called before the entity is killed.
| No Description Set
|}
 
=== CEntityInstance ===
:::::extends [[#CBaseEntity| CBaseEntity]]
 
All entities inherit from this.
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.ConnectOutput | ConnectOutput]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.OverrideFriction|OverrideFriction]]
| <code>void ConnectOutput(string string_1, string string_2) </code>
| <code>void OverrideFriction(float duration, float friction) </code>
| Adds an I/O connection that will call the named function on this entity when the specified output fires.
| Takes duration, value for a temporary override
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.Destroy | Destroy]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.PrecacheScriptSound|PrecacheScriptSound]]
| <code>void Destroy() </code>
| <code>void PrecacheScriptSound(string soundname) </code>
| No Description Set
| Precache a sound for later playing.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.DisconnectOutput | DisconnectOutput]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.RemoveEffects|RemoveEffects]]
| <code>void DisconnectOutput(string string_1, string string_2) </code>
| <code>void RemoveEffects(int nFlags) </code>
| Removes a connected script function from an I/O event on this entity.
| RemoveEffects( int ): Removes the render effect flag.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.DisconnectRedirectedOutput | DisconnectRedirectedOutput]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.SetAbsAngles|SetAbsAngles]]
| <code>void DisconnectRedirectedOutput(string string_1, string string_2, handle handle_3) </code>
| <code>void SetAbsAngles(float ''fPitch'', float ''fYaw'', float ''fRoll'')</code>
| Removes a connected script function from an I/O event on the passed entity.
| Set entity world space pitch, yaw, roll by component.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.entindex | entindex]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetAbsOrigin|SetAbsOrigin]]
| <code>int entindex() </code>
| <code>void SetAbsOrigin(Vector origin) </code>
| No Description Set
| Sets the world space entity origin.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.FireOutput | FireOutput]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.SetAbsScale|SetAbsScale]]
| <code>void FireOutput(string outputName, handle activator, handle caller, table args, float delay) </code>
| <code>void SetAbsScale(float ''scale'') </code>
| Fire an entity output
| Set the absolute scale of the entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetClassname | GetClassname]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetAngles|SetAngles]]
| <code>string GetClassname() </code>
| <code>void SetAngles(float pitch, float yaw, float roll) </code>
| No Description Set
| Set entity pitch, yaw, roll by component. If parented, this is set relative to the parents local space.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetDebugName | GetDebugName]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetAngularVelocity|SetAngularVelocity]]
| <code>string GetDebugName() </code>
| <code>void SetAngularVelocity(float pitch, float yaw, float roll) </code>
| Get the entity name w/help if not defined (i.e. classname/etc)
| Set the local angular velocity - takes ''float'' pitch, yaw, roll velocities. Only functional on prop_dynamic entities with the Scripted Movement property set.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetEntityHandle | GetEntityHandle]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetConstraint|SetConstraint]]
| <code>ehandle GetEntityHandle() </code>
| <code>void SetConstraint(Vector vPos) </code>
| Get the entity as an EHANDLE
| Set the position of the constraint.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetEntityIndex | GetEntityIndex]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetContext|SetContext]]
| <code>int GetEntityIndex() </code>
| <code>void SetContext(string pName, string pValue, float duration) </code>
| No Description Set
| SetContext( name , value, duration ): store any key/value pair in this entity's dialog contexts. Value must be a ''string''. Will last for duration (set 0 to mean 'forever').
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetIntAttr | GetIntAttr]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetContextNum|SetContextNum]]
| <code>int GetIntAttr(string string_1) </code>
| <code>void SetContextNum(string pName, float fValue, float duration) </code>
| Get Integer Attribute
| SetContext( name , value, duration ): store any key/value pair in this entity's dialog contexts. Value must be a number (''int'' or ''float''). Will last for duration (set 0 to mean 'forever').
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetName | GetName]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetContextThink|SetContextThink]]
| <code>string GetName() </code>
| <code>void SetContextThink(string pszContextName, handle hThinkFunc, float flInterval) </code>
| No Description Set
| Set a think function on this entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetOrCreatePrivateScriptScope | GetOrCreatePrivateScriptScope]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.SetEntityName|SetEntityName]]
| <code>handle GetOrCreatePrivateScriptScope() </code>
| <code>void SetEntityName(string ''pName'') </code>
| Retrieve, creating if necessary, the private per-instance script-side data associated with an entity
| Set the name (targetname) of an entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetOrCreatePublicScriptScope | GetOrCreatePublicScriptScope]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetForwardVector|SetForwardVector]]
| <code>handle GetOrCreatePublicScriptScope() </code>
| <code>void SetForwardVector(Vector forwardVec) </code>
| Retrieve, creating if necessary, the public script-side data associated with an entity
| Set the orientation of the entity to have this forward ''forwardVec''
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetPrivateScriptScope | GetPrivateScriptScope]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetFriction|SetFriction]]
| <code>handle GetPrivateScriptScope() </code>
| <code>void SetFriction(float flFriction) </code>
| Retrieve the private per-instance script-side data associated with an entity
| Set PLAYER friction, ignored for objects
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetPublicScriptScope | GetPublicScriptScope]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetGravity|SetGravity]]
| <code>handle GetPublicScriptScope() </code>
| <code>void SetGravity(float flGravity) </code>
| Retrieve the public script-side data associated with an entity
| Set PLAYER gravity, ignored for objects
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.RedirectOutput | RedirectOutput]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetHealth|SetHealth]]
| <code>void RedirectOutput(string string_1, string string_2, handle handle_3) </code>
| <code>void SetHealth(int hp) </code>
| Adds an I/O connection that will call the named function on the passed entity when the specified output fires.
| No Description Set
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.RemoveSelf | RemoveSelf]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.SetLocalAngles|SetLocalAngles]]
| <code>void RemoveSelf() </code>
| <code>void SetLocalAngles(float ''pitch'', float ''yaw'', float ''roll'') </code>
| Delete this entity
| Set the entity pitch, yaw, roll by component, relative to the local space of the entity's parent or attachment point.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.SetIntAttr | SetIntAttr]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.SetLocalOrigin|SetLocalOrigin]]
| <code>void SetIntAttr(string string_1, int int_2) </code>
| <code>void SetLocalOrigin(Vector ''origin'')</code>
| Set Integer Attribute
| Set the entity origin from a Vector, relative to the local space of the entity's parent or attachment point.
|}
 
=== CBaseModelEntity ===
:::::extends [[#CBaseEntity| CBaseEntity]]
Entities with models inherit from this.
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Destinations/Scripting/API/CBaseModelEntity.GetMaterialGroupHash | GetMaterialGroupHash]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.SetLocalScale|SetLocalScale]]
| <code>unsigned GetMaterialGroupHash() </code>
| <code>void SetLocalScale(float ''scale'') </code>
| Get the material group hash of this entity.
| Set the entity scale relative to the entity's parent.
|-
|-
| [[Destinations/Scripting/API/CBaseModelEntity.GetMaterialGroupMask | GetMaterialGroupMask]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.SetMass|SetMass]]
| <code><unknown> GetMaterialGroupMask() </code>
| <code>void SetMass(float ''flMass'') </code>
| Get the mesh group mask of this entity.
| Set the mass of an entity. (does nothing if it doesn't have a physics object)
|-
|-
| [[Destinations/Scripting/API/CBaseModelEntity.GetRenderAlpha | GetRenderAlpha]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetMaxHealth|SetMaxHealth]]
| <code>int GetRenderAlpha() </code>
| <code>void SetMaxHealth(int ''maxHP'') </code>
| Get the alpha modulation of this entity.
| No Description Set
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetOrigin|SetOrigin]]
| <code>void SetOrigin(Vector ''origin'') </code>
| No Description Set
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetOwner|SetOwner]]
| <code>void SetOwner(handle ''owningEntity'') </code>
| Sets this entity's owner.
|-
|-
| [[Destinations/Scripting/API/CBaseModelEntity.GetRenderColor | GetRenderColor]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetParent|SetParent]]
| <code>Vector GetRenderColor() </code>
| <code>void SetParent(handle ''hParent'', string ''pAttachmentname'') </code>
| Get the render color of the entity.
| Set the parent for this entity. The attachment is optional, pass an empty string to not use it.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseModelEntity.SetLightGroup | SetLightGroup]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetTeam|SetTeam]]
| <code>void SetLightGroup(string ''pLightGroup'') </code>
| <code>void SetTeam(int ''team'') </code>
| Sets the light group of the entity.
| No Description Set
|-
|-
| [[Destinations/Scripting/API/CBaseModelEntity.SetMaterialGroup | SetMaterialGroup]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.SetThink|SetThink]]
| <code>void SetMaterialGroup(string ''pMaterialGroup'') </code>
| <code>void SetThink(function ''thinkFunction'', string thinkName, float ''initialDelay'') </code>
| Set the material group of this entity.
| Sets a thinker function to be called periodically.
|-
|-
| [[Destinations/Scripting/API/CBaseModelEntity.SetMaterialGroupHash | SetMaterialGroupHash]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.SetVelocity|SetVelocity]]
| <code>void SetMaterialGroupHash(uint32 ''nHash'') </code>
| <code>void SetVelocity(Vector ''vecVelocity'') </code>
| Set the material group hash of this entity.
| Sets the world space velocity of the entity. Only functional on prop_dynamic entities with the Scripted Movement property set.
|-
|-
| [[Destinations/Scripting/API/CBaseModelEntity.SetMaterialGroupMask | SetMaterialGroupMask]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.StopSound|StopSound]]
| <code>void SetMaterialGroupMask(uint64 ''nMeshGroupMask'') </code>
| <code>void StopSound(string ''soundName'') </code>
| Set the mesh group mask of this entity.
| Stops the named sound playing from this entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseModelEntity.SetModel | SetModel]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.StopThink|StopThink]]
| <code>void SetModel(string ''pModelName'') </code>
| <code>void StopThink (string ''thinkName'') </code>
| Changes the model of the entity. Make sure the new model is precached before using.
| Stops the named thinker function.
|-
|-
| [[Destinations/Scripting/API/CBaseModelEntity.SetRenderAlpha | SetRenderAlpha]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.TakeDamage|TakeDamage]]
| <code>void SetRenderAlpha(int ''nAlpha'') </code>
| <code>int TakeDamage(damageinfo ''hInfo'') </code>
| Set the alpha modulation of this entity.
| Apply damage to this entity. Use CreateDamageInfo() to create a damageinfo object.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseModelEntity.SetRenderColor | SetRenderColor]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.TransformPointEntityToWorld|TransformPointEntityToWorld]]
| <code>void SetRenderColor(int ''red'', int ''green'', int ''blue'') </code>
| <code>Vector TransformPointEntityToWorld(Vector ''vPoint'') </code>
| Sets the render color of the entity.
| Returns the input Vector transformed from entity to world space.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseModelEntity.SetRenderMode | SetRenderMode]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.TransformPointWorldToEntity|TransformPointWorldToEntity]]
| <code>void SetRenderMode(int ''nMode'') </code>
| <code>Vector TransformPointWorldToEntity(Vector ''vPoint'') </code>
| Sets the render mode of the entity.
| Returns the input Vector transformed from world to entity space.
|-
|-
| [[Destinations/Scripting/API/CBaseModelEntity.SetSingleMeshGroup | SetSingleMeshGroup]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseEntity.Trigger|Trigger]]
| <code>void SetSingleMeshGroup(string ''pMeshGroupName'') </code>
| <code>void Trigger() </code>
| Set a single mesh group for this entity.
| Fires off this entity's OnTrigger responses.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseModelEntity.SetSize | SetSize]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.ValidatePrivateScriptScope|ValidatePrivateScriptScope]]
| <code>void SetSize(Vector ''mins'', Vector ''maxs'') </code>
| <code>void ValidatePrivateScriptScope() </code>
|  
| Validates the private script scope and creates it if one doesn't exist.
|}
|}


 
==== Hooks ====
=== CBasePlayer ===
Adding a function with this signature to the entity script causes it to be called from code at the appropriate moment.
Entity class for players.
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Function  
! Function  
Line 1,092: Line 1,188:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/CBasePlayer.AreChaperoneBoundsVisible | AreChaperoneBoundsVisible]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.Activate|Activate]]
| <code>bool AreChaperoneBoundsVisible() </code>
| <code>void Activate(int ''activateType'') </code>
| Returns whether this player's chaperone bounds are visible.
| Called on [[Activate()]], after the entity has spawned. If the entity is spawned on map load, Activate() is called after all entities have spawned. The <code>activateType</code> parameter contains an enumeration as documented [[#Activation types|here]].
|-
|-
| [[Destinations/Scripting/API/CBasePlayer.EquipPropTool | EquipPropTool]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.OnBreak|OnBreak]]
| <code>void EquipPropTool(CDestinationsPropTool ''propTool'', int ''handId'') </code>
| <code>void OnBreak() </code>
| Equips the prop tool passed in the hand specified.
| Called when a breakable entity is broken. {{todo|Find out what entity classes this works for?}}
|-
|-
| [[Destinations/Scripting/API/CBasePlayer.GetHMDAnchor | GetHMDAnchor]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.OnEntText|OnEntText]]
| <code>handle GetHMDAnchor() </code>
| <code>string OnEntText() </code>
| Returns the HMD anchor entity for this player if it exists.
| Called every frame when [[ent text]] is enabled on the entity. Return a string to be added to the ent_text printout.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBasePlayer.GetHMDAvatar | GetHMDAvatar]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.OnTakeDamage|OnTakeDamage]]
| <code>CPropHMDAvatar GetHMDAvatar() </code>
| <code>unknown OnTakeDamage(table ''damageTable'') </code>
| Returns the HMD Avatar entity for this player if it exists.
| Called when the entity takes damage. Table format: {inflictor = handle, damage_direction = Vector, damage_position = Vector, damage_force = Vector, damage = int, attacker = handle} {{todo|Check if all entity calsses can take damage}}
|-
|-
| [[Destinations/Scripting/API/CBasePlayer.GetPlayArea | GetPlayArea]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.Precache|Precache]]
| <code>Vector GetPlayArea(int ''nPoint'') </code>
| <code>void Precache(CScriptPrecacheContext ''context'') </code>
| Returns the Vector position of the point you ask for. Pass 0-3 to get the four points.
| Called when the entity is precached. Used to precache any additional resources needed by the script using the global Precache family of script functions.
|-
|-
| [[Destinations/Scripting/API/CBasePlayer.GetUserID | GetUserID]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.Spawn|Spawn]]
| <code>int GetUserID() </code>
| <code>void Spawn(CScriptKeyValues ''spawnkeys'') </code>
| Returns the player's user ID.
| Called on [[Spawn()]], just after the entity has been created, but before it has been initialized. Passes a CScriptKeyValues handle that can be used to query the entity spawn keyvalues.
|-
|-
| [[Destinations/Scripting/API/CBasePlayer.GetVRControllerType | GetVRControllerType]]
| [[SteamVR/Environments/Scripting/API/CBaseEntity.UpdateOnRemove|UpdateOnRemove]]
| <code><unknown> GetVRControllerType() </code>
| <code>void UpdateOnRemove() </code>
| Returns the type of controller being used while in VR.
| Called before the entity is killed.
|-
|}
| [[Dota 2 Workshop Tools/Scripting/API/CBasePlayer.IsNoclipping | IsNoclipping]]
| <code>bool IsNoclipping() </code>
| Returns true if the player is in noclip mode.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBasePlayer.IsUsePressed | IsUsePressed]]
| <code>bool IsUsePressed() </code>
| Returns true if the use key is pressed.
|-
| [[Destinations/Scripting/API/CBasePlayer.IsVRControllerButtonPressed | IsVRControllerButtonPressed]]
| <code>bool IsVRControllerButtonPressed(int ''nButton'') </code>
| Returns true if the controller button is pressed.
|-
| [[Destinations/Scripting/API/CBasePlayer.IsVRDashboardShowing | IsVRDashboardShowing]]
| <code>bool IsVRDashboardShowing() </code>
| Returns true if the SteamVR dashboard is showing for this player.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBasePlayer.Quit | Quit]]
| <code>void Quit() </code>
| Quit the game from script.
|-
| [[Destinations/Scripting/API/CBasePlayer.RemovePropTool | RemovePropTool]]
| <code>void RemovePropTool(string ''pModelName'', int ''nHandId'') </code>
| Removes a prop tool from the players hand if it uses the model passed in.
|}


=== CEntityInstance ===
:::::extends [[#CBaseEntity|CBaseEntity]]


=== CSteamTours_Player ===
All entities inherit from this.
{{todo|Player subclass?}}


==== Methods ====
==== Methods ====
Line 1,155: Line 1,228:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/CSteamTours_Player.AllowTeleportFromHand | AllowTeleportFromHand]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.ConnectOutput|ConnectOutput]]
| <code>void AllowTeleportFromHand(int ''nHandID'', bool ''bTeleportAllowed'') </code>
| <code>void ConnectOutput(string string_1, string string_2) </code>
| Sets whether the player is allowed to teleport using the specified hand.
| Adds an I/O connection that will call the named function on this entity when the specified output fires.
|-
|-
| [[Destinations/Scripting/API/CSteamTours_Player.IsContentBrowserShowing | IsContentBrowserShowing]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.Destroy|Destroy]]
| <code>bool IsContentBrowserShowing() </code>
| <code>void Destroy() </code>
| Returns true if the content browser is showing.
| No Description Set
|-
|-
| [[Destinations/Scripting/API/CSteamTours_Player.IsTeleportAllowedFromHand | IsTeleportAllowedFromHand]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.DisconnectOutput|DisconnectOutput]]
| <code>bool IsTeleportAllowedFromHand(int ''nHandID'') </code>
| <code>void DisconnectOutput(string string_1, string string_2) </code>
| Checks to see if the player is allowed to teleport using the specified hand.
| Removes a connected script function from an I/O event on this entity.
|-
|-
| [[Destinations/Scripting/API/CSteamTours_Player.SetContentBrowserAllowed | SetContentBrowserAllowed]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.DisconnectRedirectedOutput|DisconnectRedirectedOutput]]
| <code>void SetContentBrowserAllowed(bool ''bAllowed'') </code>
| <code>void DisconnectRedirectedOutput(string string_1, string string_2, handle handle_3) </code>
| Sets whether the content browser is allowed to be brought up by the player.
| Removes a connected script function from an I/O event on the passed entity.
|-
|-
| [[Destinations/Scripting/API/CSteamTours_Player.SetIsInTutorialMode | SetIsInTutorialMode]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.entindex|entindex]]
| <code>void SetIsInTutorialMode(bool ''bTutorial'') </code>
| <code>int entindex() </code>
| Sets whether the player is in tutorial mode.
| No Description Set
|}
 
 
=== CBaseAnimating ===
:::::extends [[#CBaseEntity| CBaseEntity]]
A class containing methods involved in animations. Most model based entities inherit this.
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description  
|-
|-
| [[Destinations/Scripting/API/CBaseAnimating.ActiveSequenceDuration | ActiveSequenceDuration]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.FireOutput|FireOutput]]
| <code>float ActiveSequenceDuration() </code>
| <code>void FireOutput(string outputName, handle activator, handle caller, table args, float delay) </code>
| Returns the duration in seconds of the active sequence.
| Fire an entity output
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.GetAttachmentAngles | GetAttachmentAngles]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetClassname|GetClassname]]
| <code>Vector GetAttachmentAngles(int ''iAttachment'') </code>
| <code>string GetClassname() </code>
| Get the attachment id's angles as a p,y,r ''vector''
| No Description Set
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.GetAttachmentOrigin | GetAttachmentOrigin]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetDebugName|GetDebugName]]
| <code>Vector GetAttachmentOrigin(int ''iAttachmen''t) </code>
| <code>string GetDebugName() </code>
| Get the attachment id's origin ''vector''
| Get the entity name w/help if not defined (i.e. classname/etc)
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.GetModelScale | GetModelScale]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetEntityHandle|GetEntityHandle]]
| <code>float GetModelScale() </code>
| <code>ehandle GetEntityHandle() </code>
| Get scale of entity's model.
| Get the entity as an EHANDLE
|-
|-
| [[Destinations/Scripting/API/CBaseAnimating.GetSequence | GetSequence]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetEntityIndex|GetEntityIndex]]
| <code>string GetSequence() </code>
| <code>int GetEntityIndex() </code>
| Returns the name of the active sequence.
| No Description Set
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.IsSequenceFinished | IsSequenceFinished]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetIntAttr|GetIntAttr]]
| <code>bool IsSequenceFinished() </code>
| <code>int GetIntAttr(string string_1) </code>
| Ask whether the main sequence is done playing
| Get Integer Attribute
|-
|-
| [[Destinations/Scripting/API/CBaseAnimating.ResetSequence | ResetSequence]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetName|GetName]]
| <code>void ResetSequence(string ''pSequenceName'') </code>
| <code>string GetName() </code>
| Sets the active sequence by name, resetting the current cycle
| No Description Set
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.ScriptLookupAttachment | ScriptLookupAttachment]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetOrCreatePrivateScriptScope|GetOrCreatePrivateScriptScope]]
| <code>int ScriptLookupAttachment(string ''pAttachmentName'') </code>
| <code>handle GetOrCreatePrivateScriptScope() </code>
| Get the named attachment id
| Retrieve, creating if necessary, the private per-instance script-side data associated with an entity
|-
|-
| [[Destinations/Scripting/API/CBaseAnimating.SequenceDuration | SequenceDuration]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetOrCreatePublicScriptScope|GetOrCreatePublicScriptScope]]
| <code>float SequenceDuration(string ''pSequenceName'') </code>
| <code>handle GetOrCreatePublicScriptScope() </code>
| Returns the duration in seconds of the given sequence name.
| Retrieve, creating if necessary, the public script-side data associated with an entity
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.SetBodygroup | SetBodygroup]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetPrivateScriptScope|GetPrivateScriptScope]]
| <code>void SetBodygroup(int ''iGroup'', int ''iValue'') </code>
| <code>handle GetPrivateScriptScope() </code>
| Sets a bodygroup by index.
| Retrieve the private per-instance script-side data associated with an entity
|-
|-
| [[Destinations/Scripting/API/CBaseAnimating.SetBodygroupByName | SetBodygroupByName]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.GetPublicScriptScope|GetPublicScriptScope]]
| <code>void SetBodygroupByName(int ''iGroup'', int ''iValue'') </code>
| <code>handle GetPublicScriptScope() </code>
| Sets a bodygroup by name.
| Retrieve the public script-side data associated with an entity
|-
|-
| [[Destinations/Scripting/API/CBaseAnimating.SetGraphParameterBool | SetGraphParameterBool]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.RedirectOutput|RedirectOutput]]
| <code>void SetGraphParameterBool(string ''szName'', bool ''bValue'') </code>
| <code>void RedirectOutput(string string_1, string string_2, handle handle_3) </code>
| Set the specific boolean parameter on or off.
| Adds an I/O connection that will call the named function on the passed entity when the specified output fires.
|-
|-
| [[Destinations/Scripting/API/CBaseAnimating.SetGraphParameterFloat | SetGraphParameterFloat]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.RemoveSelf|RemoveSelf]]
| <code>void SetGraphParameterFloat(string ''szName'', float ''flValue'') </code>
| <code>void RemoveSelf() </code>
| Pass the float value to the specified parameter.
| Delete this entity
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.SetModelScale | SetModelScale]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntityInstance.SetIntAttr|SetIntAttr]]
| <code>void SetModelScale(float ''scale'') </code>
| <code>void SetIntAttr(string string_1, int int_2) </code>
| Sets the model's scale to <i>scale</i>, <br/>so if a unit had its model scale at 1, and you use <i>SetModelScale(<b>10.0</b>)</i>, it would set the scale to <b>10.0</b>.
| Set Integer Attribute
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.SetPoseParameter | SetPoseParameter]]
| <code>float SetPoseParameter(string ''szName'', float ''fValue'') </code>
| Set the specified pose parameter to the specified value.
|-
| [[Destinations/Scripting/API/CBaseAnimating.SetSequence | SetSequence]]
| <code>void SetSequence(string ''pSequenceName'') </code>
| Sets the active sequence by name, keeping the current cycle.
|}
|}


 
=== CBaseModelEntity ===
=== CBaseFlex ===
:::::extends [[#CBaseEntity|CBaseEntity]]
:::::extends [[#CBaseAnimating| CBaseAnimating]]
Entities with models inherit from this.
Animated entities that have vertex flex capability.


==== Methods ====
==== Methods ====
Line 1,263: Line 1,315:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseFlex.GetCurrentScene | GetCurrentScene]]
| [[SteamVR/Environments/Scripting/API/CBaseModelEntity.GetMaterialGroupHash|GetMaterialGroupHash]]
| <code>handle GetCurrentScene() </code>
| <code>unsigned GetMaterialGroupHash() </code>
| Returns the instance of the oldest active scene entity '''(if any).
| Get the material group hash of this entity.
|-
| [[SteamVR/Environments/Scripting/API/CBaseModelEntity.GetMaterialGroupMask|GetMaterialGroupMask]]
| <code><unknown> GetMaterialGroupMask() </code>
| Get the mesh group mask of this entity.
|-
| [[SteamVR/Environments/Scripting/API/CBaseModelEntity.GetRenderAlpha|GetRenderAlpha]]
| <code>int GetRenderAlpha() </code>
| Get the alpha modulation of this entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseFlex.GetSceneByIndex | GetSceneByIndex]]
| [[SteamVR/Environments/Scripting/API/CBaseModelEntity.GetRenderColor|GetRenderColor]]
| <code>handle GetSceneByIndex(int ''index'') </code>
| <code>Vector GetRenderColor() </code>
| Returns the instance of the scene entity at the specified index.
| Get the render color of the entity.
|-
|-
| [[Destinations/Scripting/API/CBaseFlex.ScriptPlayScene | ScriptPlayScene]]
| [[SteamVR/Environments/Scripting/API/CBaseModelEntity.SetBodygroup|SetBodygroup]]
| <code>float ScriptPlayScene(string ''pszSceneFile'', float ''flDelay'') </code>
| <code>void SetBodygroup(int ''iGroup'', int ''iValue'') </code>
| Play the specified .vcd file.
| Sets a bodygroup by index.
|}
 
=== CBaseCombatCharacter ===
''No Description Set''
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseCombatCharacter.GetEquippedWeapons | GetEquippedWeapons]]
| [[SteamVR/Environments/Scripting/API/CBaseModelEntity.SetBodygroupByName|SetBodygroupByName]]
| <code>table GetEquippedWeapons() </code>
| <code>void SetBodygroupByName(int ''iGroup'', int ''iValue'') </code>
| Returns an array of all the equipped weapons
| Sets a bodygroup by name.
|-
|-
| [[Destinations/Scripting/API/CBaseCombatCharacter.GetFaction | GetFaction]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseModelEntity.SetLightGroup|SetLightGroup]]
| <code>int GetFaction() </code>
| <code>void SetLightGroup(string ''pLightGroup'') </code>
| Get the combat character faction.
| Sets the light group of the entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseCombatCharacter.GetWeaponCount | GetWeaponCount]]
| [[SteamVR/Environments/Scripting/API/CBaseModelEntity.SetMaterialGroup|SetMaterialGroup]]
| <code>int GetWeaponCount() </code>
| <code>void SetMaterialGroup(string ''pMaterialGroup'') </code>
| Gets the number of weapons currently equipped
| Set the material group of this entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseCombatCharacter.ShootPosition | ShootPosition]]
| [[SteamVR/Environments/Scripting/API/CBaseModelEntity.SetMaterialGroupHash|SetMaterialGroupHash]]
| <code>Vector ShootPosition(int ''nHand'') </code>
| <code>void SetMaterialGroupHash(uint32 ''nHash'') </code>
| Returns the shoot position eyes (or hand in VR).
| Set the material group hash of this entity.
|}
 
 
=== CBodyComponent ===
''No Description Set''
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.AddImpulseAtPosition | AddImpulseAtPosition]]
| [[SteamVR/Environments/Scripting/API/CBaseModelEntity.SetMaterialGroupMask|SetMaterialGroupMask]]
| <code>void AddImpulseAtPosition(Vector Vector_1, Vector Vector_2) </code>
| <code>void SetMaterialGroupMask(uint64 ''nMeshGroupMask'') </code>
| Apply an impulse at a worldspace position to the physics
| Set the mesh group mask of this entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.AddVelocity | AddVelocity]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseModelEntity.SetModel|SetModel]]
| <code>void AddVelocity(Vector Vector_1, Vector Vector_2) </code>
| <code>void SetModel(string ''pModelName'') </code>
| Add linear and angular velocity to the physics object
| Changes the model of the entity. Make sure the new model is precached before using.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.DetachFromParent | DetachFromParent]]
| [[SteamVR/Environments/Scripting/API/CBaseModelEntity.SetRenderAlpha|SetRenderAlpha]]
| <code>void DetachFromParent() </code>
| <code>void SetRenderAlpha(int ''nAlpha'') </code>
| Detach from its parent
| Set the alpha modulation of this entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.GetSequence | GetSequence]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseModelEntity.SetRenderColor|SetRenderColor]]
| <code><unknown> GetSequence() </code>
| <code>void SetRenderColor(int ''red'', int ''green'', int ''blue'') </code>
| Returns the active sequence
| Sets the render color of the entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.IsAttachedToParent | IsAttachedToParent]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseModelEntity.SetRenderMode|SetRenderMode]]
| <code>bool IsAttachedToParent() </code>
| <code>void SetRenderMode(int ''nMode'') </code>
| Is attached to parent
| Sets the render mode of the entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.LookupSequence | LookupSequence]]
| [[SteamVR/Environments/Scripting/API/CBaseModelEntity.SetSingleMeshGroup|SetSingleMeshGroup]]
| <code><unknown> LookupSequence(string string_1) </code>
| <code>void SetSingleMeshGroup(string ''pMeshGroupName'') </code>
| Returns a sequence id given a name
| Set a single mesh group for this entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.SequenceDuration | SequenceDuration]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseModelEntity.SetSize|SetSize]]
| <code>float SequenceDuration(string string_1) </code>
| <code>void SetSize(Vector ''mins'', Vector ''maxs'') </code>
| Returns the duration in seconds of the specified sequence
|  
|-
|}
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.SetAngularVelocity | SetAngularVelocity]]
 
| <code>void SetAngularVelocity(Vector Vector_1) </code>
 
| No Description Set
=== CBasePlayer ===
|-
Entity class for players.
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.SetAnimation | SetAnimation]]
| <code>void SetAnimation(string string_1) </code>
| Pass ''string'' for the animation to play on this model
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.SetBodyGroup | SetBodyGroup]]
| <code>void SetBodyGroup(string string_1) </code>
| No Description Set
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.SetMaterialGroup | SetMaterialGroup]]
| <code>void SetMaterialGroup(utlstringtoken utlstringtoken_1) </code>
| No Description Set
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.SetVelocity | SetVelocity]]
| <code>void SetVelocity(Vector velocity) </code>
| No Description Set
|}
 
 
=== CEntities ===
Provides methods to enumerate all server-side entities.
 
''Global accessor variable:'' <code>Entities</code>


==== Methods ====
==== Methods ====
Line 1,371: Line 1,390:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.CreateByClassname | CreateByClassname]]
| [[SteamVR/Environments/Scripting/API/CBasePlayer.AreChaperoneBoundsVisible|AreChaperoneBoundsVisible]]
| <code>handle CreateByClassname(string className) </code>
| <code>bool AreChaperoneBoundsVisible() </code>
| Creates an entity by class name.
| Returns whether this player's chaperone bounds are visible.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindAllByClassname | FindAllByClassname]]
| [[SteamVR/Environments/Scripting/API/CBasePlayer.EquipPropTool|EquipPropTool]]
| <code>table FindAllByClassname(string string_1) </code>
| <code>void EquipPropTool(CDestinationsPropTool ''propTool'', int ''handId'') </code>
| Finds all entities by class name. Returns an array containing all the found entities.
| Equips the prop tool passed in the hand specified.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindAllByClassnameWithin | FindAllByClassnameWithin]]
| [[SteamVR/Environments/Scripting/API/CBasePlayer.GetHMDAnchor|GetHMDAnchor]]
| <code>table FindAllByClassnameWithin(string string_1, Vector Vector_2, float float_3) </code>
| <code>handle GetHMDAnchor() </code>
| Find entities by class name within a radius.
| Returns the HMD anchor entity for this player if it exists.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindAllByModel | FindAllByModel]]
| [[Dota 2 Workshop Tools/Scripting/API/CBasePlayer.GetHMDAvatar|GetHMDAvatar]]
| <code>table FindAllByModel(string modelName) </code>
| <code>CPropHMDAvatar GetHMDAvatar() </code>
| Find entities by model name.
| Returns the HMD Avatar entity for this player if it exists.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindAllByName | FindAllByName]]
| [[SteamVR/Environments/Scripting/API/CBasePlayer.GetPlayArea|GetPlayArea]]
| <code>table FindAllByName(string name) </code>
| <code>Vector GetPlayArea(int ''nPoint'') </code>
| Find all entities by name. Returns an array containing all the found entities in it.
| Returns the Vector position of the point you ask for. Pass 0-3 to get the four points.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindAllByNameWithin | FindAllByNameWithin]]
| [[SteamVR/Environments/Scripting/API/CBasePlayer.GetUserID|GetUserID]]
| <code>table FindAllByNameWithin(string name, Vector origin, float maxRadius) </code>
| <code>int GetUserID() </code>
| Find entities by name within a radius.
| Returns the player's user ID.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindAllByTarget | FindAllByTarget]]
| [[SteamVR/Environments/Scripting/API/CBasePlayer.GetVRControllerType|GetVRControllerType]]
| <code>table FindAllByTarget(string targetName) </code>
| <code>int GetVRControllerType() </code>
| Find entities by targetname.
| Returns the type of controller being used while in VR. See list at the bottom of the page for controller types.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindAllInSphere | FindAllInSphere]]
| [[SteamVR/Environments/Scripting/API/CBasePlayer.IsActionActiveForHand|IsActionActiveForHand]]
| <code>table FindAllInSphere(Vector origin, float maxRadius) </code>
| <code>bool IsActionActiveForHand(int ''nLiteralHandType'', int ''nDigitalAction'') </code>
| Find entities within a radius.
| Returns true if the action is active for the given hand.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByClassname | FindByClassname]]
| [[Dota 2 Workshop Tools/Scripting/API/CBasePlayer.IsNoclipping|IsNoclipping]]
| <code>handle FindByClassname(handle startFrom, string className) </code>
| <code>bool IsNoclipping() </code>
| Find entities by class name. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
| Returns true if the player is in noclip mode.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByClassnameNearest | FindByClassnameNearest]]
| [[Dota 2 Workshop Tools/Scripting/API/CBasePlayer.IsUsePressed|IsUsePressed]]
| <code>handle FindByClassnameNearest(string className, Vector origin, float maxRadius) </code>
| <code>bool IsUsePressed() </code>
| Find entities by class name nearest to a point.
| Returns true if the use key is pressed.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByClassnameWithin | FindByClassnameWithin]]
| [[SteamVR/Environments/Scripting/API/CBasePlayer.IsVRControllerButtonPressed|IsVRControllerButtonPressed]]
| <code>handle FindByClassnameWithin(handle startFrom, string className, Vector origin, float maxRadius) </code>
| <code>bool IsVRControllerButtonPressed(int ''nButton'') </code>
| Find entities by class name within a radius. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
| Returns true if the controller button is pressed.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByModel | FindByModel]]
| [[SteamVR/Environments/Scripting/API/CBasePlayer.IsVRDashboardShowing|IsVRDashboardShowing]]
| <code>handle FindByModel(handle startFrom, string modelName) </code>
| <code>bool IsVRDashboardShowing() </code>
| Find entities by model name. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
| Returns true if the SteamVR dashboard is showing for this player.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByModelWithin | FindByModelWithin]]
| [[Dota 2 Workshop Tools/Scripting/API/CBasePlayer.Quit|Quit]]
| <code>handle FindByModelWithin(handle startFrom, string modelName, Vector origin, float maxRadius) </code>
| <code>void Quit() </code>
| Find entities by model name within a radius. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
| Quit the game from script.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByName | FindByName]]
| [[SteamVR/Environments/Scripting/API/CBasePlayer.RemovePropTool|RemovePropTool]]
| <code>handle FindByName(handle lastEnt, string searchString) </code>
| <code>void RemovePropTool(string ''pModelName'', int ''nHandId'') </code>
| Find entities by name. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
| Removes a prop tool from the players hand if it uses the model passed in.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByNameNearest | FindByNameNearest]]
| <code>handle FindByNameNearest(string name, Vector origin, float maxRadius) </code>
| Find entities by name nearest to a point.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByNameWithin | FindByNameWithin]]
| <code>handle FindByNameWithin(handle startFrom, string name, Vector origin, float maxRadius) </code>
| Find entities by name within a radius. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByTarget | FindByTarget]]
| <code>handle FindByTarget(handle startFrom, string targetName) </code>
| Find entities by targetname. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindInSphere | FindInSphere]]
| <code>handle FindInSphere(handle startFrom, Vector origin, float maxRadius) </code>
| Find entities within a radius. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.First | First]]
| <code>handle First() </code>
| Begin an iteration over the list of entities
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.Next | Next]]
| <code>handle Next(handle startFrom) </code>
| Continue an iteration over the list of entities, providing reference to a previously found entity
|}
|}




=== CAI_BaseNPC ===
=== CSteamTours_Player ===
''No Description Set''
{{todo|Player subclass?}}


==== Methods ====
==== Methods ====
Line 1,462: Line 1,457:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/CAI_BaseNPC.GetSquad | GetSquad]]
| [[SteamVR/Environments/Scripting/API/CSteamTours Player.AllowTeleportFromHand|AllowTeleportFromHand]]
| <code>handle GetSquad() </code>
| <code>void AllowTeleportFromHand(int ''nHandID'', bool ''bTeleportAllowed'') </code>
| Get the squad to which this NPC belongs.
| Sets whether the player is allowed to teleport using the specified hand.
|}
|-
 
| [[SteamVR/Environments/Scripting/API/CSteamTours Player.AreAnyVRControllersConnected|AreAnyVRControllersConnected]]
 
| <code>bool AreAnyVRControllersConnected() </code>
=== CBaseTrigger ===
| Checks to see if any VR controllers are present.
:::::extends [[#CBaseEntity| CBaseEntity]]
|-
Entity class for triggers.
| [[SteamVR/Environments/Scripting/API/CSteamTours Player.IsContentBrowserShowing|IsContentBrowserShowing]]
 
| <code>bool IsContentBrowserShowing() </code>
==== Methods ====
| Returns true if the content browser is showing.
{| class="standard-table" style="width: 100%;"
|-
! Function
| [[SteamVR/Environments/Scripting/API/CSteamTours Player.IsInventoryEnabledForHand|IsInventoryEnabledForHand]]
! Signature
| <code>bool IsInventoryEnabledForHand(int ''nHandID'') </code>
! Description
| Checks to see if the player is allowed to use the quick inventory for the specified hand.
|-
| [[SteamVR/Environments/Scripting/API/CSteamTours Player.IsTeleportAllowedFromHand|IsTeleportAllowedFromHand]]
| <code>bool IsTeleportAllowedFromHand(int ''nHandID'') </code>
| Checks to see if the player is allowed to teleport using the specified hand.
|-
| [[SteamVR/Environments/Scripting/API/CSteamTours Player.SetContentBrowserAllowed|SetContentBrowserAllowed]]
| <code>void SetContentBrowserAllowed(bool ''bAllowed'') </code>
| Sets whether the content browser is allowed to be brought up by the player.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseTrigger.Disable | Disable]]
| [[SteamVR/Environments/Scripting/API/CSteamTours Player.SetInventoryEnabledForHand|SetInventoryEnabledForHand]]
| <code>void Disable() </code>
| <code>void SetInventoryEnabledForHand(int ''nHandID'', bool ''bInventoryAllowed'') </code>
| Disable the trigger
| Sets whether the player is allowed to use the quick inventory for the specified hand.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseTrigger.Enable | Enable]]
| [[SteamVR/Environments/Scripting/API/CSteamTours Player.SetIsInTutorialMode|SetIsInTutorialMode]]
| <code>void Enable() </code>
| <code>void SetIsInTutorialMode(bool ''bTutorial'') </code>
| Enable the trigger
| Sets whether the player is in tutorial mode.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseTrigger.IsTouching | IsTouching]]
| [[SteamVR/Environments/Scripting/API/CSteamTours Player.SetSteamVRDashBoardEnabled|SetSteamVRDashBoardEnabled]]
| <code>bool IsTouching(handle hEnt) </code>
| <code>void SetSteamVRDashBoardEnabled(bool ''bEnabled'') </code>
| Checks whether the passed entity is touching the trigger.
| Control Availability of Dashboard. Only used by special cases, such as tutorials.
|}
|}




=== CDestinationsPropDrawing ===
=== CBaseAnimating ===
{{todo}}
:::::extends [[#CBaseEntity|CBaseEntity]]
A class containing methods involved in animations. Most model based entities inherit this.


==== Methods ====
==== Methods ====
Line 1,501: Line 1,505:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropDrawing.AddPointGlobal| AddPointGlobal]]
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.ActiveSequenceDuration|ActiveSequenceDuration]]
| <code>void AddPointGlobal(Vector ''vPos'', float ''flRadius'', Vector ''vColor'')</code>
| <code>float ActiveSequenceDuration() </code>
|  
| Returns the duration in seconds of the active sequence.
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropDrawing.AddPointLocal | AddPointLocal]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.GetAttachmentAngles|GetAttachmentAngles]]
| <code>void AddPointLocal(Vector ''vPos'', float ''flRadius'', Vector ''vColor'') </code>
| <code>Vector GetAttachmentAngles(int ''iAttachment'') </code>
|  
| Get the attachment id's angles as a p,y,r ''vector''
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropDrawing.BeginStroke | BeginStroke]]
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.GetAttachmentForward|GetAttachmentForward]]
| <code>void BeginStroke(Vector ''vOrigin'', string ''pParticleName'') </code>
| <code>Vector GetAttachmentForward(int ''iAttachment'') </code>
|  
| Get the attachment id's forward vector.
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropDrawing.EndStroke | EndStroke]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.GetAttachmentOrigin|GetAttachmentOrigin]]
| <code>void EndStroke() </code>
| <code>Vector GetAttachmentOrigin(int ''iAttachment'') </code>
|  
| Get the attachment id's origin ''vector''
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropDrawing.Finalize | Finalize]]
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.GetCycle|GetCycle]]
| <code>void Finalize() </code>
| <code>float GetCycle() </code>
|  
| Get the cycle of the animation.
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropDrawing.IsFinalized | IsFinalized]]
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.GetGraphParameter|GetGraphParameter]]
| <code>bool IsFinalized() </code>
| <code>table GetGraphParameter(string ''pszParam'') </code>
|  
| Get the value of the given animGraph parameter.
|}
 
 
=== CDestinationsPropItemPhysics ===
Entity class for [[prop_destinations_physics]].
 
Props spawned through the menu use this class.
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropItemPhysics.EnableUse| EnableUse]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.GetModelScale|GetModelScale]]
| <code>void EnableUse(bool ''bAllowUse'') </code>
| <code>float GetModelScale() </code>
| Enable (or disable) 'use' aka 'picking up' this entity.
| Get scale of entity's model.
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropItemPhysics.Freeze | Freeze]]
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.GetSequence|GetSequence]]
| <code>void Freeze(bool ''bFreeze'') </code>
| <code>string GetSequence() </code>
| Freeze (or unfreeze) this entity in place, but still allow use/pickup.
| Returns the name of the active sequence.
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropItemPhysics.GetCreator | GetCreator]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.IsSequenceFinished|IsSequenceFinished]]
| <code>CSteamTours_Player GetCreator() </code>
| <code>bool IsSequenceFinished() </code>
| Returns the (player) creator of this entity.
| Ask whether the main sequence is done playing
|-
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.ResetSequence|ResetSequence]]
| <code>void ResetSequence(string ''pSequenceName'') </code>
| Sets the active sequence by name, resetting the current cycle
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.ScriptLookupAttachment|ScriptLookupAttachment]]
| <code>int ScriptLookupAttachment(string ''pAttachmentName'') </code>
| Get the named attachment id
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropItemPhysics.IsFrozen | IsFrozen]]
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.SequenceDuration|SequenceDuration]]
| <code>bool IsFrozen() </code>
| <code>float SequenceDuration(string ''pSequenceName'') </code>
| Returns whether this entity is frozen in place.
| Returns the duration in seconds of the given sequence name.
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropItemPhysics.IsUseEnabled | IsUseEnabled]]
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.SetGraphLookTarget|SetGraphLookTarget]]
| <code>bool IsUseEnabled() </code>
| <code>void SetGraphLookTarget(Vector ''vValue'') </code>
| Returns whether 'use' aka 'picking up' is enabled on this entity.
| Pass the desired look target in world space to the graph.
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropItemPhysics.SetCreator | SetCreator]]
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.SetGraphParameter|SetGraphParameter]]
| <code>void SetCreator(CSteamTours_Player ''hCreator'') </code>
| <code>void SetGraphParameter(string ''pszParam'', table ''svArg'') </code>
| Sets the (player) creator of this entity.
| Set the specific param value, type is inferred from the type in script.
|}
 
==== Hooks ====
Adding a function with this signature to the entity script causes it to be called from code at the appropriate moment.
 
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropItemPhysics.OnPickedUp | OnPickedUp]]
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.SetGraphParameterBool|SetGraphParameterBool]]
| <code>void OnPickedUp(handle ''self'', CPropVRHand ''hand'') </code>
| <code>void SetGraphParameterBool(string ''szName'', bool ''bValue'') </code>
| Called when a player picks up the prop.  
| Set the specific boolean parameter on or off.
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropItemPhysics.OnDropped | OnDropped]]
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.SetGraphParameterEnum|SetGraphParameterEnum]]
| <code>void OnDropped(handle ''self'', CPropVRHand ''hand'') </code>
| <code>void SetGraphParameterEnum(string ''szName'', int ''nValue'') </code>
| Called when a player drops the prop.  
| Pass the enum (int) value to the specified param.
|}
|-
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.SetGraphParameterFloat|SetGraphParameterFloat]]
| <code>void SetGraphParameterFloat(string ''szName'', float ''flValue'') </code>
| Pass the float value to the specified parameter.
|-
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.SetGraphParameterInt|SetGraphParameterInt]]
| <code>void SetGraphParameterInt(string ''szName'', int ''nValue'') </code>
| Pass the int value to the specified param.
|-
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.SetGraphParameterVector|SetGraphParameterVector]]
| <code>void SetGraphParameterVector(string ''szName'', Vector ''vValue'') </code>
| Pass the vector value to the specified param in the graph.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.SetModelScale|SetModelScale]]
| <code>void SetModelScale(float ''scale'') </code>
| Sets the model's scale to ''scale'', <br/>so if a unit had its model scale at 1, and you use ''SetModelScale('''10.0''')'', it would set the scale to '''10.0'''.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseAnimating.SetPoseParameter|SetPoseParameter]]
| <code>float SetPoseParameter(string ''szName'', float ''fValue'') </code>
| Set the specified pose parameter to the specified value.
|-
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.SetProceduralIKTarget|SetProceduralIKTarget]]
| <code>bool SetProceduralIKTarget(string ''pChainName'', string ''pTargetName'', Vector ''vTargetPosition'', QAngle ''qTargetRotation'') </code>
| Sets the named procedural IK target.
|-
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.SetProceduralIKTargetWeight|SetProceduralIKTargetWeight]]
| <code>bool SetProceduralIKTargetWeight(string ''pChainName'', string ''pTargetName'', float ''flWeight'') </code>
| Sets the named procedural IK targets weight: 0 = full animation, 1 = full IK.
|-
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.SetSequence|SetSequence]]
| <code>void SetSequence(string ''pSequenceName'') </code>
| Sets the active sequence by name, keeping the current cycle.
|-
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.SetSkin|SetSkin]]
| <code>void SetSkin(int ''iSkin'') </code>
| Sets the model skin by index.
|-
| [[SteamVR/Environments/Scripting/API/CBaseAnimating.StopAnimation|StopAnimation]]
| <code>void StopAnimation() </code>
| Stop the current animation by setting playback rate to 0.0.
|}




=== CDestinationsPropTool===
=== CBaseFlex ===
Entity class for [[prop_destinations_tool]].
:::::extends [[#CBaseAnimating|CBaseAnimating]]
 
Animated entities that have vertex flex capability.
A generic tool prop that can be picked up by the player. The tool functionality is implemented using scripts. When picked up by the player, attaches to the <code>vr_controller_root</code> attachment of the model.


==== Methods ====
==== Methods ====
Line 1,592: Line 1,621:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropTool.ForceDropTool| ForceDropTool]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseFlex.GetCurrentScene|GetCurrentScene]]
| <code>void ForceDropTool() </code>
| <code>handle GetCurrentScene() </code>
| Drops the tool from the players hand.
| Returns the instance of the oldest active scene entity '''(if any).
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseFlex.GetSceneByIndex|GetSceneByIndex]]
| <code>handle GetSceneByIndex(int ''index'') </code>
| Returns the instance of the scene entity at the specified index.
|-
| [[SteamVR/Environments/Scripting/API/CBaseFlex.ScriptPlayScene|ScriptPlayScene]]
| <code>float ScriptPlayScene(string ''pszSceneFile'', float ''flDelay'') </code>
| Play the specified .vcd file.
|}
|}


==== Hooks ====
=== CBaseCombatCharacter ===
Adding a function with this signature to the entity script causes it to be called from code at the appropriate moment.
''No Description Set''
{{todo|May have more undocumented hooks}}
{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Function  
! Function  
Line 1,605: Line 1,641:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropTool.SetEquipped| SetEquipped]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseCombatCharacter.GetEquippedWeapons|GetEquippedWeapons]]
| <code>bool SetEquipped(handle ''self'', CPropVRHand ''pHand'', int ''nHandID'', handle ''pHandAttachment'', CBasePlayer ''pPlayer'') </code>
| <code>table GetEquippedWeapons() </code>
| Called when the player equips the tool. {{todo|Effect of the return value}}
| Returns an array of all the equipped weapons
|-
| [[SteamVR/Environments/Scripting/API/CBaseCombatCharacter.GetFaction|GetFaction]]
| <code>int GetFaction() </code>
| Get the combat character faction.
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropTool.SetUnequipped| SetUnequipped]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseCombatCharacter.GetWeaponCount|GetWeaponCount]]
| <code>bool SetUnequipped() </code>
| <code>int GetWeaponCount() </code>
| Called when the tool is unequipped.
| Gets the number of weapons currently equipped
|-
|-
| [[Destinations/Scripting/API/CDestinationsPropTool.OnHandleInput| OnHandleInput]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseCombatCharacter.ShootPosition|ShootPosition]]
| <code>table OnHandleInput(table ''input'') </code>
| <code>Vector ShootPosition(int ''nHand'') </code>
| Called every frame with the state of the motion controller inputs. Return the input table with bits toggled off in the members to disable the rest of the game from receiving the inputs.
| Returns the shoot position eyes (or hand in VR).
|}
|}




=== CDestinationsQuestGeocache ===
=== CBodyComponent ===
''No Description Set''
''No Description Set''


Line 1,628: Line 1,668:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/CDestinationsQuestGeocache.DisableCollision| DisableCollision]]
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.AddImpulseAtPosition|AddImpulseAtPosition]]
| <code>void DisableCollision() </code>
| <code>void AddImpulseAtPosition(Vector Vector_1, Vector Vector_2) </code>
| Disable physics collision for this entity.
| Apply an impulse at a worldspace position to the physics
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.AddVelocity|AddVelocity]]
| <code>void AddVelocity(Vector Vector_1, Vector Vector_2) </code>
| Add linear and angular velocity to the physics object
|-
|-
| [[Destinations/Scripting/API/CDestinationsQuestGeocache.EnableCollision| EnableCollision]]
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.DetachFromParent|DetachFromParent]]
| <code>void EnableCollision() </code>
| <code>void DetachFromParent() </code>
| Enable physics collision for this entity.
| Detach from its parent
|}
 
 
=== CEnvTimeOfDay2 ===
''No Description Set''
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Destinations/Scripting/API/CEnvTimeOfDay2.GetFloat | GetFloat]]
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.GetSequence|GetSequence]]
| <code>float GetFloat(utilstringtoken unknown, float unknown) </code>
| <code><unknown> GetSequence() </code>
| Lookup dynamic time-of-day float value.
| Returns the active sequence
|-
|-
| [[Destinations/Scripting/API/CEnvTimeOfDay2.GetVector | GetVector]]
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.IsAttachedToParent|IsAttachedToParent]]
| <code>Vector GetVector(utilstringtoken unknown, Vector unknown) </code>
| <code>bool IsAttachedToParent() </code>
| Lookup dynamic time-of-day vector value.
| Is attached to parent
|}
 
=== CEnvEntityMaker ===
:::::extends [[#CBaseEntity| CBaseEntity]]
Entity class for [[env_entity_maker]].
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEnvEntityMaker.SpawnEntity | SpawnEntity]]
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.LookupSequence|LookupSequence]]
| <code>void SpawnEntity() </code>
| <code><unknown> LookupSequence(string string_1) </code>
| Create an entity at the location of the maker
| Returns a sequence id given a name
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEnvEntityMaker.SpawnEntityAtEntityOrigin | SpawnEntityAtEntityOrigin]]
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.SequenceDuration|SequenceDuration]]
| <code>void SpawnEntityAtEntityOrigin(handle hEntity) </code>
| <code>float SequenceDuration(string string_1) </code>
| Create an entity at the location of a specified entity instance
| Returns the duration in seconds of the specified sequence
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEnvEntityMaker.SpawnEntityAtLocation | SpawnEntityAtLocation]]
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.SetAngularVelocity|SetAngularVelocity]]
| <code>void SpawnEntityAtLocation(Vector vecAlternateOrigin, Vector vecAlternateAngles) </code>
| <code>void SetAngularVelocity(Vector Vector_1) </code>
| Create an entity at a specified location and orientaton, orientation is Euler angle in degrees (pitch, yaw, roll)
| No Description Set
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.SetAnimation|SetAnimation]]
| <code>void SetAnimation(string string_1) </code>
| Pass ''string'' for the animation to play on this model
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.SetBodyGroup|SetBodyGroup]]
| <code>void SetBodyGroup(string string_1) </code>
| No Description Set
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.SetMaterialGroup|SetMaterialGroup]]
| <code>void SetMaterialGroup(utlstringtoken utlstringtoken_1) </code>
| No Description Set
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEnvEntityMaker.SpawnEntityAtNamedEntityOrigin | SpawnEntityAtNamedEntityOrigin]]
| [[Dota 2 Workshop Tools/Scripting/API/CBodyComponent.SetVelocity|SetVelocity]]
| <code>void SpawnEntityAtNamedEntityOrigin(string pszName) </code>
| <code>void SetVelocity(Vector velocity) </code>
| Create an entity at the location of a named entity
| No Description Set
|}
|}




=== CEntityScriptFramework ===
=== CEntities ===
''Interface to the C++-side of entity framework''
Provides methods to enumerate all server-side entities.


 
''Global accessor variable:'' <code>Entities</code>
''Global accessor variable:'' <code>EntityFramework</code>


==== Methods ====
==== Methods ====
No methods available.
==== Hooks ====
Called on the entity framework script.
{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Function  
! Function  
Line 1,701: Line 1,729:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/CEntityScriptFramework.CreateEntity| CreateEntity]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.CreateByClassname|CreateByClassname]]
| <code>void CreateEntity(string ''className'', handle ''instance'') </code>
| <code>handle CreateByClassname(string className) </code>
|  
| Creates an entity by class name.
|-
|-
| [[Destinations/Scripting/API/CEntityScriptFramework.DispatchActivate| DispatchActivate]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindAllByClassname|FindAllByClassname]]
| <code>bool DispatchActivate(handle ''entity'') </code>
| <code>table FindAllByClassname(string string_1) </code>
|  
| Finds all entities by class name. Returns an array containing all the found entities.
|-
|-
| [[Destinations/Scripting/API/CEntityScriptFramework.DispatchInput| DispatchInput]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindAllByClassnameWithin|FindAllByClassnameWithin]]
| <code>bool DispatchInput(string ''inputName'', table ''target'',unknown ''args'') </code>
| <code>table FindAllByClassnameWithin(string string_1, Vector Vector_2, float float_3) </code>
|  
| Find entities by class name within a radius.
|-
|-
| [[Destinations/Scripting/API/CEntityScriptFramework.DispatchPrecache| DispatchPrecache]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindAllByModel|FindAllByModel]]
| <code>void DispatchPrecache(handle ''entity'', CScriptPrecacheContext ''context'') </code>
| <code>table FindAllByModel(string modelName) </code>
|  
| Find entities by model name.
|-
|-
| [[Destinations/Scripting/API/CEntityScriptFramework.DispatchSpawn| DispatchSpawn]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindAllByName|FindAllByName]]
| <code>void DispatchSpawn(handle ''entity'', CScriptKeyValues''spawnkeys'') </code>
| <code>table FindAllByName(string name) </code>
|  
| Find all entities by name. Returns an array containing all the found entities in it.
|-
|-
| [[Destinations/Scripting/API/CEntityScriptFramework.DispatchUpdateOnRemove| DispatchUpdateOnRemove]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindAllByNameWithin|FindAllByNameWithin]]
| <code>bool DispatchUpdateOnRemove(handle ''entity'') </code>
| <code>table FindAllByNameWithin(string name, Vector origin, float maxRadius) </code>
|  
| Find entities by name within a radius.
|-
|-
| [[Destinations/Scripting/API/CEntityScriptFramework.GetClassNameOverride| GetClassNameOverride]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindAllByTarget|FindAllByTarget]]
| <code>string GetClassNameOverride(string ''className'') </code>
| <code>table FindAllByTarget(string targetName) </code>
|  
| Find entities by targetname.
|-
|-
| [[Destinations/Scripting/API/CEntityScriptFramework.GetDesignerNameForScriptClass| GetDesignerNameForScriptClass]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindAllInSphere|FindAllInSphere]]
| <code>string GetDesignerNameForScriptClass(string ''className'',handle ''instance'') </code>
| <code>table FindAllInSphere(Vector origin, float maxRadius) </code>
|  
| Find entities within a radius.
|-
|-
| [[Destinations/Scripting/API/CEntityScriptFramework.GetInputsForScriptClass| GetInputsForScriptClass]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByClassname|FindByClassname]]
| <code>table GetInputsForScriptClass(string ''scriptClassName'') </code>
| <code>handle FindByClassname(handle startFrom, string className) </code>
|  
| Find entities by class name. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
|-
|-
| [[Destinations/Scripting/API/CEntityScriptFramework.GetNativeClassForScriptClass| GetNativeClassForScriptClass]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByClassnameNearest|FindByClassnameNearest]]
| <code>string GetNativeClassForScriptClass(string ''scriptClassName'') </code>
| <code>handle FindByClassnameNearest(string className, Vector origin, float maxRadius) </code>
|  
| Find entities by class name nearest to a point.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByClassnameWithin|FindByClassnameWithin]]
| <code>handle FindByClassnameWithin(handle startFrom, string className, Vector origin, float maxRadius) </code>
| Find entities by class name within a radius. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
|-
|-
| [[Destinations/Scripting/API/CEntityScriptFramework.GetNativeOutputsForClass| GetNativeOutputsForClass]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByModel|FindByModel]]
| <code>CNativeOutputs GetNativeOutputsForClass(string ''scriptClassName'') </code>
| <code>handle FindByModel(handle startFrom, string modelName) </code>
|  
| Find entities by model name. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
|-
|-
| [[Destinations/Scripting/API/CEntityScriptFramework.GetScriptClassForDesignerName| GetScriptClassForDesignerName]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByModelWithin|FindByModelWithin]]
| <code>string GetScriptClassForDesignerName(string ''designerName'') </code>
| <code>handle FindByModelWithin(handle startFrom, string modelName, Vector origin, float maxRadius) </code>
|  
| Find entities by model name within a radius. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
|-
|-
| [[Destinations/Scripting/API/CEntityScriptFramework.InstallClasses| InstallClasses]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByName|FindByName]]
| <code>void InstallClasses() </code>
| <code>handle FindByName(handle lastEnt, string searchString) </code>
|  
| Find entities by name. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
|}
 
 
=== CMarkupVolumeTagged ===
''No Description Set''
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CMarkupVolumeTagged.HasTag | HasTag]]
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByNameNearest|FindByNameNearest]]
| <code>bool HasTag(string pszTagName) </code>
| <code>handle FindByNameNearest(string name, Vector origin, float maxRadius) </code>
| Does this volume have the given tag.
| Find entities by name nearest to a point.
|}
|-
 
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByNameWithin|FindByNameWithin]]
 
| <code>handle FindByNameWithin(handle startFrom, string name, Vector origin, float maxRadius) </code>
=== CScriptPrecacheContext ===
| Find entities by name within a radius. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
''Container to hold context published to precache functions in script''
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindByTarget|FindByTarget]]
| <code>handle FindByTarget(handle startFrom, string targetName) </code>
| Find entities by targetname. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.FindInSphere|FindInSphere]]
| <code>handle FindInSphere(handle startFrom, Vector origin, float maxRadius) </code>
| Find entities within a radius. Pass ''nil'' to start an iteration, or reference to a previously found entity to continue a search
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.First|First]]
| <code>handle First() </code>
| Begin an iteration over the list of entities
|-
| [[SteamVR/Environments/Scripting/API/CEntities.GetLocalPlayer|GetLocalPlayer]]
| <code>handle GetLocalPlayer() </code>
| Get the local player.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEntities.Next|Next]]
| <code>handle Next(handle startFrom) </code>
| Continue an iteration over the list of entities, providing reference to a previously found entity
|}
 
 
=== CAI_BaseNPC ===
''No Description Set''


==== Methods ====
==== Methods ====
Line 1,779: Line 1,824:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CScriptPrecacheContext.AddResource | AddResource]]
| [[SteamVR/Environments/Scripting/API/CAI BaseNPC.GetSquad|GetSquad]]
| <code>void AddResource(string string_1) </code>
| <code>handle GetSquad() </code>
| Precaches a specific resource
| Get the squad to which this NPC belongs.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CScriptPrecacheContext.GetValue | GetValue]]
| <code>''variable'' GetValue(string ''key'') </code>
| Reads a spawn key.
|}
|}




=== CScriptKeyValues ===
=== CBaseTrigger ===
Container holding keyvalues published to the Spawn() hook function.
:::::extends [[#CBaseEntity|CBaseEntity]]
Entity class for triggers.


==== Methods ====
==== Methods ====
Line 1,798: Line 1,840:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CScriptKeyValues.GetValue | GetValue]]
| [[Dota 2 Workshop Tools/Scripting/API/CBaseTrigger.Disable|Disable]]
| <code>''variable'' GetValue(string ''key'') </code>
| <code>void Disable() </code>
| Reads a spawn key.
| Disable the trigger
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseTrigger.Enable|Enable]]
| <code>void Enable() </code>
| Enable the trigger
|-
| [[Dota 2 Workshop Tools/Scripting/API/CBaseTrigger.IsTouching|IsTouching]]
| <code>bool IsTouching(handle hEnt) </code>
| Checks whether the passed entity is touching the trigger.
|}
|}




=== CNativeOutputs ===
=== CDestinationsGameTrophy ===
Container for holding outputs published by scripted entity classes to the game code.
Entity class for game trophies.


==== Methods ====
==== Methods ====
Line 1,813: Line 1,863:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CNativeOutputs.constructor | constructor ]]
| [[SteamVR/Environments/Scripting/API/CDestinationsGameTrophy.GetAccountID|GetAccountID]]
| <code>void CNativeOutputs() </code>
| <code>unsigned GetAccountID() </code>
| Creates a new CNativeOutputs object.
| Get owner's Steam accountid.
|-
| [[SteamVR/Environments/Scripting/API/CDestinationsGameTrophy.GetAchievementLevel|GetAchievementLevel]]
| <code>unsigned GetAchievementLevel() </code>
| Get achievement level.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CNativeOutputs.AddOutput | AddOutput]]
| [[SteamVR/Environments/Scripting/API/CDestinationsGameTrophy.GetAppID|GetAppID]]
| <code>void AddOutput(string ''outputName'', string ''description'') </code>
| <code>unsigned GetAppID() </code>
| Add an output.
| Get appid.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CNativeOutputs.Init | Init]]
| [[SteamVR/Environments/Scripting/API/CDestinationsGameTrophy.GetBadgeLevel|GetBadgeLevel]]
| <code>void Init(int ''numOutputs'') </code>
| <code>unsigned GetBadgeLevel() </code>
| Initialize with specified number of outputs.
| Get badge level.
|}
|}




=== CEnvProjectedTexture ===
=== CDestinationsPropDrawing ===
:::::extends [[#CBaseEntity| CBaseEntity]]
{{todo}}
Entity class for [[env_projected_texture]].


==== Methods ====
==== Methods ====
Line 1,837: Line 1,890:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEnvProjectedTexture.SetFarRange | SetFarRange]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropDrawing.AddPointGlobal|AddPointGlobal]]
| <code>void SetFarRange(float flRange) </code>
| <code>void AddPointGlobal(Vector ''vPos'', float ''flRadius'', Vector ''vColor'')</code>
| Set light maximum range
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEnvProjectedTexture.SetLinearAttenuation | SetLinearAttenuation]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropDrawing.AddPointLocal|AddPointLocal]]
| <code>void SetLinearAttenuation(float flAtten) </code>
| <code>void AddPointLocal(Vector ''vPos'', float ''flRadius'', Vector ''vColor'') </code>
| Set light linear attenuation value
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEnvProjectedTexture.SetNearRange | SetNearRange]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropDrawing.BeginStroke|BeginStroke]]
| <code>void SetNearRange(float flRange) </code>
| <code>void BeginStroke(Vector ''vOrigin'', string ''pParticleName'') </code>
| Set light minimum range
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEnvProjectedTexture.SetQuadraticAttenuation | SetQuadraticAttenuation]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropDrawing.EndStroke|EndStroke]]
| <code>void SetQuadraticAttenuation(float flAtten) </code>
| <code>void EndStroke() </code>
| Set light quadratic attenuation value
|
|-
| [[SteamVR/Environments/Scripting/API/CDestinationsPropDrawing.Finalize|Finalize]]
| <code>void Finalize() </code>
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEnvProjectedTexture.SetVolumetrics | SetVolumetrics]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropDrawing.IsFinalized|IsFinalized]]
| <code>void SetVolumetrics(bool bOn, float flIntensity, float flNoise, int nPlanes, float flPlaneOffset) </code>
| <code>bool IsFinalized() </code>
| Turn on/off light volumetrics: ''bool'' bOn, ''float'' flIntensity, ''float'' flNoise, ''int'' nPlanes, ''float'' flPlaneOffset
|  
|}
|}




=== CInfoData ===
=== CDestinationsPropItemPhysics ===
''No Description Set''
Entity class for [[prop destinations physics]].
 
Props spawned through the menu use this class.


==== Methods ====
==== Methods ====
Line 1,868: Line 1,927:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CInfoData.QueryColor | QueryColor]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropItemPhysics.EnableUse|EnableUse]]
| <code>Vector QueryColor(utlstringtoken tok, Vector vDefault) </code>
| <code>void EnableUse(bool ''bAllowUse'') </code>
| Query color data for this key
| Enable (or disable) 'use' aka 'picking up' this entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CInfoData.QueryFloat | QueryFloat]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropItemPhysics.Freeze|Freeze]]
| <code>float QueryFloat(utlstringtoken tok, float flDefault) </code>
| <code>void Freeze(bool ''bFreeze'') </code>
| Query ''float'' data for this key
| Freeze (or unfreeze) this entity in place, but still allow use/pickup.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CInfoData.QueryInt | QueryInt]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropItemPhysics.GetCreator|GetCreator]]
| <code>int QueryInt(utlstringtoken tok, int nDefault) </code>
| <code>CSteamTours_Player GetCreator() </code>
| Query ''int'' data for this key
| Returns the (player) creator of this entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CInfoData.QueryNumber | QueryNumber]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropItemPhysics.GetItemDefID|GetItemDefID]]
| <code>float QueryNumber(utlstringtoken tok, float flDefault) </code>
| <code>string GetItemDefID() </code>
| Query number data for this key
| Get the Item Definition ID from the ContentDB for this entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CInfoData.QueryString | QueryString]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropItemPhysics.GetPublishedFileID|GetPublishedFileID]]
| <code>string QueryString(utlstringtoken tok, string pDefault) </code>
| <code><unknown> GetPublishedFileID() </code>
| Query ''string'' data for this key
| Get the published file ID for this entity. The id will be 0 it was not published on the Steam workshop.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CInfoData.QueryVector | QueryVector]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropItemPhysics.IsFrozen|IsFrozen]]
| <code>Vector QueryVector(utlstringtoken tok, Vector vDefault) </code>
| <code>bool IsFrozen() </code>
| Query ''vector'' data for this key
| Returns whether this entity is frozen in place.
|-
| [[SteamVR/Environments/Scripting/API/CDestinationsPropItemPhysics.IsUseEnabled|IsUseEnabled]]
| <code>bool IsUseEnabled() </code>
| Returns whether 'use' aka 'picking up' is enabled on this entity.
|-
| [[SteamVR/Environments/Scripting/API/CDestinationsPropItemPhysics.SetCreator|SetCreator]]
| <code>void SetCreator(CSteamTours_Player ''hCreator'') </code>
| Sets the (player) creator of this entity.
|}
|}


==== Hooks ====
Adding a function with this signature to the entity script causes it to be called from code at the appropriate moment.


=== CPhysicsProp ===
Entity class for [[prop_physics]] and related classes.
==== Methods ====
{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Function  
! Function  
Line 1,903: Line 1,968:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/CPhysicsProp.SetDynamicVsDynamicContinuous| SetDynamicVsDynamicContinuous]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropItemPhysics.OnPickedUp|OnPickedUp]]
| <code>void SetDynamicVsDynamicContinuous(bool ''bIsDynamicVsDynamicContinuousEnabled'')</code>
| <code>void OnPickedUp(handle ''self'', CPropVRHand ''hand'') </code>
| Enable/disable dynamic vs dynamic continuous collision traces.
| Called when a player picks up the prop.  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CPhysicsProp.DisableMotion | DisableMotion]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropItemPhysics.OnDropped|OnDropped]]
| <code>void DisableMotion() </code>
| <code>void OnDropped(handle ''self'', CPropVRHand ''hand'') </code>
| Enable motion for the prop.
| Called when a player drops the prop.  
|-
| [[Dota 2 Workshop Tools/Scripting/API/CPhysicsProp.EnableMotion | EnableMotion]]
| <code>void EnableMotion() </code>
| Enable motion for the prop.
|}
|}


=== CDestinationsPropTool===
Entity class for [[prop destinations tool]].


=== CDebugOverlayScriptHelper ===
A generic tool prop that can be picked up by the player. The tool functionality is implemented using scripts. When picked up by the player, attaches to the <code>vr_controller_root</code> attachment of the model.
''No Description Set''


==== Methods ====
==== Methods ====
Line 1,926: Line 1,988:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Axis | Axis]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropTool.ForceDropTool|ForceDropTool]]
| <code>void Axis(Vector Vector_1, Quaternion Quaternion_2, float float_3, bool bool_4, float float_5) </code>
| <code>void ForceDropTool() </code>
| Draws an axis. Specify origin + orientation in world space.
| Drops the tool from the players hand.
|-
|}
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Box | Box]]
 
| <code>void Box(Vector Vector_1, Vector Vector_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) </code>
==== Hooks ====
| Draws a world-space axis-aligned box. Specify bounds in world space.
Adding a function with this signature to the entity script causes it to be called from code at the appropriate moment.
{{todo|May have more undocumented hooks}}
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.BoxAngles | BoxAngles]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropTool.SetEquipped|SetEquipped]]
| <code>void BoxAngles(Vector Vector_1, Vector Vector_2, Vector Vector_3, Quaternion Quaternion_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) </code>
| <code>bool SetEquipped(handle ''self'', CPropVRHand ''pHand'', int ''nHandID'', handle ''pHandAttachment'', CBasePlayer ''pPlayer'') </code>
| Draws an oriented box at the origin. Specify bounds in local space.
| Called when the player equips the tool. {{todo|Effect of the return value}}
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Capsule | Capsule]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropTool.SetUnequipped|SetUnequipped]]
| <code>void Capsule(Vector Vector_1, Quaternion Quaternion_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) </code>
| <code>bool SetUnequipped() </code>
| Draws a capsule. Specify base in world space.
| Called when the tool is unequipped.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Circle | Circle]]
| [[SteamVR/Environments/Scripting/API/CDestinationsPropTool.OnHandleInput|OnHandleInput]]
| <code>void Circle(Vector Vector_1, Quaternion Quaternion_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) </code>
| <code>table OnHandleInput(table ''input'') </code>
| Draws a circle. Specify center in world space.
| Called every frame with the state of the motion controller inputs. Return the input table with bits toggled off in the members to disable the rest of the game from receiving the inputs.
|}
 
 
=== CDestinationsQuestGeocache ===
''No Description Set''
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.CircleScreenOriented | CircleScreenOriented]]
| [[SteamVR/Environments/Scripting/API/CDestinationsQuestGeocache.DisableCollision|DisableCollision]]
| <code>void CircleScreenOriented(Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) </code>
| <code>void DisableCollision() </code>
| Draws a circle oriented to the screen. Specify center in world space.
| Disable physics collision for this entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Cone | Cone]]
| [[SteamVR/Environments/Scripting/API/CDestinationsQuestGeocache.EnableCollision|EnableCollision]]
| <code>void Cone(Vector Vector_1, Vector Vector_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) </code>
| <code>void EnableCollision() </code>
| Draws a wireframe cone. Specify endpoint and direction in world space.
| Enable physics collision for this entity.
|}
 
 
=== CEnvTimeOfDay2 ===
''No Description Set''
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Cross | Cross]]
| [[SteamVR/Environments/Scripting/API/CEnvTimeOfDay2.GetFloat|GetFloat]]
| <code>void Cross(Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) </code>
| <code>float GetFloat(utilstringtoken unknown, float unknown) </code>
| Draws a screen-aligned cross. Specify origin in world space.
| Lookup dynamic time-of-day float value.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Cross3D | Cross3D]]
| [[SteamVR/Environments/Scripting/API/CEnvTimeOfDay2.GetVector|GetVector]]
| <code>void Cross3D(Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) </code>
| <code>Vector GetVector(utilstringtoken unknown, Vector unknown) </code>
| Draws a world-aligned cross. Specify origin in world space.
| Lookup dynamic time-of-day vector value.
|-
|}
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Cross3DOriented | Cross3DOriented]]
 
| <code>void Cross3DOriented(Vector Vector_1, Quaternion Quaternion_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) </code>
=== CEnvEntityMaker ===
| Draws an oriented cross. Specify origin in world space.
:::::extends [[#CBaseEntity|CBaseEntity]]
|-
Entity class for [[env entity maker]].
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.DrawTickMarkedLine | DrawTickMarkedLine]]
 
| <code>void DrawTickMarkedLine(Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) </code>
==== Methods ====
| Draws a dashed line. Specify endpoint's in world space.
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.EntityAttachments | EntityAttachments]]
| [[Dota 2 Workshop Tools/Scripting/API/CEnvEntityMaker.SpawnEntity|SpawnEntity]]
| <code>void EntityAttachments(ehandle ehandle_1, float float_2, float float_3) </code>
| <code>void SpawnEntity() </code>
| Draws the attachments of the entity
| Create an entity at the location of the maker
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.EntityAxis | EntityAxis]]
| [[Dota 2 Workshop Tools/Scripting/API/CEnvEntityMaker.SpawnEntityAtEntityOrigin|SpawnEntityAtEntityOrigin]]
| <code>void EntityAxis(ehandle ehandle_1, float float_2, bool bool_3, float float_4) </code>
| <code>void SpawnEntityAtEntityOrigin(handle hEntity) </code>
| Draws the axis of the entity origin
| Create an entity at the location of a specified entity instance
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.EntityBounds | EntityBounds]]
| [[Dota 2 Workshop Tools/Scripting/API/CEnvEntityMaker.SpawnEntityAtLocation|SpawnEntityAtLocation]]
| <code>void EntityBounds(ehandle ehandle_1, int int_2, int int_3, int int_4, int int_5, bool bool_6, float float_7) </code>
| <code>void SpawnEntityAtLocation(Vector vecAlternateOrigin, Vector vecAlternateAngles) </code>
| Draws bounds of an entity
| Create an entity at a specified location and orientaton, orientation is Euler angle in degrees (pitch, yaw, roll)
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.EntitySkeleton | EntitySkeleton]]
| [[Dota 2 Workshop Tools/Scripting/API/CEnvEntityMaker.SpawnEntityAtNamedEntityOrigin|SpawnEntityAtNamedEntityOrigin]]
| <code>void EntitySkeleton(ehandle ehandle_1, float float_2) </code>
| <code>void SpawnEntityAtNamedEntityOrigin(string pszName) </code>
| Draws the skeleton of the entity
| Create an entity at the location of a named entity
|-
|}
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.EntityText | EntityText]]
 
| <code>void EntityText(ehandle ehandle_1, int int_2, string string_3, int int_4, int int_5, int int_6, int int_7, float float_8) </code>
 
| Draws text on an entity
=== CEntityScriptFramework ===
|-
''Interface to the C++-side of entity framework''
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.FilledRect2D | FilledRect2D]]
 
| <code>void FilledRect2D(Vector2D Vector2D_1, Vector2D Vector2D_2, int int_3, int int_4, int int_5, int int_6, float float_7) </code>
 
| Draws a screen-space filled 2D rectangle. Coordinates are in pixels.
''Global accessor variable:'' <code>EntityFramework</code>
 
==== Methods ====
No methods available.
 
==== Hooks ====
Called on the entity framework script.
 
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.HorzArrow | HorzArrow]]
| [[SteamVR/Environments/Scripting/API/CEntityScriptFramework.CreateEntity|CreateEntity]]
| <code>void HorzArrow(Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) </code>
| <code>void CreateEntity(string ''className'', handle ''instance'') </code>
| Draws a horizontal arrow. Specify endpoint's in world space.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Line | Line]]
| [[SteamVR/Environments/Scripting/API/CEntityScriptFramework.DispatchActivate|DispatchActivate]]
| <code>void Line(Vector Vector_1, Vector Vector_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) </code>
| <code>bool DispatchActivate(handle ''entity'') </code>
| Draws a line between two point's
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Line2D | Line2D]]
| [[SteamVR/Environments/Scripting/API/CEntityScriptFramework.DispatchInput|DispatchInput]]
| <code>void Line2D(Vector2D Vector2D_1, Vector2D Vector2D_2, int int_3, int int_4, int int_5, int int_6, float float_7) </code>
| <code>bool DispatchInput(string ''inputName'', table ''target'',unknown ''args'') </code>
| Draws a line between two point's in screenspace
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.PopDebugOverlayScope | PopDebugOverlayScope]]
| [[SteamVR/Environments/Scripting/API/CEntityScriptFramework.DispatchPrecache|DispatchPrecache]]
| <code>void PopDebugOverlayScope() </code>
| <code>void DispatchPrecache(handle ''entity'', CScriptPrecacheContext ''context'') </code>
| Pops the identifier used to group overlays. Overlays marked with this identifier can be deleted in a big batch.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.PushAndClearDebugOverlayScope | PushAndClearDebugOverlayScope]]
| [[SteamVR/Environments/Scripting/API/CEntityScriptFramework.DispatchSpawn|DispatchSpawn]]
| <code>void PushAndClearDebugOverlayScope(utlstringtoken utlstringtoken_1) </code>
| <code>void DispatchSpawn(handle ''entity'', CScriptKeyValues''spawnkeys'') </code>
| Pushes an identifier used to group overlays. Deletes all existing overlays using this overlay id.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.PushDebugOverlayScope | PushDebugOverlayScope]]
| [[SteamVR/Environments/Scripting/API/CEntityScriptFramework.DispatchUpdateOnRemove|DispatchUpdateOnRemove]]
| <code>void PushDebugOverlayScope(utlstringtoken utlstringtoken_1) </code>
| <code>bool DispatchUpdateOnRemove(handle ''entity'') </code>
| Pushes an identifier used to group overlays. Overlays marked with this identifier can be deleted in a big batch.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.RemoveAllInScope | RemoveAllInScope]]
| [[SteamVR/Environments/Scripting/API/CEntityScriptFramework.GetClassNameOverride|GetClassNameOverride]]
| <code>void RemoveAllInScope(utlstringtoken utlstringtoken_1) </code>
| <code>string GetClassNameOverride(string ''className'') </code>
| Removes all overlays marked with a specific identifier, regardless of their lifetime.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.SolidCone | SolidCone]]
| [[SteamVR/Environments/Scripting/API/CEntityScriptFramework.GetDesignerNameForScriptClass|GetDesignerNameForScriptClass]]
| <code>void SolidCone(Vector Vector_1, Vector Vector_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) </code>
| <code>string GetDesignerNameForScriptClass(string ''className'',handle ''instance'') </code>
| Draws a solid cone. Specify endpoint and direction in world space.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Sphere | Sphere]]
| [[SteamVR/Environments/Scripting/API/CEntityScriptFramework.GetInputsForScriptClass|GetInputsForScriptClass]]
| <code>void Sphere(Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) </code>
| <code>table GetInputsForScriptClass(string ''scriptClassName'') </code>
| Draws a wireframe sphere. Specify center in world space.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.SweptBox | SweptBox]]
| [[SteamVR/Environments/Scripting/API/CEntityScriptFramework.GetNativeClassForScriptClass|GetNativeClassForScriptClass]]
| <code>void SweptBox(Vector Vector_1, Vector Vector_2, Vector Vector_3, Vector Vector_4, Quaternion Quaternion_5, int int_6, int int_7, int int_8, int int_9, float float_10) </code>
| <code>string GetNativeClassForScriptClass(string ''scriptClassName'') </code>
| Draws a swept box. Specify endpoint's in world space and the bounds in local space.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Text | Text]]
| [[SteamVR/Environments/Scripting/API/CEntityScriptFramework.GetNativeOutputsForClass|GetNativeOutputsForClass]]
| <code>void Text(Vector Vector_1, int int_2, string string_3, float float_4, int int_5, int int_6, int int_7, int int_8, float float_9) </code>
| <code>CNativeOutputs GetNativeOutputsForClass(string ''scriptClassName'') </code>
| Draws 2D text. Specify origin in world space.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Texture | Texture]]
| [[SteamVR/Environments/Scripting/API/CEntityScriptFramework.GetScriptClassForDesignerName|GetScriptClassForDesignerName]]
| <code>void Texture(string string_1, Vector2D Vector2D_2, Vector2D Vector2D_3, int int_4, int int_5, int int_6, int int_7, Vector2D Vector2D_8, Vector2D Vector2D_9, float float_10) </code>
| <code>string GetScriptClassForDesignerName(string ''designerName'') </code>
| Draws a screen-space texture. Coordinates are in pixels.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Triangle | Triangle]]
| [[SteamVR/Environments/Scripting/API/CEntityScriptFramework.InstallClasses|InstallClasses]]
| <code>void Triangle(Vector Vector_1, Vector Vector_2, Vector Vector_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) </code>
| <code>void InstallClasses() </code>
| Draws a filled triangle. Specify vertices in world space.
|  
|-
|}
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.UnitTestCycleOverlayRenderType | UnitTestCycleOverlayRenderType]]
 
| <code>void UnitTestCycleOverlayRenderType() </code>
 
| Toggles the overlay render type, for unit tests
=== CInfoWorldLayer ===
Entity class for [[info world layer]].
 
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.VectorText3D | VectorText3D]]
| [[SteamVR/Environments/Scripting/API/CInfoWorldLayer.HideWorldLayer|HideWorldLayer]]
| <code>void VectorText3D(Vector Vector_1, Quaternion Quaternion_2, string string_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) </code>
| <code>void HideWorldLayer() </code>
| Draws 3D text. Specify origin + orientation in world space.
| Hides this layer.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.VertArrow | VertArrow]]
| [[SteamVR/Environments/Scripting/API/CInfoWorldLayer.ShowWorldLayer|ShowWorldLayer]]
| <code>void VertArrow(Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) </code>
| <code>void ShowWorldLayer() </code>
| Draws a vertical arrow. Specify endpoint's in world space.
| Shows this layer.
|}
 
 
=== CMarkupVolumeTagged ===
''No Description Set''
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.YawArrow | YawArrow]]
| [[Dota 2 Workshop Tools/Scripting/API/CMarkupVolumeTagged.HasTag|HasTag]]
| <code>void YawArrow(Vector Vector_1, float float_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) </code>
| <code>bool HasTag(string pszTagName) </code>
| Draws a arrow associated with a specific yaw. Specify endpoint's in world space.
| Does this volume have the given tag.
|}
|}




=== CSceneEntity ===
=== CScriptPrecacheContext ===
:::::extends [[#CBaseEntity| CBaseEntity]]
''Container to hold context published to precache functions in script''
Choreographed scene which controls animation and/or dialog on one or more actors.


==== Methods ====
==== Methods ====
Line 2,074: Line 2,195:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.AddBroadcastTeamTarget | AddBroadcastTeamTarget]]
| [[Dota 2 Workshop Tools/Scripting/API/CScriptPrecacheContext.AddResource|AddResource]]
| <code>void AddBroadcastTeamTarget(int int_1) </code>
| <code>void AddResource(string string_1) </code>
| Adds a team (by index) to the broadcast list
| Precaches a specific resource
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.Cancel | Cancel]]
| [[Dota 2 Workshop Tools/Scripting/API/CScriptPrecacheContext.GetValue|GetValue]]
| <code>void Cancel() </code>
| <code>''variable'' GetValue(string ''key'') </code>
| Cancel scene playback
| Reads a spawn key.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.EstimateLength | EstimateLength]]
| <code>float EstimateLength() </code>
| Returns length of this scene in seconds.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.FindCamera | FindCamera]]
| <code>handle FindCamera() </code>
| Get the camera
|-
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.FindNamedEntity | FindNamedEntity]]
| <code>handle FindNamedEntity(string string_1) </code>
| given an entity reference, such as !target, get actual entity from scene object
|-
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.IsPaused | IsPaused]]
| <code>bool IsPaused() </code>
| If this scene is currently paused.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.IsPlayingBack | IsPlayingBack]]
| <code>bool IsPlayingBack() </code>
| If this scene is currently playing.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.LoadSceneFromString | LoadSceneFromString]]
| <code>bool LoadSceneFromString(string string_1, string string_2) </code>
| given a dummy scene name and a vcd ''string'', load the scene
|-
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.RemoveBroadcastTeamTarget | RemoveBroadcastTeamTarget]]
| <code>void RemoveBroadcastTeamTarget(int int_1) </code>
| Removes a team (by index) from the broadcast list
|-
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.Start | Start]]
| <code>void Start(handle handle_1) </code>
| Start scene playback, takes activatorEntity as param
|}
|}




=== CCustomGameEventManager ===
=== CScriptKeyValues ===
''No Description Set''
Container holding keyvalues published to the Spawn() hook function.


==== Methods ====
==== Methods ====
''Global accessor variable:'' <code>CustomGameEventManager</code>
{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Function  
! Function  
Line 2,126: Line 2,214:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CCustomGameEventManager.RegisterListener | RegisterListener]]
| [[Dota 2 Workshop Tools/Scripting/API/CScriptKeyValues.GetValue|GetValue]]
| <code>int RegisterListener(string string_1, handle handle_2) </code>
| <code>''variable'' GetValue(string ''key'') </code>
| ( string EventName, func CallbackFunction ) - Register a callback to be called when a particular custom event arrives. Returns a listener ID that can be used to unregister later.
| Reads a spawn key.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CCustomGameEventManager.Send_ServerToAllClients | Send_ServerToAllClients]]
| <code>void Send_ServerToAllClients(string string_1, handle handle_2) </code>
| ( string EventName, table EventData )
|-
| [[Dota 2 Workshop Tools/Scripting/API/CCustomGameEventManager.Send_ServerToPlayer | Send_ServerToPlayer]]
| <code>void Send_ServerToPlayer(handle handle_1, string string_2, handle handle_3) </code>
| ( Entity Player, string EventName, table EventData )
|-
| [[Dota 2 Workshop Tools/Scripting/API/CCustomGameEventManager.Send_ServerToTeam | Send_ServerToTeam]]
| <code>void Send_ServerToTeam(int int_1, string string_2, handle handle_3) </code>
| ( int TeamNumber, string EventName, table EventData )
|-
| [[Dota 2 Workshop Tools/Scripting/API/CCustomGameEventManager.UnregisterListener | UnregisterListener]]
| <code>void UnregisterListener(int int_1) </code>
| ( int ListnerID ) - Unregister a specific listener
|}
|}




=== CCustomNetTableManager ===
=== CNativeOutputs ===
Used to communicate with clientside Javascript used by Panorama. See [[Destinations/Scripting/Linking_Lua_with_Javascript|Linking Lua with Javascript]] for usage.
Container for holding outputs published by scripted entity classes to the game code.
 
''Global accessor variable:'' <code>CustomNetTables</code>


==== Methods ====
==== Methods ====
Line 2,159: Line 2,229:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CCustomNetTableManager.GetTableValue | GetTableValue]]
| [[Dota 2 Workshop Tools/Scripting/API/CNativeOutputs.constructor|constructor]]
| <code>handle GetTableValue(string ''TableName'', string ''KeyName'') </code>
| <code>void CNativeOutputs() </code>
| ( string TableName, string KeyName )
| Creates a new CNativeOutputs object.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CNativeOutputs.AddOutput|AddOutput]]
| <code>void AddOutput(string ''outputName'', string ''description'') </code>
| Add an output.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CCustomNetTableManager.SetTableValue | SetTableValue]]
| [[Dota 2 Workshop Tools/Scripting/API/CNativeOutputs.Init|Init]]
| <code>bool SetTableValue(string ''TableName'', string ''KeyName'', handle ''Value'') </code>
| <code>void Init(int ''numOutputs'') </code>
| ( string TableName, string KeyName, script_table Value )
| Initialize with specified number of outputs.
|}
|}




=== CPointClientUIWorldPanel ===
=== CEnvProjectedTexture ===
Entity class for [[point_clientui_world_panel]]
:::::extends [[#CBaseEntity|CBaseEntity]]
 
Entity class for [[env projected texture]].
A 2D [[Panorama]] panel projected at a set position in the world.


==== Methods ====
==== Methods ====
Line 2,180: Line 2,253:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/CPointClientUIWorldPanel.AcceptUserInput| AcceptUserInput]]
| [[Dota 2 Workshop Tools/Scripting/API/CEnvProjectedTexture.SetFarRange|SetFarRange]]
| <code>void AcceptUserInput() </code>
| <code>void SetFarRange(float flRange) </code>
| Tells the panel to accept user input.
| Set light maximum range
|-
| [[Dota 2 Workshop Tools/Scripting/API/CEnvProjectedTexture.SetLinearAttenuation|SetLinearAttenuation]]
| <code>void SetLinearAttenuation(float flAtten) </code>
| Set light linear attenuation value
|-
|-
| [[Destinations/Scripting/API/CPointClientUIWorldPanel.AddCSSClasses| AddCSSClasses]]
| [[Dota 2 Workshop Tools/Scripting/API/CEnvProjectedTexture.SetNearRange|SetNearRange]]
| <code>void AddCSSClasses(string ''classes'') </code>
| <code>void SetNearRange(float flRange) </code>
| Adds CSS class(es) to the panel.
| Set light minimum range
|-
|-
| [[Destinations/Scripting/API/CPointClientUIWorldPanel.IgnoreUserInput| IgnoreUserInput]]
| [[Dota 2 Workshop Tools/Scripting/API/CEnvProjectedTexture.SetQuadraticAttenuation|SetQuadraticAttenuation]]
| <code>void IgnoreUserInput() </code>
| <code>void SetQuadraticAttenuation(float flAtten) </code>
| Tells the panel to ignore user input.
| Set light quadratic attenuation value
|-
|-
| [[Destinations/Scripting/API/CPointClientUIWorldPanel.RemoveCSSClasses| RemoveCSSClasses]]
| [[Dota 2 Workshop Tools/Scripting/API/CEnvProjectedTexture.SetVolumetrics|SetVolumetrics]]
| <code>void RemoveCSSClasses(string ''classes'') </code>
| <code>void SetVolumetrics(bool bOn, float flIntensity, float flNoise, int nPlanes, float flPlaneOffset) </code>
| Remove CSS class(es) from the panel.
| Turn on/off light volumetrics: ''bool'' bOn, ''float'' flIntensity, ''float'' flNoise, ''int'' nPlanes, ''float'' flPlaneOffset
|}
|}




=== CPointTemplate ===
=== CInfoData ===
Entity class for [[point_template]]
''No Description Set''


==== Methods ====
==== Methods ====
Line 2,207: Line 2,284:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CPointTemplate.DeleteCreatedSpawnGroups | DeleteCreatedSpawnGroups]]
| [[Dota 2 Workshop Tools/Scripting/API/CInfoData.QueryColor|QueryColor]]
| <code>void DeleteCreatedSpawnGroups() </code>
| <code>Vector QueryColor(utlstringtoken tok, Vector vDefault) </code>
| DeleteCreatedSpawnGroups() : Deletes any spawn groups that this point_template has spawned. Note: The point_template will not be deleted by this.
| Query color data for this key
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CPointTemplate.ForceSpawn | ForceSpawn]]
| [[Dota 2 Workshop Tools/Scripting/API/CInfoData.QueryFloat|QueryFloat]]
| <code>void ForceSpawn() </code>
| <code>float QueryFloat(utlstringtoken tok, float flDefault) </code>
| ForceSpawn() : Spawns all of the entities the point_template is pointing at.
| Query ''float'' data for this key
|-
| [[Dota 2 Workshop Tools/Scripting/API/CInfoData.QueryInt|QueryInt]]
| <code>int QueryInt(utlstringtoken tok, int nDefault) </code>
| Query ''int'' data for this key
|-
| [[Dota 2 Workshop Tools/Scripting/API/CInfoData.QueryNumber|QueryNumber]]
| <code>float QueryNumber(utlstringtoken tok, float flDefault) </code>
| Query number data for this key
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CPointTemplate.GetSpawnedEntities | GetSpawnedEntities]]
| [[Dota 2 Workshop Tools/Scripting/API/CInfoData.QueryString|QueryString]]
| <code>handle GetSpawnedEntities() </code>
| <code>string QueryString(utlstringtoken tok, string pDefault) </code>
| GetSpawnedEntities() : Get the list of the most recent spawned entities
| Query ''string'' data for this key
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CPointTemplate.SetSpawnCallback | SetSpawnCallback]]
| [[Dota 2 Workshop Tools/Scripting/API/CInfoData.QueryVector|QueryVector]]
| <code>void SetSpawnCallback(handle hCallbackFunc, handle hCallbackScope) </code>
| <code>Vector QueryVector(utlstringtoken tok, Vector vDefault) </code>
| SetSpawnCallback( hCallbackFunc, hCallbackScope, hCallbackData ) : Set a callback for when the template spawns entities. The spawned entities will be passed in as an array.
| Query ''vector'' data for this key
|}
|}




=== CPointWorldText===
=== CPhysicsProp ===
Entity class for [[point_worldtext]].
Entity class for [[prop physics]] and related classes.


==== Methods ====
==== Methods ====
Line 2,234: Line 2,319:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/CPointWorldText.SetMessage| SetMessage]]
| [[SteamVR/Environments/Scripting/API/CPhysicsProp.SetDynamicVsDynamicContinuous|SetDynamicVsDynamicContinuous]]
| <code>void SetMessage(string ''pMessage'')</code>
| <code>void SetDynamicVsDynamicContinuous(bool ''bIsDynamicVsDynamicContinuousEnabled'')</code>
| Set the message on this entity.
| Enable/disable dynamic vs dynamic continuous collision traces.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CPhysicsProp.DisableMotion|DisableMotion]]
| <code>void DisableMotion() </code>
| Enable motion for the prop.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CPhysicsProp.EnableMotion|EnableMotion]]
| <code>void EnableMotion() </code>
| Enable motion for the prop.
|}
|}




=== CPropHMDAvatar ===
=== CDebugOverlayScriptHelper ===
Entity class for [[prop_hmd_avatar]].
''No Description Set''


==== Methods ====
==== Methods ====
Line 2,249: Line 2,342:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CPropHMDAvatar.GetVRHand | GetVRHand]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Axis|Axis]]
| <code>CPropVRHand GetVRHand(int nHandID) </code>
| <code>void Axis(Vector Vector_1, Quaternion Quaternion_2, float float_3, bool bool_4, float float_5) </code>
| Get VR hand by ID (0 and 1).
| Draws an axis. Specify origin + orientation in world space.
|}
 
 
=== CPropVRHand ===
Entity class for [[prop_vr_hand]]. Represents a VR motion controller. The controllers can be enumerated for each player using the [[#CPropHMDAvatar|CPropHMDAvatar]]::GetVRHand() method.
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Destinations/Scripting/API/CPropVRHand.AddHandAttachment | AddHandAttachment]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Box|Box]]
| <code>void AddHandAttachment(handle ''attachment'') </code>
| <code>void Box(Vector Vector_1, Vector Vector_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) </code>
| Add the attachment to this hand.
| Draws a world-space axis-aligned box. Specify bounds in world space.
|-
|-
| [[Destinations/Scripting/API/CPropVRHand.AddHandModelOverride| AddHandModelOverride]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.BoxAngles|BoxAngles]]
| <code>void AddHandModelOverride(string ''modelName'') </code>
| <code>void BoxAngles(Vector Vector_1, Vector Vector_2, Vector Vector_3, Quaternion Quaternion_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) </code>
| Add a model override for this hand.
| Draws an oriented box at the origin. Specify bounds in local space.
|-
|-
| [[Destinations/Scripting/API/CPropVRHand.FireHapticPulse | FireHapticPulse]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Capsule|Capsule]]
| <code>void FireHapticPulse(int ''strength'') </code>
| <code>void Capsule(Vector Vector_1, Quaternion Quaternion_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) </code>
| Fire a haptic pulse on this hand. Integer range [0, 1, 2] for strength.
| Draws a capsule. Specify base in world space.
|-
|-
| [[Destinations/Scripting/API/CPropVRHand.FireHapticPulsePrecise | FireHapticPulsePrecise]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Circle|Circle]]
| <code>void FireHapticPulsePrecise(int ''nPulseDuration'') </code>
| <code>void Circle(Vector Vector_1, Quaternion Quaternion_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) </code>
| Fire a haptic pulse on this hand. Specify the duration in micro seconds.
| Draws a circle. Specify center in world space.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CPropVRHand.GetHandAttachment | GetHandAttachment]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.CircleScreenOriented|CircleScreenOriented]]
| <code>handle GetHandAttachment() </code>
| <code>void CircleScreenOriented(Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) </code>
| Get the attachment on this hand.
| Draws a circle oriented to the screen. Specify center in world space.
|-
|-
| [[Destinations/Scripting/API/CPropVRHand.GetHandID | GetHandID]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Cone|Cone]]
| <code>int GetHandID() </code>
| <code>void Cone(Vector Vector_1, Vector Vector_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) </code>
| Get the players hand ID for this hand.
| Draws a wireframe cone. Specify endpoint and direction in world space.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Cross|Cross]]
| <code>void Cross(Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) </code>
| Draws a screen-aligned cross. Specify origin in world space.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Cross3D|Cross3D]]
| <code>void Cross3D(Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) </code>
| Draws a world-aligned cross. Specify origin in world space.
|-
|-
| [[Destinations/Scripting/API/CPropVRHand.GetPlayer | GetPlayer]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Cross3DOriented|Cross3DOriented]]
| <code>CBasePlayer GetPlayer() </code>
| <code>void Cross3DOriented(Vector Vector_1, Quaternion Quaternion_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) </code>
| Get the player for this hand.
| Draws an oriented cross. Specify origin in world space.
|-
|-
| [[Destinations/Scripting/API/CPropVRHand.GetVelocity | GetVelocity]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.DrawTickMarkedLine|DrawTickMarkedLine]]
| <code>Vector GetVelocity() </code>
| <code>void DrawTickMarkedLine(Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) </code>
| Get the filtered controller velocity.
| Draws a dashed line. Specify endpoint's in world space.
|-
|-
| [[Destinations/Scripting/API/CPropVRHand.RemoveAllHandModelOverrides | RemoveAllHandModelOverrides]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.EntityAttachments|EntityAttachments]]
| <code>void RemoveAllHandModelOverrides() </code>
| <code>void EntityAttachments(ehandle ehandle_1, float float_2, float float_3) </code>
| Remove all model overrides for this hand.
| Draws the attachments of the entity
|-
|-
| [[Destinations/Scripting/API/CPropVRHand.RemoveHandAttachmentByHandle | RemoveHandAttachmentByHandle]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.EntityAxis|EntityAxis]]
| <code>void RemoveHandAttachmentByHandle(handle ''hAttachment'') </code>
| <code>void EntityAxis(ehandle ehandle_1, float float_2, bool bool_3, float float_4) </code>
| Remove hand attachment by handle.
| Draws the axis of the entity origin
|-
|-
| [[Destinations/Scripting/API/CPropVRHand.RemoveHandModelOverride | RemoveHandModelOverride]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.EntityBounds|EntityBounds]]
| <code>void RemoveHandModelOverride(string ''pModelName'') </code>
| <code>void EntityBounds(ehandle ehandle_1, int int_2, int int_3, int int_4, int int_5, bool bool_6, float float_7) </code>
| Remove a model override for this hand.
| Draws bounds of an entity
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CPropVRHand.SetHandAttachment | SetHandAttachment]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.EntitySkeleton|EntitySkeleton]]
| <code>void SetHandAttachment(handle ''hAttachment'') </code>
| <code>void EntitySkeleton(ehandle ehandle_1, float float_2) </code>
| Set the attachment for this hand.
| Draws the skeleton of the entity
|}
 
 
=== CScriptParticleManager ===
Allows the creation and manipulation of particle systems.
 
''Global accessor variable:'' <code>ParticleManager</code>
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.CreateParticle | CreateParticle]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.EntityText|EntityText]]
| <code>int CreateParticle(string ''particleName'', int ''particleAttach'', handle ''owningEntity'') </code>
| <code>void EntityText(ehandle ehandle_1, int int_2, string string_3, int int_4, int int_5, int int_6, int int_7, float float_8) </code>
| Creates a new particle effect. Returns the index of the created effect.
| Draws text on an entity
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.CreateParticleForPlayer | CreateParticleForPlayer]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.FilledRect2D|FilledRect2D]]
| <code>int CreateParticleForPlayer(string ''particleName'', int ''particleAttach'', handle ''owningEntity'', handle ''owningPlayer'') </code>
| <code>void FilledRect2D(Vector2D Vector2D_1, Vector2D Vector2D_2, int int_3, int int_4, int int_5, int int_6, float float_7) </code>
| Creates a new particle effect that only plays for the specified player. Returns the index of the created effect.
| Draws a screen-space filled 2D rectangle. Coordinates are in pixels.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.DestroyParticle | DestroyParticle]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.HorzArrow|HorzArrow]]
| <code>void DestroyParticle(int ''particleID'', bool ''immediately'') </code>
| <code>void HorzArrow(Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) </code>
| Destroys particle.
| Draws a horizontal arrow. Specify endpoint's in world space.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.GetParticleReplacement | GetParticleReplacement]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Line|Line]]
| <code>string GetParticleReplacement(string ''string_1'', handle ''handle_2'') </code>
| <code>void Line(Vector Vector_1, Vector Vector_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) </code>
| No Description Set
| Draws a line between two point's
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.ReleaseParticleIndex | ReleaseParticleIndex]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Line2D|Line2D]]
| <code>void ReleaseParticleIndex(int ''particleId'') </code>
| <code>void Line2D(Vector2D Vector2D_1, Vector2D Vector2D_2, int int_3, int int_4, int int_5, int int_6, float float_7) </code>
| Frees the specified particle index
| Draws a line between two point's in screenspace
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.SetParticleAlwaysSimulate | SetParticleAlwaysSimulate]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.PopDebugOverlayScope|PopDebugOverlayScope]]
| <code>void SetParticleAlwaysSimulate(int ''int_1'') </code>
| <code>void PopDebugOverlayScope() </code>
| No Description Set
| Pops the identifier used to group overlays. Overlays marked with this identifier can be deleted in a big batch.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.SetParticleControl | SetParticleControl]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.PushAndClearDebugOverlayScope|PushAndClearDebugOverlayScope]]
| <code>void SetParticleControl(int ''particleId'', int ''controlIndex'', Vector ''controlData'') </code>
| <code>void PushAndClearDebugOverlayScope(utlstringtoken utlstringtoken_1) </code>
| Set the control point data for a control on a particle effect
| Pushes an identifier used to group overlays. Deletes all existing overlays using this overlay id.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.PushDebugOverlayScope|PushDebugOverlayScope]]
| <code>void PushDebugOverlayScope(utlstringtoken utlstringtoken_1) </code>
| Pushes an identifier used to group overlays. Overlays marked with this identifier can be deleted in a big batch.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.SetParticleControlEnt | SetParticleControlEnt]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.RemoveAllInScope|RemoveAllInScope]]
| <code>void SetParticleControlEnt(int ''particleId'', int ''controlIndex'', handle ''entity'', ParticleAttachment_t ''attachType'', string ''attachment'', Vector ''origin'', bool ''unknown'') </code>
| <code>void RemoveAllInScope(utlstringtoken utlstringtoken_1) </code>
| Attaches the control point to an entity.
| Removes all overlays marked with a specific identifier, regardless of their lifetime.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.SetParticleControlForward | SetParticleControlForward]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.SolidCone|SolidCone]]
| <code>void SetParticleControlForward(int ''FXIndex'', int ''controlIndex'', Vector ''forward'') </code>
| <code>void SolidCone(Vector Vector_1, Vector Vector_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) </code>
| Set the forward direction for a control point on a particle effect.
| Draws a solid cone. Specify endpoint and direction in world space.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.SetParticleControlOrientation | SetParticleControlOrientation]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Sphere|Sphere]]
| <code>void SetParticleControlOrientation(int ''FXIndex'', int ''controlIndex'', Vector ''forward'', Vector ''right'', Vector ''up'') </code>
| <code>void Sphere(Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) </code>
| Set the orientation for a control point on a particle effect.
| Draws a wireframe sphere. Specify center in world space.
|}
 
 
=== CRigidParticleTrail===
{{todo}}
 
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Destinations/Scripting/API/CRigidParticleTrail.AddPointGlobal | AddPointGlobal]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.SweptBox|SweptBox]]
| <code>void AddPointGlobal(Vector ''vPos'', float ''flRadius'', Vector ''vColor'') </code>
| <code>void SweptBox(Vector Vector_1, Vector Vector_2, Vector Vector_3, Vector Vector_4, Quaternion Quaternion_5, int int_6, int int_7, int int_8, int int_9, float float_10) </code>
|  
| Draws a swept box. Specify endpoint's in world space and the bounds in local space.
|-
|-
| [[Destinations/Scripting/API/CRigidParticleTrail.AddPointLocal | AddPointLocal]]
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Text|Text]]
| <code>void AddPointLocal(Vector ''vPos'', float ''flRadius'', Vector ''vColor'') </code>
| <code>void Text(Vector Vector_1, int int_2, string string_3, float float_4, int int_5, int int_6, int int_7, int int_8, float float_9) </code>
|  
| Draws 2D text. Specify origin in world space.
|}
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Texture|Texture]]
| <code>void Texture(string string_1, Vector2D Vector2D_2, Vector2D Vector2D_3, int int_4, int int_5, int int_6, int int_7, Vector2D Vector2D_8, Vector2D Vector2D_9, float float_10) </code>
| Draws a screen-space texture. Coordinates are in pixels.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.Triangle|Triangle]]
| <code>void Triangle(Vector Vector_1, Vector Vector_2, Vector Vector_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) </code>
| Draws a filled triangle. Specify vertices in world space.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.UnitTestCycleOverlayRenderType|UnitTestCycleOverlayRenderType]]
| <code>void UnitTestCycleOverlayRenderType() </code>
| Toggles the overlay render type, for unit tests
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.VectorText3D|VectorText3D]]
| <code>void VectorText3D(Vector Vector_1, Quaternion Quaternion_2, string string_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) </code>
| Draws 3D text. Specify origin + orientation in world space.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.VertArrow|VertArrow]]
| <code>void VertArrow(Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) </code>
| Draws a vertical arrow. Specify endpoint's in world space.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CDebugOverlayScriptHelper.YawArrow|YawArrow]]
| <code>void YawArrow(Vector Vector_1, float float_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) </code>
| Draws a arrow associated with a specific yaw. Specify endpoint's in world space.
|}




=== CSteamToursBaseGameMode ===
=== CSceneEntity ===
''No Description Set''
:::::extends [[#CBaseEntity|CBaseEntity]]
 
Choreographed scene which controls animation and/or dialog on one or more actors.
Global object accessed via GameRules:GetGameModeEntity()


==== Methods ====
==== Methods ====
Line 2,394: Line 2,490:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/CSteamToursBaseGameMode.GetDetectorQuestCount| GetDetectorQuestCount]]
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.AddBroadcastTeamTarget|AddBroadcastTeamTarget]]
| <code>int GetDetectorQuestCount(CBasePlayer ''player'') </code>
| <code>void AddBroadcastTeamTarget(int int_1) </code>
| Returns the number of active detector quests for the given player.
| Adds a team (by index) to the broadcast list
|-
|-
| [[Destinations/Scripting/API/CSteamToursBaseGameMode.GetDetectorQuestID| GetDetectorQuestID]]
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.Cancel|Cancel]]
| <code>string GetDetectorQuestID(CBasePlayer ''player'', int ''idx'') </code>
| <code>void Cancel() </code>
| Returns the detector quest's ID, if any, for the given player and index.
| Cancel scene playback
|-
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.EstimateLength|EstimateLength]]
| <code>float EstimateLength() </code>
| Returns length of this scene in seconds.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.FindCamera|FindCamera]]
| <code>handle FindCamera() </code>
| Get the camera
|-
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.FindNamedEntity|FindNamedEntity]]
| <code>handle FindNamedEntity(string string_1) </code>
| given an entity reference, such as !target, get actual entity from scene object
|-
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.IsPaused|IsPaused]]
| <code>bool IsPaused() </code>
| If this scene is currently paused.
|-
|-
| [[Destinations/Scripting/API/CSteamToursBaseGameMode.GetDetectorQuestLocation| GetDetectorQuestLocation]]
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.IsPlayingBack|IsPlayingBack]]
| <code>Vector GetDetectorQuestLocation(CBasePlayer ''player'', int ''idx'') </code>
| <code>bool IsPlayingBack() </code>
| Returns the detector quest location, if any, for the given player and index.
| If this scene is currently playing.
|-
|-
| [[Destinations/Scripting/API/CSteamToursBaseGameMode.GetDetectorQuestNumItemsUnlocked| GetDetectorQuestNumItemsUnlocked]]
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.LoadSceneFromString|LoadSceneFromString]]
| <code>int GetDetectorQuestNumItemsUnlocked(CBasePlayer ''player'', string ''questID'') </code>
| <code>bool LoadSceneFromString(string string_1, string string_2) </code>
| Returns the number of items unlocked for the player and quest.
| given a dummy scene name and a vcd ''string'', load the scene
|-
|-
| [[Destinations/Scripting/API/CSteamToursBaseGameMode.GetDetectorQuestUnlockedItemDefID| GetDetectorQuestUnlockedItemDefID]]
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.RemoveBroadcastTeamTarget|RemoveBroadcastTeamTarget]]
| <code>string GetDetectorQuestUnlockedItemDefID(CBasePlayer ''player'', string ''questID'', int ''idx'') </code>
| <code>void RemoveBroadcastTeamTarget(int int_1) </code>
| Returns the item definition ID for the item that was unlocked for the given player and quest.
| Removes a team (by index) from the broadcast list
|-
|-
| [[Destinations/Scripting/API/CSteamToursBaseGameMode.UnlockItem| UnlockItem]]
| [[Dota 2 Workshop Tools/Scripting/API/CSceneEntity.Start|Start]]
| <code>void UnlockItem(CBasePlayer ''player'', string ''itemName'') </code>
| <code>void Start(handle handle_1) </code>
| Unlocks an item from /scripts/contentdb.txt for the given player. Item names are set using the dev_name key.
| Start scene playback, takes activatorEntity as param
|}
|}




=== CSteamToursGameRules ===
=== CCustomGameEventManager ===
Game rule manager.
''No Description Set''


''Global accessor variable:'' <code>GameRules</code>
==== Methods ====
 
''Global accessor variable:'' <code>CustomGameEventManager</code>
==== Methods ====
{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Function  
! Function  
Line 2,431: Line 2,542:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/CSteamToursGameRules.GetGameModeEntity| GetGameModeEntity]]
| [[Dota 2 Workshop Tools/Scripting/API/CCustomGameEventManager.RegisterListener|RegisterListener]]
| <code>CSteamToursBaseGameMode GetGameModeEntity() </code>
| <code>int RegisterListener(string string_1, handle handle_2) </code>
| Returns the game mode entity.
| ( string EventName, func CallbackFunction ) - Register a callback to be called when a particular custom event arrives. Returns a listener ID that can be used to unregister later.
|-
| [[Dota 2 Workshop Tools/Scripting/API/CCustomGameEventManager.Send ServerToAllClients|Send_ServerToAllClients]]
| <code>void Send_ServerToAllClients(string string_1, handle handle_2) </code>
| ( string EventName, table EventData )
|-
| [[Dota 2 Workshop Tools/Scripting/API/CCustomGameEventManager.Send ServerToPlayer|Send_ServerToPlayer]]
| <code>void Send_ServerToPlayer(handle handle_1, string string_2, handle handle_3) </code>
| ( Entity Player, string EventName, table EventData )
|-
|-
| [[Destinations/Scripting/API/CSteamToursGameRules.SetPlayersCanSpawnAnyItems | SetPlayersCanSpawnAnyItems]]
| [[Dota 2 Workshop Tools/Scripting/API/CCustomGameEventManager.Send ServerToTeam|Send_ServerToTeam]]
| <code>void SetPlayersCanSpawnAnyItems(bool ''allowItems'') </code>
| <code>void Send_ServerToTeam(int int_1, string string_2, handle handle_3) </code>
| Allow control of whether players can spawn any items or not.
| ( int TeamNumber, string EventName, table EventData )
|-
|-
| [[Destinations/Scripting/API/CSteamToursGameRules.SetPlayersCanSpawnTools| SetPlayersCanSpawnTools]]
| [[Dota 2 Workshop Tools/Scripting/API/CCustomGameEventManager.UnregisterListener|UnregisterListener]]
| <code>void SetPlayersCanSpawnTools(bool ''allowTools'') </code>
| <code>void UnregisterListener(int int_1) </code>
| Allow control of whether players can spawn tools or not.
| ( int ListnerID ) - Unregister a specific listener
|}
|}




=== CTakeDamageInfo ===
=== CCustomNetTableManager ===
DamageInfo handle returned by CreateDamageInfo()
Used to communicate with clientside Javascript used by Panorama. See [[SteamVR/Environments/Scripting/Linking Lua with Javascript|Linking Lua with Javascript]] for usage.
 
''Global accessor variable:'' <code>CustomNetTables</code>


==== Methods ====
==== Methods ====
Line 2,452: Line 2,573:
! Function  
! Function  
! Signature  
! Signature  
! Description
! Description  
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.AddDamage| AddDamage]]
| [[Dota 2 Workshop Tools/Scripting/API/CCustomNetTableManager.GetTableValue|GetTableValue]]
| <code>void AddDamage(float ''addAmount'') </code>
| <code>handle GetTableValue(string ''TableName'', string ''KeyName'') </code>
| Adds to the damage value.
| ( string TableName, string KeyName )
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.AddDamageType| AddDamageType]]
| [[Dota 2 Workshop Tools/Scripting/API/CCustomNetTableManager.SetTableValue|SetTableValue]]
| <code>void  AddDamageType(int ''bitsDamageType'') </code>
| <code>bool SetTableValue(string ''TableName'', string ''KeyName'', handle ''Value'') </code>
| Adds damage type bit flags.  
| ( string TableName, string KeyName, script_table Value )
|}
 
 
=== CParticleSystem ===
{{todo|Entity class for particle systems? No methods available.}}
 
 
=== CPointClientUIWorldPanel ===
Entity class for [[point clientui world panel]]
 
A 2D [[Panorama]] panel projected at a set position in the world.
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.AllowFriendlyFire| AllowFriendlyFire]]
| [[SteamVR/Environments/Scripting/API/CPointClientUIWorldPanel.AcceptUserInput|AcceptUserInput]]
| <code>bool AllowFriendlyFire() </code>
| <code>void AcceptUserInput() </code>
|  
| Tells the panel to accept user input.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.BaseDamageIsValid| BaseDamageIsValid]]
| [[SteamVR/Environments/Scripting/API/CPointClientUIWorldPanel.AddCSSClasses|AddCSSClasses]]
| <code>bool BaseDamageIsValid() </code>
| <code>void AddCSSClasses(string ''classes'') </code>
|  
| Adds CSS class(es) to the panel.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.CanBeBlocked| CanBeBlocked]]
| [[SteamVR/Environments/Scripting/API/CPointClientUIWorldPanel.IgnoreUserInput|IgnoreUserInput]]
| <code>bool CanBeBlocked() </code>
| <code>void IgnoreUserInput() </code>
|  
| Tells the panel to ignore user input.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.GetAmmoType| GetAmmoType]]
| [[SteamVR/Environments/Scripting/API/CPointClientUIWorldPanel.IsGrabbable|IsGrabbable]]
| <code>int GetAmmoType() </code>
| <code>void IsGrabbable() </code>
|  
| Returns whether this entity is grabbable.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.GetAttacker| GetAttacker]]
| [[SteamVR/Environments/Scripting/API/CPointClientUIWorldPanel.RemoveCSSClasses|RemoveCSSClasses]]
| <code>CBaseEntity GetAttacker() </code>
| <code>void RemoveCSSClasses(string ''classes'') </code>
| Returns the attacker entity.
| Remove CSS class(es) from the panel.
|}
 
 
=== CPointTemplate ===
Entity class for [[point template]]
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.GetBaseDamage| GetBaseDamage]]
| [[Dota 2 Workshop Tools/Scripting/API/CPointTemplate.DeleteCreatedSpawnGroups|DeleteCreatedSpawnGroups]]
| <code>float GetBaseDamage() </code>
| <code>void DeleteCreatedSpawnGroups() </code>
|  
| DeleteCreatedSpawnGroups() : Deletes any spawn groups that this point_template has spawned. Note: The point_template will not be deleted by this.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.GetDamage| GetDamage]]
| [[Dota 2 Workshop Tools/Scripting/API/CPointTemplate.ForceSpawn|ForceSpawn]]
| <code>float GetDamage() </code>
| <code>void ForceSpawn() </code>
| Returns the damage value.
| ForceSpawn() : Spawns all of the entities the point_template is pointing at.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.GetDamageCustom| GetDamageCustom]]
| [[Dota 2 Workshop Tools/Scripting/API/CPointTemplate.GetSpawnedEntities|GetSpawnedEntities]]
| <code>int GetDamageCustom() </code>
| <code>handle GetSpawnedEntities() </code>
|  
| GetSpawnedEntities() : Get the list of the most recent spawned entities
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.GetDamageForce| GetDamageForce]]
| [[Dota 2 Workshop Tools/Scripting/API/CPointTemplate.SetSpawnCallback|SetSpawnCallback]]
| <code>Vector GetDamageForce() </code>
| <code>void SetSpawnCallback(handle hCallbackFunc, handle hCallbackScope) </code>
| Returns the damage force.
| SetSpawnCallback( hCallbackFunc, hCallbackScope, hCallbackData ) : Set a callback for when the template spawns entities. The spawned entities will be passed in as an array.
|-
|}
| [[Destinations/Scripting/API/CTakeDamageInfo.GetDamagePosition| GetDamagePosition]]
 
| <code>int GetDamagePosition() </code>
 
| Returns the damage position.
=== CPointWorldText===
|-
Entity class for [[point worldtext]].
| [[Destinations/Scripting/API/CTakeDamageInfo.GetDamageTaken| GetDamageTaken]]
 
| <code>float GetDamageTaken() </code>
==== Methods ====
|
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.GetDamageType| GetDamageType]]
| [[SteamVR/Environments/Scripting/API/CPointWorldText.SetMessage|SetMessage]]
| <code>int GetDamageType() </code>
| <code>void SetMessage(string ''pMessage'')</code>
| Returns the damage type bitfield.
| Set the message on this entity.
|}
 
 
=== CPropHMDAvatar ===
Entity class for [[prop hmd avatar]].
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.GetInflictor| GetInflictor]]
| [[Dota 2 Workshop Tools/Scripting/API/CPropHMDAvatar.GetVRHand|GetVRHand]]
| <code>CBaseEntity GetInflictor() </code>
| <code>CPropVRHand GetVRHand(int nHandID) </code>
| Returns the inflictor entity (usually the weapon).
| Get VR hand by ID (0 and 1).
|-
|}
| [[Destinations/Scripting/API/CTakeDamageInfo.GetMaxDamage| GetMaxDamage]]
 
| <code>float GetMaxDamage() </code>
 
|
=== CPropVRHand ===
|-
Entity class for [[prop vr hand]]. Represents a VR motion controller. The controllers can be enumerated for each player using the [[#CPropHMDAvatar|CPropHMDAvatar]]::GetVRHand() method.
| [[Destinations/Scripting/API/CTakeDamageInfo.GetOriginalDamage| GetOriginalDamage]]
 
| <code>float GetOriginalDamage() </code>
==== Methods ====
|
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.GetRadius| GetRadius]]
| [[SteamVR/Environments/Scripting/API/CPropVRHand.AddHandAttachment|AddHandAttachment]]
| <code>float GetRadius() </code>
| <code>void AddHandAttachment(handle ''attachment'') </code>
|  
| Add the attachment to this hand.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.GetReportedPosition| GetReportedPosition]]
| [[SteamVR/Environments/Scripting/API/CPropVRHand.AddHandModelOverride|AddHandModelOverride]]
| <code>Vector GetReportedPosition() </code>
| <code>void AddHandModelOverride(string ''modelName'') </code>
|  
| Add a model override for this hand.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.GetStabilityDamage| GetStabilityDamage]]
| [[SteamVR/Environments/Scripting/API/CPropVRHand.FindHandModelOverride|FindHandModelOverride]]
| <code>float GetStabilityDamage() </code>
| <code>handle FindHandModelOverride(string ''pModelName'') </code>
|  
| Find a specific model override for this hand.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.ScaleDamage| ScaleDamage]]
| [[SteamVR/Environments/Scripting/API/CPropVRHand.FireHapticPulse|FireHapticPulse]]
| <code>void ScaleDamage(float ''scaleAmount'') </code>
| <code>void FireHapticPulse(int ''strength'') </code>
|  
| Fire a haptic pulse on this hand. Integer range [0, 1, 2] for strength.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.SetAllowFriendlyFire| SetAllowFriendlyFire]]
| [[SteamVR/Environments/Scripting/API/CPropVRHand.FireHapticPulsePrecise|FireHapticPulsePrecise]]
| <code>void SetAllowFriendlyFire(bool ''allow'') </code>
| <code>void FireHapticPulsePrecise(int ''nPulseDuration'') </code>
|  
| Fire a haptic pulse on this hand. Specify the duration in micro seconds.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.SetAmmoType| SetAmmoType]]
| [[Dota 2 Workshop Tools/Scripting/API/CPropVRHand.GetHandAttachment|GetHandAttachment]]
| <code>void SetAmmoType(int''ammoType'') </code>
| <code>handle GetHandAttachment() </code>
|  
| Get the attachment on this hand.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.SetAttacker| SetAttacker]]
| [[SteamVR/Environments/Scripting/API/CPropVRHand.GetHandID|GetHandID]]
| <code>void SetAttacker(CBaseEntity ''attacker'') </code>
| <code>int GetHandID() </code>
|  
| Get the players hand ID for this hand.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.SetCanBeBlocked| SetCanBeBlocked]]
| [[SteamVR/Environments/Scripting/API/CPropVRHand.GetLiteralHandType|GetLiteralHandType]]
| <code>void SetCanBeBlocked(bool ''block'') </code>
| <code>int GetLiteralHandType() </code>
|  
| Get literal type for this hand.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.SetDamage| SetDamage]]
| [[SteamVR/Environments/Scripting/API/CPropVRHand.GetPlayer|GetPlayer]]
| <code>void SetDamage(float ''damage'') </code>
| <code>CBasePlayer GetPlayer() </code>
| Set new damage value.
| Get the player for this hand.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.SetDamageCustom| SetDamageCustom]]
| [[SteamVR/Environments/Scripting/API/CPropVRHand.GetVelocity|GetVelocity]]
| <code>void SetDamageCustom(int ''damageCustom'') </code>
| <code>Vector GetVelocity() </code>
|  
| Get the filtered controller velocity.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.SetDamageForce| SetDamageForce]]
| [[SteamVR/Environments/Scripting/API/CPropVRHand.GetVRControllerTypeName|GetVRControllerTypeName]]
| <code>void SetDamageForce(Vector ''damageForce'') </code>
| <code>string GetVRControllerTypeName() </code>
| Sets the damage force vector.  
| Returns the controller type name of the first found controller.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.SetDamagePosition| SetDamagePosition]]
| [[SteamVR/Environments/Scripting/API/CPropVRHand.RemoveAllHandModelOverrides|RemoveAllHandModelOverrides]]
| <code>void SetDamagePosition(Vector ''damagePosition'') </code>
| <code>void RemoveAllHandModelOverrides() </code>
| Sets the global space damage position.
| Remove all model overrides for this hand.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.SetDamageTaken| SetDamageTaken]]
| [[SteamVR/Environments/Scripting/API/CPropVRHand.RemoveHandAttachmentByHandle|RemoveHandAttachmentByHandle]]
| <code>void SetDamageTaken(int ''damageTaken'') </code>
| <code>void RemoveHandAttachmentByHandle(handle ''hAttachment'') </code>
|  
| Remove hand attachment by handle.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.SetDamageType| SetDamageType]]
| [[SteamVR/Environments/Scripting/API/CPropVRHand.RemoveHandModelOverride|RemoveHandModelOverride]]
| <code>void SetDamageType(int ''bitsDamageType'') </code>
| <code>void RemoveHandModelOverride(string ''pModelName'') </code>
| Set the damage type bitfield.
| Remove a model override for this hand.
|-
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.SetMaxDamage| SetMaxDamage]]
| [[Dota 2 Workshop Tools/Scripting/API/CPropVRHand.SetHandAttachment|SetHandAttachment]]
| <code>void SetMaxDamage(float ''maxDamage'') </code>
| <code>void SetHandAttachment(handle ''hAttachment'') </code>
|  
| Set the attachment for this hand.
|-
|}
| [[Destinations/Scripting/API/CTakeDamageInfo.SetOriginalDamage| SetOriginalDamage]]
 
| <code>void SetOriginalDamage(float ''originalDamage'') </code>
 
|
=== CScriptParticleManager ===
|-
Allows the creation and manipulation of particle systems.
| [[Destinations/Scripting/API/CTakeDamageInfo.SetRadius| SetRadius]]
| <code>void SetRadius(float ''radius'') </code>
|
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.SetReportedPosition| SetReportedPosition]]
| <code>void SetReportedPosition(Vector ''reportedPosition'') </code>
|
|-
| [[Destinations/Scripting/API/CTakeDamageInfo.SetStabilityDamage| SetStabilityDamage]]
| <code>void SetStabilityDamage(float ''stabilityDamage'') </code>
|
|}


 
''Global accessor variable:'' <code>ParticleManager</code>
=== Convars ===
Allows access to read and modify console variables.
 
''Global accessor variable:'' <code>ConVars</code>
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Function  
! Function  
Line 2,611: Line 2,759:
! Description  
! Description  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Convars.GetBool | GetBool]]
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.CreateParticle|CreateParticle]]
| <code>table GetBool(string variableName) </code>
| <code>int CreateParticle(string ''particleName'', int ''particleAttach'', handle ''owningEntity'') </code>
| GetBool(name) : returns the convar as a boolean flag.
| Creates a new particle effect. Returns the index of the created effect.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Convars.GetCommandClient | GetCommandClient]]
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.CreateParticleForPlayer|CreateParticleForPlayer]]
| <code>handle GetCommandClient() </code>
| <code>int CreateParticleForPlayer(string ''particleName'', int ''particleAttach'', handle ''owningEntity'', handle ''owningPlayer'') </code>
| GetCommandClient() : returns the player who issued this console command.
| Creates a new particle effect that only plays for the specified player. Returns the index of the created effect.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Convars.GetFloat | GetFloat]]
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.DestroyParticle|DestroyParticle]]
| <code>table GetFloat(string name) </code>
| <code>void DestroyParticle(int ''particleID'', bool ''immediately'') </code>
| GetFloat(name) : returns the convar as a ''float''. May return ''nil'' if no such convar.
| Destroys particle.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Convars.GetInt | GetInt]]
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.GetParticleReplacement|GetParticleReplacement]]
| <code>table GetInt(string string_1) </code>
| <code>string GetParticleReplacement(string ''string_1'', handle ''handle_2'') </code>
| GetInt(name) : returns the convar as an ''int''. May return ''nil'' if no such convar.
| No Description Set
|-
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.ReleaseParticleIndex|ReleaseParticleIndex]]
| <code>void ReleaseParticleIndex(int ''particleId'') </code>
| Frees the specified particle index
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Convars.GetStr | GetStr]]
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.SetParticleAlwaysSimulate|SetParticleAlwaysSimulate]]
| <code>table GetStr(string variableName) </code>
| <code>void SetParticleAlwaysSimulate(int ''int_1'') </code>
| GetStr(name) : returns the convar as a ''string''. May return ''nil'' if no such convar.
| No Description Set
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Convars.RegisterCommand | RegisterCommand]]
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.SetParticleControl|SetParticleControl]]
| <code>void RegisterCommand(string variableName, handle function, string helpText, int flags) </code>
| <code>void SetParticleControl(int ''particleId'', int ''controlIndex'', Vector ''controlData'') </code>
| RegisterCommand(name, fn, helpString, flags) : register a console command.
| Set the control point data for a control on a particle effect
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Convars.RegisterConvar | RegisterConvar]]
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.SetParticleControlEnt|SetParticleControlEnt]]
| <code>void RegisterConvar(string name, string defaultValue, string helpText, int flags) </code>
| <code>void SetParticleControlEnt(int ''particleId'', int ''controlIndex'', handle ''entity'', ParticleAttachment_t ''attachType'', string ''attachment'', Vector ''origin'', bool ''unknown'') </code>
| RegisterConvar(name, defaultValue, helpString, flags): register a new console variable.
| Attaches the control point to an entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Convars.SetBool | SetBool]]
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.SetParticleControlForward|SetParticleControlForward]]
| <code>void SetBool(string variableName, bool value) </code>
| <code>void SetParticleControlForward(int ''FXIndex'', int ''controlIndex'', Vector ''forward'') </code>
| SetBool(name, val) : sets the value of the convar to the ''bool''.
| Set the forward direction for a control point on a particle effect.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Convars.SetFloat | SetFloat]]
| [[SteamVR/Environments/Scripting/API/CScriptParticleManager.SetParticleControlOffset|SetParticleControlOffset]]
| <code>void SetFloat(string variableName, float value) </code>
| <code>void SetParticleControlOffset(int ''iIndex'', int ''iPoint'', Vector ''vecOffset'') </code>
| SetFloat(name, val) : sets the value of the convar to the ''float''.
| Set the linear offset for a control on a particle effect.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Convars.SetInt | SetInt]]
| [[Dota 2 Workshop Tools/Scripting/API/CScriptParticleManager.SetParticleControlOrientation|SetParticleControlOrientation]]
| <code>void SetInt(string string_1, int int_2) </code>
| <code>void SetParticleControlOrientation(int ''FXIndex'', int ''controlIndex'', Vector ''forward'', Vector ''right'', Vector ''up'') </code>
| SetInt(name, val) : sets the value of the convar to the ''int''.
| Set the orientation for a control point on a particle effect. {{note|This is left handed -- bad!!}}
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Convars.SetStr | SetStr]]
| [[SteamVR/Environments/Scripting/API/CScriptParticleManager.SetParticleControlOrientationFLU|SetParticleControlOrientationFLU]]
| <code>void SetStr(string string_1, string string_2) </code>
| <code>void SetParticleControlOrientationFLU(int ''FXIndex'', int ''controlIndex'', Vector ''forward'', Vector ''left'', Vector ''up'') </code>
| SetStr(name, val) : sets the value of the convar to the ''string''.
| Set the orientation for a control point on a particle effect.  
|}
|}


=== CRigidParticleTrail===
{{todo}}


=== Decider ===
''No Description Set''
==== Methods ====
{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
! Function  
! Function  
Line 2,666: Line 2,816:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/Decider.AddRule | AddRule]]
| [[SteamVR/Environments/Scripting/API/CRigidParticleTrail.AddPointGlobal|AddPointGlobal]]
| <code>bool AddRule(CRule rule) </code>
| <code>void AddPointGlobal(Vector ''vPos'', float ''flRadius'', Vector ''vColor'') </code>
| Add a CRule object (defined in rulescript_base.nut)
|  
|-
|-
| [[Destinations/Scripting/API/Decider.FindAllMatches | FindAllMatches]]
| [[SteamVR/Environments/Scripting/API/CRigidParticleTrail.AddPointLocal|AddPointLocal]]
| <code>handle FindAllMatches(handle query, float leeway) </code>
| <code>void AddPointLocal(Vector ''vPos'', float ''flRadius'', Vector ''vColor'') </code>
| Returns an array of all matching responses. If leeway is nonzero, all results scoring within 'leeway' of the best score return.
|  
|-
| [[Destinations/Scripting/API/Decider.FindBestMatch | FindBestMatch]]
| <code>handle FindBestMatch(handle query) </code>
| Query the database and return the best result found. If multiple of equal score found, an arbitrary one returns.
|}
|}




=== GlobalSys ===
=== CSteamToursBaseGameMode ===
Used to read the command line parameters the game was started with.
Game mode entity.


''Global accessor variable:'' <code>GlobalSys</code>
Global object accessed via GameRules:GetGameModeEntity()


==== Methods ====
==== Methods ====
Line 2,691: Line 2,837:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/GlobalSys.CommandLineCheck | CommandLineCheck]]
| [[SteamVR/Environments/Scripting/API/CSteamToursBaseGameMode.GetDetectorQuestCount|GetDetectorQuestCount]]
| <code>bool CommandLineCheck(string name) </code>
| <code>int GetDetectorQuestCount(CBasePlayer ''player'') </code>
| Returns true if the command line param was used, otherwise false.
| Returns the number of active detector quests for the given player.
|-
| [[SteamVR/Environments/Scripting/API/CSteamToursBaseGameMode.GetDetectorQuestID|GetDetectorQuestID]]
| <code>string GetDetectorQuestID(CBasePlayer ''player'', int ''idx'') </code>
| Returns the detector quest's ID, if any, for the given player and index.
|-
|-
| [[Destinations/Scripting/API/GlobalSys.CommandLineFloat | CommandLineFloat]]
| [[SteamVR/Environments/Scripting/API/CSteamToursBaseGameMode.GetDetectorQuestLocation|GetDetectorQuestLocation]]
| <code>float CommandLineFloat(string name) </code>
| <code>Vector GetDetectorQuestLocation(CBasePlayer ''player'', int ''idx'') </code>
| Returns the command line param as a float.
| Returns the detector quest location, if any, for the given player and index.
|-
|-
| [[Destinations/Scripting/API/GlobalSys.CommandLineInt | CommandLineInt]]
| [[SteamVR/Environments/Scripting/API/CSteamToursBaseGameMode.GetDetectorQuestNumItemsUnlocked|GetDetectorQuestNumItemsUnlocked]]
| <code>int CommandLineInt(string name) </code>
| <code>int GetDetectorQuestNumItemsUnlocked(CBasePlayer ''player'', string ''questID'') </code>
| Returns the command line param as an int.
| Returns the number of items unlocked for the player and quest.
|-
|-
| [[Destinations/Scripting/API/GlobalSys.CommandLineStr | CommandLineStr]]
| [[SteamVR/Environments/Scripting/API/CSteamToursBaseGameMode.GetDetectorQuestUnlockedItemDefID|GetDetectorQuestUnlockedItemDefID]]
| <code>string CommandLineStr(string name) </code>
| <code>string GetDetectorQuestUnlockedItemDefID(CBasePlayer ''player'', string ''questID'', int ''idx'') </code>
| Returns the command line param as a string.
| Returns the item definition ID for the item that was unlocked for the given player and quest.
|}
|-
| [[SteamVR/Environments/Scripting/API/CSteamToursBaseGameMode.UnlockItem|UnlockItem]]
| <code>void UnlockItem(CBasePlayer ''player'', string ''itemName'') </code>
| Unlocks an item from /scripts/contentdb.txt for the given player. Item names are set using the dev_name key.
|}
 


=== CSteamToursGameRules ===
Game rule manager.


=== Uint64 ===
''Global accessor variable:'' <code>GameRules</code>
Integer with binary operations. Used for motion controller button masks.


==== Methods ====
==== Methods ====
Line 2,718: Line 2,874:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/Uint64.BitwiseAnd| BitwiseAnd]]
| [[SteamVR/Environments/Scripting/API/CSteamToursGameRules.GetGameModeEntity|GetGameModeEntity]]
| <code>int BitwiseAnd(Uint64 ''operand'') </code>
| <code>CSteamToursBaseGameMode GetGameModeEntity() </code>
| Performs bitwise AND between two integers.
| Returns the game mode entity.
|-
| [[Destinations/Scripting/API/Uint64.BitwiseOr| BitwiseOr]]
| <code>int BitwiseOr(Uint64 ''operand'') </code>
| Performs bitwise OR between two integers.
|-
|-
| [[Destinations/Scripting/API/Uint64.BitwiseXor| BitwiseXor]]
| [[SteamVR/Environments/Scripting/API/CSteamToursGameRules.GetItemDefData|GetItemDefData]]
| <code>int BitwiseXor(Uint64 ''operand'') </code>
| <code>table GetItemDefData(string ''itemID'')</code>
| Performs bitwise XOR between two integers.
| Gets the item definition data for the specified item def ID.
|-
|-
| [[Destinations/Scripting/API/Uint64.BitwiseNot| BitwiseNot]]
| [[SteamVR/Environments/Scripting/API/CSteamToursGameRules.SetPlayersCanSpawnAnyItems|SetPlayersCanSpawnAnyItems]]
| <code>int BitwiseNot(Uint64 ''operand'') </code>
| <code>void SetPlayersCanSpawnAnyItems(bool ''allowItems'') </code>
| Performs bitwise NOT between two integers.
| Allow control of whether players can spawn any items or not.
|-
|-
| [[Destinations/Scripting/API/Uint64.ClearBit| ClearBit]]
| [[SteamVR/Environments/Scripting/API/CSteamToursGameRules.SetPlayersCanSpawnTools|SetPlayersCanSpawnTools]]
| <code>int ClearBit(int ''bitvalue'') </code>
| <code>void SetPlayersCanSpawnTools(bool ''allowTools'') </code>
| Clears the specified bit.
| Allow control of whether players can spawn tools or not.
|-
|}
| [[Destinations/Scripting/API/Uint64.IsBitSet| IsBitSet]]
 
| <code>bool IsBitSet(int ''bitvalue'') </code>
 
| Checks if a bit is set.
=== CSteamTours_ItemTool_Base ===
|-
Entity class for [[steamtours itemtool base]]. This is the hand attachment model spawned when holding a tool.
| [[Destinations/Scripting/API/Uint64.SetBit| SetBit]]
 
| <code>int SetBit(int ''bitvalue'') </code>
The color picker widget attaches to the <code>color_picker</code> attachment point on the tool model.
| Sets the specified bit.
|-
| [[Destinations/Scripting/API/Uint64.ToggleBit| ToggleBit]]
| <code>int ToggleBit(int ''bitvalue'') </code>
| Toggles the specified bit.
|-
| [[Destinations/Scripting/API/Uint64.ToHexString| ToHexString]]
| <code>string ToHexString() </code>
| Returns a hexadecimal string representation of the integer.
|}
 
 
=== QAngle ===
Class for angles.


==== Methods ====
==== Methods ====
Line 2,765: Line 2,903:
! Description  
! Description  
|-
|-
| [[Destinations/Scripting/API/QAngle.constructor | constructor ]]
| [[SteamVR/Environments/Scripting/API/CSteamTours ItemTool Base.GetColorPickerChannel|GetColorPickerChannel]]
| <code>QAngle(pitch, yaw, roll) </code>
| <code>int GetColorPickerChannel() </code>
| Creates a new QAngle.
| Returns the color picker's current channel index, or -1 if none.
|-
| [[SteamVR/Environments/Scripting/API/CSteamTours ItemTool Base.GetColorPickerColor|GetColorPickerColor]]
| <code>Vector GetColorPickerColor() </code>
| Returns a Vector containing RGB (0..255)
|-
| [[SteamVR/Environments/Scripting/API/CSteamTours ItemTool Base.GetColorPickerHSV|GetColorPickerHSV]]
| <code>Vector GetColorPickerHSV() </code>
| Returns a Vector containing Hue (0..360) Saturation (0..1) Value (0..1)
|-
| [[SteamVR/Environments/Scripting/API/CSteamTours ItemTool Base.GetColorPickerMode|GetColorPickerMode]]
| <code>unsigned GetColorPickerMode() </code>
|
|-
| [[SteamVR/Environments/Scripting/API/CSteamTours ItemTool Base.HandleColorPickerInput|HandleColorPickerInput]]
| <code>void HandleColorPickerInput(float ''x'', float ''y'') </code>
| Updates HSV/color and current channel.
|-
|-
| [[Destinations/Scripting/API/QAngle.__add | __add]]
| [[SteamVR/Environments/Scripting/API/CSteamTours ItemTool Base.GetColorPickerChannel|GetColorPickerChannel]]
| <code>QAngle __add(QAngle a, QAngle b) </code>
| <code>bool IsColorPickerVisible() </code>
| Overloaded +.  Adds angles together. {{note|Use RotateOrientation() instead to properly rotate angles.}}
|  
|-
|-
| [[Destinations/Scripting/API/QAngle.__eq | __eq]]
| [[SteamVR/Environments/Scripting/API/CSteamTours ItemTool Base.SetColorPickerChannel|SetColorPickerChannel]]
| <code>bool __eq(QAngle a, QAngle b) </code>
| <code>void SetColorPickerChannel(int ''nChannel'') </code>
| Overloaded ==. Tests for Equality
| Sets the color picker's current channel index. (use -1 if none)
|-
|-
| [[Destinations/Scripting/API/QAngle.__tostring | __tostring]]
| [[SteamVR/Environments/Scripting/API/CSteamTours ItemTool Base.SetColorPickerColor|SetColorPickerColor]]
| <code>string __tostring() </code>
| <code>void SetColorPickerColor(Vector ''vColor'') </code>
| Overloaded .. Converts the QAngle to a human readable string.
| Takes a Vector containing RGB (0..255)
|-
|-
| [[Destinations/Scripting/API/QAngle.Forward| Forward]]
| [[SteamVR/Environments/Scripting/API/CSteamTours ItemTool Base.SetColorPickerHSV|SetColorPickerHSV]]
| <code>Vector Forward() </code>
| <code>void SetColorPickerHSV(Vector ''vHSV'') </code>
| Returns the forward vector.
| Takes a Vector containing Hue (0..360) Saturation (0..1) Value (0..1)
|-
|-
| [[Destinations/Scripting/API/QAngle.Left| Left]]
| [[SteamVR/Environments/Scripting/API/CSteamTours ItemTool Base.SetColorPickerMode|SetColorPickerMode]]
| <code>Vector Left() </code>
| <code>void SetColorPickerMode(unsigned ''nMode'') </code>
| Returns the left vector.
|  
|-
|-
| [[Destinations/Scripting/API/QAngle.Up| Up]]
| [[SteamVR/Environments/Scripting/API/CSteamTours ItemTool Base.SetColorPickerVisible|SetColorPickerVisible]]
| <code>Vector Up() </code>
| <code>void SetColorPickerVisible(bool ''bVisible'') </code>
| Returns the up vector.
|  
|}
|}
 
 
=== SteamInfo ===
 


==== Members ====
==== Methods ====
{| class="standard-table" style="width: 50%;"
{| class="standard-table" style="width: 100%;"
! Variable
! Function
! Signature
! Description  
! Description  
|-
|-
| <code>x </code>
| [[SteamVR/Environments/Scripting/API/SteamInfo.IsPublicUniverse|IsPublicUniverse]]
| Pitch angle
| <code>bool IsPublicUniverse() </code>
|-
| Is the script connected to the public Steam universe.
| <code>y </code>
| Yaw angle
|-
| <code>z </code>
| Roll angle
|}
|}


=== Quarternion ===
Class for quaterinions.


''Global accessor variable:'' None available
=== CTakeDamageInfo ===
 
DamageInfo handle returned by <code>CreateDamageInfo()</code>
{{todo| List of methods doesn't seem to be available.}}
 
=== Vector ===
3D vector class.


==== Methods ====
==== Methods ====
Line 2,823: Line 2,971:
! Function  
! Function  
! Signature  
! Signature  
! Description  
! Description
|-
|-
| [[Destinations/Scripting/API/Vector.constructor | constructor ]]
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.AddDamage|AddDamage]]
| <code>Vector(x, y, z) </code>
| <code>void AddDamage(float ''addAmount'') </code>
| Creates a new vector with the specified Cartesian coordinates.
| Adds to the damage value.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.__add | __add]]
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.AddDamageType|AddDamageType]]
| <code>Vector __add(Vector a, Vector b) </code>
| <code>void  AddDamageType(int ''bitsDamageType'') </code>
| Overloaded +.  Adds vectors together.
| Adds damage type bit flags.  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.__div | __div]]
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.AllowFriendlyFire|AllowFriendlyFire]]
| <code>Vector __div(Vector a, Vector b) </code>
| <code>bool AllowFriendlyFire() </code>
| Overloaded /.  Divides vectors.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.__eq | __eq]]
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.BaseDamageIsValid|BaseDamageIsValid]]
| <code>bool __eq(Vector a, Vector b) </code>
| <code>bool BaseDamageIsValid() </code>
| Overloaded ==.  Tests for Equality.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.__len | __len]]
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.CanBeBlocked|CanBeBlocked]]
| <code>float __len() </code>
| <code>bool CanBeBlocked() </code>
| Overloaded # returns the length of the vector.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.__mul | __mul]]
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetAmmoType|GetAmmoType]]
| <code>Vector __mul(Vector a, Vector b) </code>
| <code>int GetAmmoType() </code>
| Overloaded * returns the vectors multiplied together. can also be used to multiply with scalars.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.__sub | __sub]]
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetAttacker|GetAttacker]]
| <code>Vector __sub(Vector a, Vector b) </code>
| <code>CBaseEntity GetAttacker() </code>
| Overloaded -. Subtracts vectors
| Returns the attacker entity.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.__tostring | __tostring]]
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetBaseDamage|GetBaseDamage]]
| <code>string __tostring() </code>
| <code>float GetBaseDamage() </code>
| Overloaded .. Converts vectors to strings
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.__unm | __unm]]
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetDamage|GetDamage]]
| <code>Vector __unm() </code>
| <code>float GetDamage() </code>
| Overloaded unary - operator. Reverses the vector.
| Returns the damage value.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.Cross | Cross]]
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetDamageCustom|GetDamageCustom]]
| <code>Vector Cross(Vector a, Vector b) </code>
| <code>int GetDamageCustom() </code>
| Cross product of two vectors.
|  
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.Dot | Dot]]
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetDamageForce|GetDamageForce]]
| <code>float Dot(Vector a, Vector b) </code>
| <code>Vector GetDamageForce() </code>
| Dot product of two vectors.
| Returns the damage force.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.Length | Length]]
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetDamagePosition|GetDamagePosition]]
| <code>float Length() </code>
| <code>int GetDamagePosition() </code>
| Length of the Vector.
| Returns the damage position.
|-
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetDamageTaken|GetDamageTaken]]
| <code>float GetDamageTaken() </code>
|
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.Length2D | Length2D]]
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetDamageType|GetDamageType]]
| <code>float Length2D() </code>
| <code>int GetDamageType() </code>
| Length of the Vector in the XY plane.
| Returns the damage type bitfield.
|-
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.Normalized | Normalized]]
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetInflictor|GetInflictor]]
| <code>Vector Normalized() </code>
| <code>CBaseEntity GetInflictor() </code>
| Returns the vector normalized.
| Returns the inflictor entity (usually the weapon).
|}
 
==== Members ====
{| class="standard-table" style="width: 50%;"
! Variable
! Description
|-
|-
| <code>x </code>
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetMaxDamage|GetMaxDamage]]
| X-axis
| <code>float GetMaxDamage() </code>
|  
|-
|-
| <code>y </code>
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetOriginalDamage|GetOriginalDamage]]
| Y-axis
| <code>float GetOriginalDamage() </code>
|  
|-
|-
| <code>z </code>
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetRadius|GetRadius]]
| Z-axis
| <code>float GetRadius() </code>
|}
|  
 
== Enumerations ==
{{todo|More undocumented enumerations exist.}}
 
=== Damage types ===
{| class="standard-table" style="width: 50%;"
! Name
! Value
! Description
|-
|-
| DMG_GENERIC
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetReportedPosition|GetReportedPosition]]
| 0
| <code>Vector GetReportedPosition() </code>
|  
|  
|-
|-
| DMG_CRUSH
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.GetStabilityDamage|GetStabilityDamage]]
| 1
| <code>float GetStabilityDamage() </code>
|  
|  
|-
|-
| DMG_BULLET
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.ScaleDamage|ScaleDamage]]
| 2
| <code>void ScaleDamage(float ''scaleAmount'') </code>
|  
|  
|-
|-
| DMG_SLASH
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetAllowFriendlyFire|SetAllowFriendlyFire]]
| 4
| <code>void SetAllowFriendlyFire(bool ''allow'') </code>
|  
|  
|-
|-
| DMG_BURN
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetAmmoType|SetAmmoType]]
| 8
| <code>void SetAmmoType(int''ammoType'') </code>
|  
|  
|-
|-
| DMG_BLAST
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetAttacker|SetAttacker]]
| 64
| <code>void SetAttacker(CBaseEntity ''attacker'') </code>
|  
|  
|-
|-
| DMG_SHOCK
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetCanBeBlocked|SetCanBeBlocked]]
| 256
| <code>void SetCanBeBlocked(bool ''block'') </code>
|  
|  
|}
=== Motion controller buttons ===
{| class="standard-table" style="width: 50%;"
! Name
! Value
! Description
|-
|-
| IN_USE_HAND0
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetDamage|SetDamage]]
| 24
| <code>void SetDamage(float ''damage'') </code>
| When the trigger is pressed.
| Set new damage value.
|-
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetDamageCustom|SetDamageCustom]]
| <code>void SetDamageCustom(int ''damageCustom'') </code>
|
|-
|-
| IN_USE_HAND1
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetDamageForce|SetDamageForce]]
| 25
| <code>void SetDamageForce(Vector ''damageForce'') </code>
| When the trigger is pressed.
| Sets the damage force vector.  
|-
|-
| IN_PAD_LEFT_HAND0
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetDamagePosition|SetDamagePosition]]
| 26
| <code>void SetDamagePosition(Vector ''damagePosition'') </code>
| When the pad is pressed on the left side.
| Sets the global space damage position.
|-
|-
| IN_PAD_RIGHT_HAND0
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetDamageTaken|SetDamageTaken]]
| 27
| <code>void SetDamageTaken(int ''damageTaken'') </code>
| When the pad is pressed on the right side.
|  
|-
|-
| IN_PAD_UP_HAND0
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetDamageType|SetDamageType]]
| 28
| <code>void SetDamageType(int ''bitsDamageType'') </code>
| When the pad is pressed on the top.
| Set the damage type bitfield.
|-
|-
| IN_PAD_DOWN_HAND0
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetMaxDamage|SetMaxDamage]]
| 29
| <code>void SetMaxDamage(float ''maxDamage'') </code>
| When the pad is pressed on the bottom.
|  
|-
|-
| IN_PAD_LEFT_HAND1
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetOriginalDamage|SetOriginalDamage]]
| 30
| <code>void SetOriginalDamage(float ''originalDamage'') </code>
| When the pad is pressed on the left side.
|  
|-
|-
| IN_PAD_RIGHT_HAND1
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetRadius|SetRadius]]
| 31
| <code>void SetRadius(float ''radius'') </code>
| When the pad is pressed on the right side.
|
|-
|-
| IN_PAD_UP_HAND1
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetReportedPosition|SetReportedPosition]]
| 32
| <code>void SetReportedPosition(Vector ''reportedPosition'') </code>
| When the pad is pressed on the top.
|  
|-
|-
| IN_PAD_DOWN_HAND1
| [[SteamVR/Environments/Scripting/API/CTakeDamageInfo.SetStabilityDamage|SetStabilityDamage]]
| 33
| <code>void SetStabilityDamage(float ''stabilityDamage'') </code>
| When the pad is pressed on the bottom.
|
|}
 
 
=== CVROverlayEntity ===
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| IN_MENU_HAND0
| [[SteamVR/Environments/Scripting/API/CVROverlayEntity.IsGrabbable|IsGrabbable]]
| 34
| <code>bool IsGrabbable() </code>
| Menu button above the touchpad.
| Returns whether this entity is grabbable.
|}
 
 
=== Convars ===
Allows access to read and modify console variables.
 
''Global accessor variable:'' <code>ConVars</code>
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| IN_MENU_HAND1
| [[Dota 2 Workshop Tools/Scripting/API/Convars.GetBool|GetBool]]
| 35
| <code>table GetBool(string variableName) </code>
| Menu button above the touchpad.
| GetBool(name) : returns the convar as a boolean flag.
|-
|-
| IN_GRIP_HAND0
| [[Dota 2 Workshop Tools/Scripting/API/Convars.GetCommandClient|GetCommandClient]]
| 36
| <code>handle GetCommandClient() </code>
| Grip.
| GetCommandClient() : returns the player who issued this console command.
|-
|-
| IN_GRIP_HAND1
| [[Dota 2 Workshop Tools/Scripting/API/Convars.GetFloat|GetFloat]]
| 37
| <code>table GetFloat(string name) </code>
| Grip.
| GetFloat(name) : returns the convar as a ''float''. May return ''nil'' if no such convar.
|-
|-
| IN_GRIPANALOG_HAND0
| [[Dota 2 Workshop Tools/Scripting/API/Convars.GetInt|GetInt]]
|
| <code>table GetInt(string string_1) </code>
|  
| GetInt(name) : returns the convar as an ''int''. May return ''nil'' if no such convar.
|-
|-
| IN_GRIPANALOG_HAND1
| [[Dota 2 Workshop Tools/Scripting/API/Convars.GetStr|GetStr]]
|
| <code>table GetStr(string variableName) </code>
|  
| GetStr(name) : returns the convar as a ''string''. May return ''nil'' if no such convar.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Convars.RegisterCommand|RegisterCommand]]
| <code>void RegisterCommand(string variableName, handle function, string helpText, int flags) </code>
| RegisterCommand(name, fn, helpString, flags) : register a console command.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Convars.RegisterConvar|RegisterConvar]]
| <code>void RegisterConvar(string name, string defaultValue, string helpText, int flags) </code>
| RegisterConvar(name, defaultValue, helpString, flags): register a new console variable.
|-
|-
| IN_PAD_HAND0
| [[Dota 2 Workshop Tools/Scripting/API/Convars.SetBool|SetBool]]
| 38
| <code>void SetBool(string variableName, bool value) </code>
| When the pad is pressed anywhere.
| SetBool(name, val) : sets the value of the convar to the ''bool''.
|-
|-
| IN_PAD_HAND1
| [[Dota 2 Workshop Tools/Scripting/API/Convars.SetFloat|SetFloat]]
| 39
| <code>void SetFloat(string variableName, float value) </code>
| When the pad is pressed anywhere.
| SetFloat(name, val) : sets the value of the convar to the ''float''.
|-
|-
| IN_PAD_TOUCH_HAND0
| [[Dota 2 Workshop Tools/Scripting/API/Convars.SetInt|SetInt]]
| 40
| <code>void SetInt(string string_1, int int_2) </code>
| When the pad is touched anywhere.
| SetInt(name, val) : sets the value of the convar to the ''int''.
|-
|-
| IN_PAD_TOUCH_HAND1
| [[Dota 2 Workshop Tools/Scripting/API/Convars.SetStr|SetStr]]
| 41
| <code>void SetStr(string string_1, string string_2) </code>
| When the pad is touched anywhere.
| SetStr(name, val) : sets the value of the convar to the ''string''.
|}
|}




=== ParticleAttachment_t ===
=== Decider ===
{| class="standard-table" style="width: 50%;"
''No Description Set''
! Name
 
! Value
==== Methods ====
! Description
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description  
|-
|-
| PATTACH_INVALID
| [[SteamVR/Environments/Scripting/API/Decider.AddRule|AddRule]]
| -1
| <code>bool AddRule(CRule rule) </code>
|  
| Add a CRule object (defined in rulescript_base.nut)
|-
|-
| PATTACH_ABSORIGIN
| [[SteamVR/Environments/Scripting/API/Decider.FindAllMatches|FindAllMatches]]
| 0
| <code>handle FindAllMatches(handle query, float leeway) </code>
| Spawn on entity origin.
| Returns an array of all matching responses. If leeway is nonzero, all results scoring within 'leeway' of the best score return.  
|-
|-
| PATTACH_ABSORIGIN_FOLLOW
| [[SteamVR/Environments/Scripting/API/Decider.FindBestMatch|FindBestMatch]]
| 1
| <code>handle FindBestMatch(handle query) </code>
| Follow the entity origin.
| Query the database and return the best result found. If multiple of equal score found, an arbitrary one returns.
|}
 
 
=== GlobalSys ===
Used to read the command line parameters the game was started with.
 
''Global accessor variable:'' <code>GlobalSys</code>
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
|-
| PATTACH_CUSTOMORIGIN
| [[SteamVR/Environments/Scripting/API/GlobalSys.CommandLineCheck|CommandLineCheck]]
| 2
| <code>bool CommandLineCheck(string name) </code>
|  
| Returns true if the command line param was used, otherwise false.
|-
| [[SteamVR/Environments/Scripting/API/GlobalSys.CommandLineFloat|CommandLineFloat]]
| <code>float CommandLineFloat(string name) </code>
| Returns the command line param as a float.
|-
| [[SteamVR/Environments/Scripting/API/GlobalSys.CommandLineInt|CommandLineInt]]
| <code>int CommandLineInt(string name) </code>
| Returns the command line param as an int.
|-
| [[SteamVR/Environments/Scripting/API/GlobalSys.CommandLineStr|CommandLineStr]]
| <code>string CommandLineStr(string name) </code>
| Returns the command line param as a string.
|}
 
 
=== Uint64 ===
Integer with binary operations. Used for motion controller button masks.
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
| [[SteamVR/Environments/Scripting/API/Uint64.BitwiseAnd|BitwiseAnd]]
| <code>int BitwiseAnd(Uint64 ''operand'') </code>
| Performs bitwise AND between two integers.
|-
|-
| PATTACH_CUSTOMORIGIN_FOLLOW
| [[SteamVR/Environments/Scripting/API/Uint64.BitwiseOr|BitwiseOr]]
| 3
| <code>int BitwiseOr(Uint64 ''operand'') </code>
|  
| Performs bitwise OR between two integers.
|-
|-
| PATTACH_POINT
| [[SteamVR/Environments/Scripting/API/Uint64.BitwiseXor|BitwiseXor]]
| 4
| <code>int BitwiseXor(Uint64 ''operand'') </code>
| Spawn on entity attachment point.
| Performs bitwise XOR between two integers.
|-
| [[SteamVR/Environments/Scripting/API/Uint64.BitwiseNot|BitwiseNot]]
| <code>int BitwiseNot(Uint64 ''operand'') </code>
| Performs bitwise NOT between two integers.
|-
| [[SteamVR/Environments/Scripting/API/Uint64.ClearBit|ClearBit]]
| <code>int ClearBit(int ''bitvalue'') </code>
| Clears the specified bit.
|-
| [[SteamVR/Environments/Scripting/API/Uint64.IsBitSet|IsBitSet]]
| <code>bool IsBitSet(int ''bitvalue'') </code>
| Checks if a bit is set.
|-
| [[SteamVR/Environments/Scripting/API/Uint64.SetBit|SetBit]]
| <code>int SetBit(int ''bitvalue'') </code>
| Sets the specified bit.
|-
| [[SteamVR/Environments/Scripting/API/Uint64.ToggleBit|ToggleBit]]
| <code>int ToggleBit(int ''bitvalue'') </code>
| Toggles the specified bit.
|-
| [[SteamVR/Environments/Scripting/API/Uint64.ToHexString|ToHexString]]
| <code>string ToHexString() </code>
| Returns a hexadecimal string representation of the integer.
|}
 
 
=== QAngle ===
Class for angles.
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
| [[SteamVR/Environments/Scripting/API/QAngle.constructor|constructor]]
| <code>QAngle(float ''pitch'', float ''yaw'', float ''roll'') </code>
| Creates a new QAngle.
|-
| [[SteamVR/Environments/Scripting/API/QAngle.  add|__add]]
| <code>QAngle __add(QAngle ''a'', QAngle ''b'') </code>
| Overloaded +.  Adds angles together. {{note|Use RotateOrientation() instead to properly rotate angles.}}
|-
| [[SteamVR/Environments/Scripting/API/QAngle.  eq|__eq]]
| <code>bool __eq(QAngle ''a'', QAngle b'') </code>
| Overloaded ==.  Tests for Equality
|-
| [[SteamVR/Environments/Scripting/API/QAngle.  tostring|__tostring]]
| <code>string __tostring() </code>
| Overloaded .. Converts the QAngle to a human readable string.
|-
| [[SteamVR/Environments/Scripting/API/QAngle.Forward|Forward]]
| <code>Vector Forward() </code>
| Returns the forward vector.
|-
| [[SteamVR/Environments/Scripting/API/QAngle.Left|Left]]
| <code>Vector Left() </code>
| Returns the left vector.
|-
| [[SteamVR/Environments/Scripting/API/QAngle.Up|Up]]
| <code>Vector Up() </code>
| Returns the up vector.
|}
 
==== Members ====
{| class="standard-table" style="width: 50%;"
! Variable
! Description
|-
| <code>x </code>
| Pitch angle
|-
| <code>y </code>
| Yaw angle
|-
| <code>z </code>
| Roll angle
|}
 
=== Quarternion ===
Class for quaterinions.
 
''Global accessor variable:'' None available
 
{{bug|hidetested=1| This class is broken and cannot be instantiated.}}
{{todo| List of methods doesn't seem to be available.}}
 
=== Vector ===
3D vector class.
 
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
| [[SteamVR/Environments/Scripting/API/Vector.constructor|constructor]]
| <code>Vector(float ''x'', float ''y'', float ''z'') </code>
| Creates a new vector with the specified Cartesian coordinates.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.  add|__add]]
| <code>Vector __add(Vector ''a'', Vector ''b'') </code>
| Overloaded +.  Adds vectors together.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.  div|__div]]
| <code>Vector __div(Vector ''a'', Vector ''b'') </code>
| Overloaded /.  Divides vectors.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.  eq|__eq]]
| <code>bool __eq(Vector ''a'', Vector ''b'') </code>
| Overloaded ==.  Tests for Equality.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.  len|__len]]
| <code>float __len() </code>
| Overloaded # returns the length of the vector.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.  mul|__mul]]
| <code>Vector __mul(Vector ''a'', Vector ''b'') </code>
| Overloaded * returns the vectors multiplied together. can also be used to multiply with scalars.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.  sub|__sub]]
| <code>Vector __sub(Vector ''a'', Vector ''b'') </code>
| Overloaded -.  Subtracts vectors
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.  tostring|__tostring]]
| <code>string __tostring() </code>
| Overloaded .. Converts vectors to strings
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.  unm|__unm]]
| <code>Vector __unm() </code>
| Overloaded unary - operator. Reverses the vector.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.Cross|Cross]]
| <code>Vector Cross(Vector ''a'', Vector ''b'') </code>
| Cross product of two vectors.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.Dot|Dot]]
| <code>float Dot(Vector ''a'', Vector ''b'') </code>
| Dot product of two vectors.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.Length|Length]]
| <code>float Length() </code>
| Length of the Vector.
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.Length2D|Length2D]]
| <code>float Length2D() </code>
| Length of the Vector in the XY plane.
|-
| [[SteamVR/Environments/Scripting/API/Vector.Lerp|Lerp]]
| <code>Vector Lerp(Vector ''target'', float ''t'') </code>
| Linear interpolation between the vector and the passed in target over ''t'' = [0,1].
|-
| [[Dota 2 Workshop Tools/Scripting/API/Vector.Normalized|Normalized]]
| <code>Vector Normalized() </code>
| Returns the vector normalized.
|}
 
==== Members ====
{| class="standard-table" style="width: 50%;"
! Variable
! Description
|-
| <code>x </code>
| X-axis
|-
| <code>y </code>
| Y-axis
|-
| <code>z </code>
| Z-axis
|}
 
== Enumerations ==
{{todo|More undocumented enumerations exist.}}
 
 
=== Activation types ===
Passed to the <code>Activate()</code> hook function.
{| class="standard-table" style="width: 50%;"
! Name
! Value
! Description
|-
| ACTIVATE_TYPE_INITIAL_CREATION
| 0
| When the function is called after entity creation.
|-
| ACTIVATE_TYPE_DATAUPDATE_CREATION
| 1
| {{todo}}
|-
| ACTIVATE_TYPE_ONRESTORE
| 2
| When the function is called after the entity has been restored from a saved game.
|}
 
 
=== Damage types ===
{| class="standard-table" style="width: 50%;"
! Name
! Value
! Description
|-
| DMG_GENERIC
| 0
|
|-
| DMG_CRUSH
| 1
|
|-
| DMG_BULLET
| 2
|
|-
| DMG_SLASH
| 4
|
|-
| DMG_BURN
| 8
|
|-
| DMG_VEHICLE
| 16
|
|-
| DMG_FALL
| 32
|
|-
| DMG_BLAST
| 64
|
|-
| DMG_CLUB
| 128
|
|-
| DMG_SHOCK
| 256
|
|-
| DMG_SONIC
| 512
|
|-
| DMG_ENERGYBEAM
| 1024
|
|-
| DMG_PREVENT_PHYSICS_FORCE
| 2048
|
|-
| DMG_NEVERGIB
| 4096
|
|-
| DMG_ALWAYSGIB
| 8192
|
|-
| DMG_DROWN
| 16384
|
|-
| DMG_PARALYZE
| 32768
|
|-
| DMG_NERVEGAS
| 65536
|
|-
| DMG_POISON
| 131072
|
|-
| DMG_RADIATION
| 262144
|
|-
| DMG_DROWNRECOVER
| 524288
|
|-
| DMG_ACID
| 1048576
|
|-
| DMG_SLOWBURN
| 2097152
|
|-
| DMG_REMOVENORAGDOLL
| 4194304
|
|-
| DMG_PHYSGUN
| 8388608
|
|-
| DMG_PLASMA
| 16777216
|
|-
| DMG_AIRBOAT
| 33554432
|
|-
| DMG_DISSOLVE
| 67108864
|
|-
| DMG_BLAST_SURFACE
| 134217728
|
|-
| DMG_DIRECT
| 268435456
|
|}
 
 
=== Controller types ===
Player VR controller types returned by <code>CBasePlayer::GetVRControllerType()</code>
 
{| class="standard-table" style="width: 50%;"
! Name
! Value
! Description
|-
| VR_CONTROLLER_TYPE_UNKNOWN
| 0
|
|-
| VR_CONTROLLER_TYPE_X360
| 1
|
|-
| VR_CONTROLLER_TYPE_VIVE
| 2
|
|-
| VR_CONTROLLER_TYPE_TOUCH
| 3
|
|-
| VR_CONTROLLER_TYPE_RIFT_S
| 4
|
|-
|
| 5
| {{todo| Unknown, no enum available.}}
|-
| VR_CONTROLLER_TYPE_KNUCKLES
| 6
|
|-
| VR_CONTROLLER_TYPE_WINDOWSMR
| 7
|
|-
| VR_CONTROLLER_TYPE_WINDOWSMR_SAMSUNG
| 8
|
|-
| VR_CONTROLLER_TYPE_GENERIC_TRACKED
| 9
|
|-
| VR_CONTROLLER_TYPE_COSMOS
| 10
|
|}
 
 
=== Input digital actions ===
Corresponds to the SteamVR Input key binds. Used in <code>CBasePlayer::IsActionActiveForHand()</code>
{| class="standard-table" style="width: 50%;"
! Name
! Value
! Description
|-
| DEFAULT_TOGGLE_MENU
| 0
|
|-
| DEFAULT_LCLICK
| 1
|
|-
| DEFAULT_RCLICK
| 2
|
|-
| DEFAULT_USE
| 3
|
|-
| DEFAULT_USE_GRIP
| 4
|
|-
| DEFAULT_SHOW_INVENTORY
| 5
|
|-
| DEFAULT_PAD
| 6
|
|-
| DEFAULT_PAD_TOUCH
| 7
|
|-
| MOVE_TELEPORT
| 8
|
|-
| MOVE_TURN_LEFT
| 9
|
|-
| MOVE_TURN_RIGHT
| 10
|
|-
| PROP_TOOL_MENU
| 11
|
|-
| PROP_TOOL_USE
| 12
|
|-
| PROP_TOOL_DROP
| 13
|
|-
| PROP_TOOL_PAD
| 14
|
|-
| PROP_TOOL_PAD_TOUCH
| 15
|
|-
| PROP_TOOL_PAD_LEFT
| 16
|
|-
| PROP_TOOL_PAD_RIGHT
| 17
|
|-
| PROP_TOOL_PAD_UP
| 18
|
|-
| PROP_TOOL_PAD_DOWN
| 19
|
|-
|}
 
 
 
=== Motion controller buttons ===
Legacy input mappings used by some functions.
 
{| class="standard-table" style="width: 50%;"
! Name
! Value
! Description
|-
| IN_USE_HAND0
| 24
| When the trigger is pressed. Same for Oculus Touch.
|-
| IN_USE_HAND1
| 25
| When the trigger is pressed. Same for Oculus Touch.
|-
| IN_PAD_LEFT_HAND0
| 26
| When the pad is pressed on the left side.
|-
| IN_PAD_RIGHT_HAND0
| 27
| When the pad is pressed on the right side.
|-
| IN_PAD_UP_HAND0
| 28
| When the pad is pressed on the top.
|-
| IN_PAD_DOWN_HAND0
| 29
| When the pad is pressed on the bottom.
|-
| IN_PAD_LEFT_HAND1
| 30
| When the pad is pressed on the left side.
|-
| IN_PAD_RIGHT_HAND1
| 31
| When the pad is pressed on the right side.
|-
| IN_PAD_UP_HAND1
| 32
| When the pad is pressed on the top.
|-
| IN_PAD_DOWN_HAND1
| 33
| When the pad is pressed on the bottom.
|-
| IN_MENU_HAND0
| 34
| Menu button above the touchpad.
|-
| IN_MENU_HAND1
| 35
| Menu button above the touchpad.
|-
| IN_GRIP_HAND0
| 36
| Pressing the grip. Lightly pushing the grip for Oculus Touch.
|-
| IN_GRIP_HAND1
| 37
| Pressing the grip. Lightly pushing the grip for Oculus Touch.
|-
| IN_GRIPANALOG_HAND0
|
|
|-
| IN_GRIPANALOG_HAND1
|
|
|-
| IN_PAD_HAND0
| 38
| When the pad is pressed anywhere. Heavily pushing the grip for Oculus Touch.
|-
| IN_PAD_HAND1
| 39
| When the pad is pressed anywhere. Heavily pushing the grip for Oculus Touch.
|-
| IN_PAD_TOUCH_HAND0
| 40
| When the pad is touched anywhere. Pushing the thumbstick on Oculus Touch.
|-
| IN_PAD_TOUCH_HAND1
| 41
| When the pad is touched anywhere. Pushing the thumbstick on Oculus Touch.
|-
|
| 42
| Touching the thumbstick on Oculus Touch.
|-
|
| 43
| Touching the thumbstick on Oculus Touch.
|}
 
 
=== ParticleAttachment_t ===
{| class="standard-table" style="width: 50%;"
! Name
! Value
! Description
|-
| PATTACH_INVALID
| -1
|
|-
| PATTACH_ABSORIGIN
| 0
| Spawn on entity origin.
|-
| PATTACH_ABSORIGIN_FOLLOW
| 1
| Follow the entity origin.
|-
| PATTACH_CUSTOMORIGIN
| 2
|
|-
| PATTACH_CUSTOMORIGIN_FOLLOW
| 3
|
|-
| PATTACH_POINT
| 4
| Spawn on entity attachment point.
|-
|-
| PATTACH_POINT_FOLLOW
| PATTACH_POINT_FOLLOW
| 5
| 5
| Follow entity attachment point.
| Follow entity attachment point.
|-
|-
| PATTACH_EYES_FOLLOW
| PATTACH_EYES_FOLLOW
| 6
| 6
|  
|  
|-
|-
| PATTACH_OVERHEAD_FOLLOW
| PATTACH_OVERHEAD_FOLLOW
| 7
| 7
|  
|  
|-
|-
| PATTACH_WORLDORIGIN
| PATTACH_WORLDORIGIN
| 8
| 8
| Spawn on map origin.
| Spawn on map origin.
|-
|-
| PATTACH_ROOTBONE_FOLLOW
| PATTACH_ROOTBONE_FOLLOW
| 9
| 9
|  
|  
|-
|-
| PATTACH_RENDERORIGIN_FOLLOW
| PATTACH_RENDERORIGIN_FOLLOW
| 10
| 10
|  
|  
|-
|-
| PATTACH_MAIN_VIEW
| PATTACH_MAIN_VIEW
| 11
| 11
|  
|  
|-
|-
| PATTACH_WATERWAKE
| PATTACH_WATERWAKE
| 12
| 12
|  
|  
|-
|-
| PATTACH_CENTER_FOLLOW
| PATTACH_CENTER_FOLLOW
| 13
| 13
|
|-
| PATTACH_CUSTOM_GAME_STATE_1
| 14
|  
|  
|-
|-
| MAX_PATTACH_TYPES
| MAX_PATTACH_TYPES
| 14
| 15
|  
|  
|}
|}


[[Category:Destinations]]
[[Category:SteamVR]]
[[Category:SteamVR Home]]
[[Category:Scripting]]
[[Category:Scripting]]

Latest revision as of 07:16, 20 May 2025

This is the VScript API for SteamVR Home.

Accessing the Scripting API from Lua

While Lua is dynamically typed, the Source 2 engine is written primarily in C++, which is statically typed. Thus, you'll need to be conscious of your data types when calling the API. (If you try to pass the wrong type to an API function, you'll get an error message in Vconsole telling you what you passed and what it was expecting.)

Global

Global functions. These can be called without any class.

Math

Function Signature Description
AngleDiff float AngleDiff(float ang1, float ang2) Returns the number of degrees difference between two yaw angles
AxisAngleToQuaternion Quaternion AxisAngleToQuaternion(Vector Vector_1, float float_2) (vector,float) constructs a quaternion representing a rotation by angle around the specified vector axis.
Icon-Bug.pngBug: The Quaternion class is non-functional
CalcClosestPointOnEntityOBB Vector CalcClosestPointOnEntityOBB(handle entity, Vector position) Compute the closest point relative to a vector on the OBB of an entity.
CalcDistanceBetweenEntityOBB float CalcDistanceBetweenEntityOBB(handle entity1, handle entity2) Compute the distance between two entity OBB. A negative return value indicates an input error. A return value of zero indicates that the OBBs are overlapping.
CrossVectors Vector CrossVectors(Vector v1, Vector v2) Calculate the cross product between two vectors (also available as a Vector class method).
CalcDistanceToLineSegment2D float CalcDistanceToLineSegment2D(Vector unknown1, Vector unknown2, Vector unknown3)
Todo: Calculates the distance from a point to a line
ExponentialDecay float ExponentialDecay(float inValue, float startValue, float lambda) Smooth curve decreasing slower as it approaches zero.
LerpVectors Vector LerpVectors(Vector v1, Vector v2, float t) Linear interpolation of vector values over [0,1].
RandomFloat float RandomFloat(float min, float max) Get a random float within a range.
RandomInt int RandomInt(int min, int max) Get a random int within a range.
RotateOrientation QAngle RotateOrientation(QAngle angle1, QAngle angle2) Rotate a QAngle by another QAngle.
RotatePosition Vector RotatePosition(Vector rotationOrigin, QAngle rotationAngle, Vector vectorToRotate) Rotate a Vector around a point.
RotateQuaternionByAxisAngle Quaternion RotateQuaternionByAxisAngle(Quaternion Quaternion_1, Vector Vector_2, float float_3) Rotates a quaternion by the specified angle around the specified vector axis.
Icon-Bug.pngBug: The Quaternion class is non-functional
RotationDelta QAngle RotationDelta(Qangle angle1, Qangle angle2,) Find the delta between two QAngles.
RotationDeltaAsAngularVelocity Vector RotationDeltaAsAngularVelocity(Qangle angle1, Qangle angle2,) converts delta QAngle to an angular velocity Vector.
SplineQuaternions Quaternion SplineQuaternions(Quaternion q0, Quaternion q1, float 't') Very basic interpolation of quaternions q0 to q1 over time 't' on [0,1].
Icon-Bug.pngBug: The Quaternion class is non-functional
SplineVectors Vector SplineVectors(Vector v0, Vector v1, float t) Very basic interpolation of vectors v0 to v1 over time t on [0,1].
VectorToAngles QAngle VectorToAngles(Vector input) Get Qangles (with no roll) for a Vector.

utilsinit.lua

Functions automatically included from the utilsinit.lua core library.

Function Signature Description
abs float abs(float val) Absolute value.
Clamp float Clamp(float val, float min, float max) Clamp the value between the min and max.
Deg2Rad float Deg2Rad(float deg) Convert degrees to radians.
Rad2Deg float Rad2Deg(float rad) Convert radians to degrees.
Lerp float Lerp(float t, float a, float b) Linear interpolation of float values over [0,1].
max float max(float x, float x) Returns the largest value of the inputs.
min float min(float x, float x) Returns the smallest value of the inputs.
Merge table Merge(table t1, table t2) Merges two tables into a third, overwriting any matching keys.
RemapVal float RemapVal(float input, float a, float b, float c, float d) Remap a value in the range [a,b] to [c,d].
RemapValClamped float RemapValClamped(float input, float a, float b, float c, float d) Remap a value in the range [a,b] to [c,d], clamping the output to the range.
VectorDistanceSq float VectorDistanceSq(Vector v1, Vector v2) Distance between two vectors squared (faster than calculating the plain distance).
VectorDistance float VectorDistance(Vector v1, Vector v2) Distance between two vectors.
VectorLerp Vector VectorLerp(float t, Vector v1, Vector v2) Linear interpolation of vector values over [0,1]. The native function LerpVectors performs the same task.
VectorIsZero bool VectorIsZero(Vector vec) Check if the vector is a zero vector.


Printing & Drawing

Function Signature Description
AppendToLogFile void AppendToLogFile(string string_1, string string_2) Appends a string to a log file on the server
DebugDrawBox void DebugDrawBox(Vector origin, Vector min, Vector max, int r, int g, int b, int a, float duration) Draw a debug overlay box
DebugDrawBoxDirection void DebugDrawBoxDirection(Vector Vector_1, Vector Vector_2, Vector Vector_3, Vector Vector_4, Vector Vector_5, float float_6, float float_7) Draw a debug forward box (cent, min, max, forward, vRgb, a, duration)
DebugDrawCircle void DebugDrawCircle(Vector Vector_1, Vector Vector_2, float float_3, float float_4, bool bool_5, float float_6) Draw a debug circle (center, vRgb, a, rad, ztest, duration)
DebugDrawClear void DebugDrawClear() Try to clear all the debug overlay info
DebugDrawLine void DebugDrawLine(Vector Vector_1, Vector Vector_2, int int_3, int int_4, int int_5, bool bool_6, float float_7) Draw a debug overlay line (origin, target, r, g, b, ztest, duration)
DebugDrawLine_vCol void DebugDrawLine_vCol(Vector Vector_1, Vector Vector_2, Vector Vector_3, bool bool_4, float float_5) Draw a debug line using color vec (start, end, vRgb, a, ztest, duration)
DebugDrawScreenTextLine void DebugDrawScreenTextLine(float float_1, float float_2, int int_3, string string_4, int int_5, int int_6, int int_7, int int_8, float float_9) Draw text with a line offset (x, y, lineOffset, text, r, g, b, a, duration)
DebugDrawSphere void DebugDrawSphere(Vector Vector_1, Vector Vector_2, float float_3, float float_4, bool bool_5, float float_6) Draw a debug sphere (center, vRgb, a, rad, ztest, duration)
DebugDrawText void DebugDrawText(Vector Vector_1, string string_2, bool bool_3, float float_4) Draw text in 3d (origin, text, bViewCheck, duration)
DebugScreenTextPretty void DebugScreenTextPretty(float float_1, float float_2, int int_3, string string_4, int int_5, int int_6, int int_7, int int_8, float float_9, string string_10, int int_11, bool bool_12) Draw pretty debug text (x, y, lineOffset, text, r, g, b, a, duration, font, size, bBold)
Msg void Msg(string message) Print a message to the console.
PrintLinkedConsoleMessage void PrintLinkedConsoleMessage(string string_1, string string_2) Print a console message with a linked console command
Say void Say(handle entity, string message, bool teamOnly) Have Entity say string, and teamOnly or not
ShowMessage void ShowMessage(string string_1) Print a hud message on all clients
UTIL_MessageText void UTIL_MessageText(int playerId, string message, int r, int g, int b, int a) Displays a message for a specific player
UTIL_MessageText_WithContext void UTIL_MessageText_WithContext(int playerId, string message, int r, int g, int b, int a, table context) Sends a message to a specific player in the message box with a context table
UTIL_MessageTextAll void UTIL_MessageTextAll(string message, int r, int g, int b, int a) Sends a message to everyone in the message box
UTIL_MessageTextAll_WithContext void UTIL_MessageTextAll_WithContext(string message, int r, int g, int b, int a, table context) Sends a message to everyone in the message box with a context table
UTIL_ResetMessageText void UTIL_ResetMessageText(int playerId) Resets the message text for the player
UTIL_ResetMessageTextAll void UTIL_ResetMessageTextAll() Resets the message text for all players
Warning void Warning(string string_1) Print a warning


Entity Manipulation

Function Signature Description
CancelEntityIOEvents void CancelEntityIOEvents(ehandle ehandle_1) Create all I/O events for a particular entity
ConnectOutputs void ConnectOutputs(table scope) Connects all output script functions of the passed entity script scope to the entity outputs.
Todo:  Document function name format: "^On.*Output$"
CreateDamageInfo DamageInfo CreateDamageInfo (handle, hInflictor, handlehAttacker,Vector force, Vector hitPos, float flDamage, int damageTypes) Allocate a DamageInfo object, used as an argument to CBaseEntity::TakeDamage(). Call DestroyDamageInfo( hInfo ) to free the object.
CreateEffect bool CreateEffect(handle handle_1) Pass table - Inputs: entity, effect
CreateSceneEntity handle CreateSceneEntity(string sceneName) Create a scene entity to play the specified scene.
CreateTrigger handle CreateTrigger(Vector Vector_1, Vector Vector_2, Vector Vector_3) CreateTrigger( vecMin, vecMax ) : Creates and returns an AABB trigger
CreateTriggerRadiusApproximate handle CreateTriggerRadiusApproximate(Vector Vector_1, float float_2) CreateTriggerRadiusApproximate( vecOrigin, flRadius ) : Creates and returns an AABB trigger thats bigger than the radius provided
DestroyDamageInfo void DestroyDamageInfo(damageinfo) Free a damageinfo object that was created with CreateDamageInfo().
DoEntFire void DoEntFire(string target, string action, string value, float delay, handle activator, handle caller) Internal native function for EntFire().
DoEntFireByInstanceHandle void DoEntFireByInstanceHandle(handle target, string action, string value, float delay, handle activator, handle caller) Internal native function for EntFireByHandle().
EntFire void EntFire(table scope, string target, string action, string value = "", float delay = 0.0, handle activator = scope.thisEntity) Generate an entity I/O event on all entities matching the specified target name. The script scope of the calling entity should be passed to the first parameter.
EntFireByHandle void EntFireByHandle(handle self, handle target, string action, string value = "", float delay = 0.0, handle activator = self) Generate an entity I/O event on the specified entity. The calling entity should be passed to the first parameter.
EntIndexToHScript handle EntIndexToHScript(int int_1) Turn an entity index integer to an HScript representing that entity's script instance.
FireEntityIOInputNameOnly void FireEntityIOInputNameOnly(ehandle ehandle_1, string string_2) Fire Entity's Action Input w/no data
FireEntityIOInputString void FireEntityIOInputString(ehandle ehandle_1, string string_2, string string_3) Fire Entity's Action Input with passed String - you own the memory
FireEntityIOInputVec void FireEntityIOInputVec(ehandle ehandle_1, string string_2, Vector Vector_3) Fire Entity's Action Input with passed Vector ( hEntity, szActionName, vector )
GetHandHoldingEntity CPropVRHand GetHandHoldingEntity(handle entity) Returns the hand holding the entity, or nil if its not currently held.
GetMaxOutputDelay float GetMaxOutputDelay(ehandle ehandle_1, string string_2) Get the longest delay for all events attached to an output
GetPhysAngularVelocity Vector GetPhysAngularVelocity(CBaseEntity entity) Get Angular Velocity for VPHYS or normal object. Returns a vector of the axis of rotation, multiplied by the degrees of rotation per second.
GetPhysVelocity Vector GetPhysVelocity(CBaseEntity entity) Get Velocity for VPHYS or normal object.
GetPlayerFromUserID CBasePlayer GetPlayerFromUserID(int userID) Given a user ID, return the script handle for the entity, or nil.
IsValidEntity bool IsValidEntity(handle handle_1) Checks to see if the given hScript is a valid entity
PlayerInstanceFromIndex handle PlayerInstanceFromIndex(int int_1) Get a script instance of a player by index.
PrecacheEntityFromTable void PrecacheEntityFromTable(string string_1, handle handle_2, handle handle_3) Precache an entity from KeyValues in table
PrecacheEntityListFromTable void PrecacheEntityListFromTable(handle handle_1, handle handle_2) Precache a list of entity KeyValues table's
PrecacheModel void PrecacheModel(string modelName, handle context) Manually precache a single model.
PrecacheModelFolder void PrecacheModelFolder(string folderName, handle context) Recursively precache models within a folder.
PrecacheParticle void PrecacheParticle(string particleName, handle context) Manually precache a single particle.
PrecacheParticleFolder void PrecacheParticleFolder( string folderName, handle context) Recursively precache particles within a folder
PrecacheResource void PrecacheResource(string resourceType, string resourcePath, handle context) model_folder|sound|soundfile|particle|particle_folder"
PrecacheSoundFile void PrecacheSoundFile(string soundFileName, handle context) Manually precache a single sound file
SetPhysAngularVelocity void SetPhysAngularVelocity(CBaseEntity entity, Vector angVel) Set Angular Velocity for VPHYS or normal object, from a vector of the axis of rotation, multiplied by the degrees of rotation per second.
SetRenderingEnabled void SetRenderingEnabled(ehandle entityEhandle, bool enabled) Set rendering on/off for an EHANDLE.
SpawnEntityFromTableSynchronous handle SpawnEntityFromTableSynchronous(string string_1, handle handle_2) Synchronously spawns a single entity from a table
SpawnEntityGroupFromTable bool SpawnEntityGroupFromTable(handle groupSpawnTables, bool bAsync, handle hCallback) Hierarchically spawn an entity group from a set of spawn tables.
SpawnEntityListFromTableAsynchronous int SpawnEntityListFromTableAsynchronous(handle handle_1, handle handle_2) Asynchronously spawn an entity group from a list of spawn table's. A callback will be triggered when the spawning is complete
SpawnEntityListFromTableSynchronous handle SpawnEntityListFromTableSynchronous(handle handle_1) Synchronously spawn an entity group from a list of spawn table's.
StopEffect void StopEffect(handle handle_1, string string_2) (hEntity, szEffectName)
UTIL_Remove void UTIL_Remove(handle handle_1) Removes the specified entity
UTIL_RemoveImmediate void UTIL_RemoveImmediate(handle handle_1) Do Not use this function. Use UTIL_Remove() instead. This will crash your game.


Tracing

Function Signature Description
TraceCollideable bool TraceCollideable(table parameters) Does a raytrace against a single entity. Input and output parameters are stored in the specified table.
TraceHull bool TraceHull(table parameters) Traces a axis aligned bounding box along a line. Input and output parameters are stored in the specified table.
TraceInteractibles bool TraceInteractibles(table parameters)
Todo: Pass table - Inputs: startpos, endpos, mask, ignore -- outputs: pos, fraction, hit, enthit, startsolid
TraceLine bool TraceLine(table parameters) Does a raytrace along a line. Input and output parameters are stored in the specified table.


Sound

Function Signature Description
EmitGlobalSound void EmitGlobalSound(string soundName) Play named sound for all players.
EmitSoundOn void EmitSoundOn(string string_1, handle handle_2) Play named sound on Entity
EmitSoundOnClient void EmitSoundOnClient(string string_1, handle handle_2) Play named sound only on the client for the passed in player
SetOpvarFloatAll void SetOpvarFloatAll(string string_1, string string_2, string string_3, float float_4) Sets an opvar value for all players
SetOpvarFloatPlayer void SetOpvarFloatPlayer(string string_1, string string_2, string string_3, float float_4, handle handle_5) Sets an opvar value for a single player ( szStackName, szOperatorName, szOpvarName, flOpvarValue, hEnt )
StartSoundEvent void StartSoundEvent(string string_1, handle handle_2) Start a sound event
StartSoundEventFromPosition void StartSoundEventFromPosition(string string_1, Vector Vector_2) Start a sound event from position
StartSoundEventFromPositionReliable void StartSoundEventFromPositionReliable(string string_1, Vector Vector_2) Start a sound event from position with reliable delivery
StartSoundEventFromPositionUnreliable void StartSoundEventFromPositionUnreliable(string string_1, Vector Vector_2) Start a sound event from position with optional delivery
StartSoundEventReliable void StartSoundEventReliable(string string_1, handle handle_2) Start a sound event with reliable delivery
StartSoundEventUnreliable void StartSoundEventUnreliable(string string_1, handle handle_2) Start a sound event with optional delivery
StopGlobalSound void StopGlobalSound(string soundName) Stop named sound for all players.
StopSoundEvent void StopSoundEvent(string string_1, handle handle_2) Stops a sound event
StopSoundOn void StopSoundOn(string soundName, handle playingEntity) Stop named sound on Entity


Miscellaneous

Function Signature Description
cvar_getf float cvar_getf(string string_1) Gets the value of the given cvar, as a float.
cvar_setf bool cvar_setf(string string_1, float float_2) Sets the value of the given cvar, as a float.
DebugBreak void DebugBreak() Breaks in the debugger
DoIncludeScript bool DoIncludeScript(string scriptFileName, handle scope) Internal native function for IncludeScript().
DoScriptAssert void DoScriptAssert(bool assertion, string message) Internal native function for ScriptAssert().
DoUniqueString string DoUniqueString(string root) Internal native function for UniqueString().
FileToString string FileToString(string a) Reads a string from a file to send to script
FireGameEvent void FireGameEvent(string eventName, handle parameterTable) Fire a pre-defined event, which can be found either in custom_events.txt or in dota's resource/*.res
FireGameEventLocal void FireGameEventLocal(string string_1, handle handle_2) Fire a game event without broadcasting to the client.
FrameTime float FrameTime() Get the time spent on the server in the last frame
GetFrameCount int GetFrameCount() Returns the engines current frame count
GetListenServerHost handle GetListenServerHost() Get the local player on a listen server.
GetMapName string GetMapName() Get the name of the map.
GetPerInputTutorialActions table GetPerInputTutorialActions(string unknown)
IncludeScript bool IncludeScript(string scriptFileName, handle scope = nil) Execute a script file. Included in the current scope by default.
InitLogFile void InitLogFile(string string_1, string string_2) If the given file doesn't exist, creates it with the given contents; does nothing if it exists
IsClient bool IsClient() Returns true if this is lua running from the client.dll.
IsDedicatedServer bool IsDedicatedServer() Returns true if this server is a dedicated server.
IsMarkedForDeletion bool IsMarkedForDeletion(handle handle_1) Returns true if the entity is valid and marked for deletion.
IsServer bool IsServer() Returns true if this is lua running from the server.dll.
IsInToolsMode bool IsInToolsMode() Returns true if this is lua running from the dota2 workshop tools.
IsInVRMode bool IsInVRMode() Checks if the game is running in VR mode.
ListenToGameEvent int ListenToGameEvent(string EventName, handle functionNameToCall, handle context) Register as a listener for a game event from script.
LoadKeyValues table LoadKeyValues(string string_1) Creates a table from the specified keyvalues text file
LoadKeyValuesFromString table LoadKeyValuesFromString(string string_1) Creates a table from the specified keyvalues string
LocalTime table LocalTime() Returns the local system time as a table with the format {Hours = int; Minutes = int; Seconds = int}
MakeStringToken int MakeStringToken(string string_1)
RegisterSpawnGroupFilterProxy void RegisterSpawnGroupFilterProxy(string string_1) Create a C proxy for a script-based spawn group filter
ReloadMOTD void ReloadMOTD() Reloads the MotD file
RemoveSpawnGroupFilterProxy void RemoveSpawnGroupFilterProxy(string string_1) Remove the C proxy for a script-based spawn group filter
rr_AddDecisionRule bool rr_AddDecisionRule(handle handle_1) Add a rule to the decision database.
rr_CommitAIResponse bool rr_CommitAIResponse(handle handle_1, handle handle_2) Commit the result of QueryBestResponse back to the given entity to play. Call with params (entity, airesponse)
rr_GetResponseTargets handle rr_GetResponseTargets() Retrieve a table of all available expresser targets, in the form { name : handle, name: handle }.
rr_QueryBestResponse bool rr_QueryBestResponse(handle handle_1, handle handle_2, handle handle_3) Params: ( hEnt, hQuery, hResult ) // Static : tests 'query' against entity's response system and returns the best response found (or nil if none found).
ScreenShake void ScreenShake(Vector Vector_1, float float_2, float float_3, float float_4, float float_5, int int_6, bool bool_7) Start a screenshake with the following parameters. vecCenter, flAmplitude, flFrequency, flDuration, flRadius, eCommand( SHAKE_START = 0, SHAKE_STOP = 1 ), bAirShake
ScriptAssert void ScriptAssert(bool assertion, string message = "") Asserts the passed in value. Prints out a message and brings up the assert dialog.
SendToConsole void SendToConsole(string string_1) Send a string to the console as a client command
SendToServerConsole void SendToServerConsole(string string_1) Send a string to the console as a server command
SetInSteamVRTutorialMode void SetInSteamVRTutorialMode(bool inTutorialMode)
SetNearZ void SetNearZ(handle player, float distance) Sets near z value for the given player.
SetQuestName void SetQuestName(string string_1) Set the current quest name.
SetQuestPhase void SetQuestPhase(int int_1) Set the current quest phase.
StopListeningToAllGameEvents void StopListeningToAllGameEvents(handle handle_1) Stop listening to all game events within a specific context.
StopListeningToGameEvent bool StopListeningToGameEvent(int int_1) Stop listening to a particular game event.
StringToFile bool StringToFile(string a, string b) * Directory traversal doesn't seem to work. The characters '.', '/' and '\\' are ignored.
Time float Time() Get the current server time
UniqueString string UniqueString(string root = "") Generate a string guaranteed to be unique across the life of the script VM, with an optional root string. Useful for adding data to table's when not sure what keys are already in use in that table.
UnloadSpawnGroup void UnloadSpawnGroup(string string_1) Unload a spawn group by name
UnloadSpawnGroupByHandle void UnloadSpawnGroupByHandle(int int_1) Unload a spawn group by handle
UpdateEventPoints void UpdateEventPoints(handle handle_1) No Description Set


VLua

Functions automatically included from the library.lua core library. Located in the vlua table rather than directly in the global scope.

Library functions to support Lua code generated by Sq2Lua.exe

Function Signature Description
vlua.clear table vlua.clear(table t) Implements Squirrel clear table method.
vlua.compare int vlua.compare(float a, float b) Implements Squirrel three way compare operator ( <=> ).
vlua.contains bool vlua.contains(table t, variable key) Implements Squirrel in operator.
vlua.delete int vlua.delete(table t, variable key) Implements Squirrel slot delete operator.
vlua.clone int vlua.clone(table t) Implements Squirrel clone operator.
vlua.rawdelete int vlua.rawdelete(table t, variable key) Implements Squirrel rawdelete library function.
vlua.rawin int vlua.rawin(table t, variable key) Implements Squirrel rawin library function.
vlua.find variable vlua.find([table/string] o, variable value, [int startIndex]) Implements Squirrel find method for tables and strings. (o, substr, [startidx]) for strings, (o, value) for tables
vlua.slice variable vlua.slice([table/string] o, int startIndex, [int endIndex]) Implements Squirrel slice method for tables and strings.
vlua.reverse table vlua.reverse(table o) Implements Squirrel reverse method for tables.
vlua.resize table vlua.resize(string o, int size, [variable fill]) Implements Squirrel resize method for tables.
vlua.extend table vlua.extend(table o, array array) Implements Squirrel extend method for tables.
vlua.map table vlua.map(table o, function mapFunc) Implements Squirrel map method for tables.
vlua.reduce table vlua.reduce(table o, function reduceFunc) Implements Squirrel reduce method for tables.
vlua.tableadd table vlua.tableadd (table t1, table t2) Implements tableadd function to support += paradigm used in Squirrel.
vlua.split table vlua.split(string input, string separator) Implements Squirrel split function for strings.
vlua.select variable vlua.select(bool conditional, variable valueIfTrue, variable valueIfFalse) Safe Ternary operator. The Lua version will return the wrong value if the value if true is nil.

Classes

CBaseEntity

The base class for entities.

Methods

Function Signature Description
AddEffects void AddEffects(int nFlags) AddEffects( int ): Adds the render effect flag.
ApplyAbsVelocityImpulse void ApplyAbsVelocityImpulse(Vector vecImpulse) Apply a Velocity Impulse.
ApplyLocalAngularVelocityImpulse void ApplyLocalAngularVelocityImpulse(Vector angImpulse) Apply an Angular Velocity Impulse.
Attribute_GetFloatValue float Attribute_GetFloatValue(string pName, float flDefault) Get float value for an entity attribute.
Attribute_GetIntValue float Attribute_GetIntValue(string pName, int nDefault) Get int value for an entity attribute.
Attribute_SetFloatValue void Attribute_SetFloatValue(string pName, float flValue) Set float value for an entity attribute.
Attribute_SetIntValue void Attribute_SetIntValue(string pName, int nValue) Set int value for an entity attribute.
DeleteAttribute void DeleteAttribute(string pName) Delete an entity attribute.
EmitSound void EmitSound(string soundName)
EmitSoundParams void EmitSoundParams(string soundName, int pitch, float volume, float soundTime) Plays/modifies a sound from this entity. changes sound if Pitch and/or Volume or SoundTime is > 0.
EyeAngles QAngle EyeAngles() Get the QAngles that this entity is looking at.
EyePosition Vector EyePosition() Get vector to eye position - absolute coords
FirstMoveChild handle FirstMoveChild() No Description Set
FollowEntity void FollowEntity(handle hEntity, bool bBoneMerge) hEntity to follow, bool bBoneMerge
GatherCriteria void GatherCriteria(handle hResult) Returns a table containing the criteria that would be used for response queries on this entity. This is the same as the table that is passed to response rule script function callbacks.
GetAbsOrigin Vector GetAbsOrigin() Returns the world space origin of the entity.
GetAbsScale float GetAbsScale() Get the absolute entity scale.
GetAngles QAngle GetAngles() No Description Set
GetAnglesAsVector Vector GetAnglesAsVector() Get entity pitch, yaw, roll as a vector
GetAngularVelocity Vector GetAngularVelocity() Get the local angular velocity - returns a vector of pitch,yaw,roll
GetBaseVelocity Vector GetBaseVelocity() Get Base velocity. Only functional on prop_dynamic entities with the Scripted Movement property set.
GetBoundingMaxs Vector GetBoundingMaxs() Get a vector containing max bounds, centered on object
GetBoundingMins Vector GetBoundingMins() Get a vector containing min bounds, centered on object
GetBounds table GetBounds() Get a table containing the 'Mins' & 'Maxs' vector bounds, centered on object
GetCenter Vector GetCenter() Get vector to center of object - absolute coords
GetChildren handle GetChildren() Get the entities parented to this entity.
GetContext table GetContext(string name) GetContext( name ): looks up a context and returns it if available. May return string, float, or nil (if the context isn't found)
GetForwardVector Vector GetForwardVector() Get the forward Vector of the entity
GetHealth int GetHealth() No Description Set
GetLocalAngularVelocity QAngle GetLocalAngularVelocity() Get entity relative angular velocity. Only functional on prop_dynamic entities with the Scripted Movement property set.
GetLocalAngles QAngle GetLocalAngles() Get entity pitch, yaw, roll as a QAngle, in the space of the entity's parent or attachment point
GetLocalOrigin Vector GetLocalOrigin() Get entity origin as a Vector, in the space of the entity's parent or attachment point.
GetLocalScale float GetLocalScale() Get the entity scale relative to that of its parent.
GetLocalVelocity Vector GetLocalVelocity() Get Entity relative velocity. Only functional on prop_dynamic entities with the Scripted Movement property set.
GetMass float GetMass() Get the mass of an entity. (returns 0 if it doesn't have a physics object)
GetMaxHealth int GetMaxHealth() No Description Set
GetModelName string GetModelName() Returns the name of the model.
GetMoveParent handle GetMoveParent() If in hierarchy, retrieves the entity's parent
GetOrigin Vector GetOrigin() Returns the origin of the entity, either in world space ot in its parents space if parented.
GetOwner handle GetOwner() Gets this entity's owner
GetOwnerEntity handle GetOwnerEntity() Get the owner entity, if there is one
GetRightVector Vector GetRightVector() Get the right vector of the entity
GetRootMoveParent handle GetRootMoveParent() If in hierarchy, walks up the hierarchy to find the root parent
GetSoundDuration float GetSoundDuration(string soundName, string actormodelname) Returns float duration of the sound. Takes soundname and optional actormodelname.
GetTeam int GetTeam() No Description Set
GetTeamNumber int GetTeamNumber() Get the team number of this entity.
GetUpVector Vector GetUpVector() Get the up vector of the entity
GetVelocity Vector GetVelocity() World space velocity of the entity. Only functional on prop_dynamic entities with the Scripted Movement property set.
HasAttribute bool HasAttribute(string pName) See if an entity has a particular attribute.
IsAlive bool IsAlive() No Description Set.
IsNPC bool IsNPC() Is this entity an CAI_BaseNPC?
IsNull bool IsNull() Detect entity has been deleted from C++
IsPlayer bool IsPlayer() Is this a player entity?
Kill void Kill() No Description Set
NextMovePeer handle NextMovePeer() No Description Set
OverrideFriction void OverrideFriction(float duration, float friction) Takes duration, value for a temporary override
PrecacheScriptSound void PrecacheScriptSound(string soundname) Precache a sound for later playing.
RemoveEffects void RemoveEffects(int nFlags) RemoveEffects( int ): Removes the render effect flag.
SetAbsAngles void SetAbsAngles(float fPitch, float fYaw, float fRoll) Set entity world space pitch, yaw, roll by component.
SetAbsOrigin void SetAbsOrigin(Vector origin) Sets the world space entity origin.
SetAbsScale void SetAbsScale(float scale) Set the absolute scale of the entity.
SetAngles void SetAngles(float pitch, float yaw, float roll) Set entity pitch, yaw, roll by component. If parented, this is set relative to the parents local space.
SetAngularVelocity void SetAngularVelocity(float pitch, float yaw, float roll) Set the local angular velocity - takes float pitch, yaw, roll velocities. Only functional on prop_dynamic entities with the Scripted Movement property set.
SetConstraint void SetConstraint(Vector vPos) Set the position of the constraint.
SetContext void SetContext(string pName, string pValue, float duration) SetContext( name , value, duration ): store any key/value pair in this entity's dialog contexts. Value must be a string. Will last for duration (set 0 to mean 'forever').
SetContextNum void SetContextNum(string pName, float fValue, float duration) SetContext( name , value, duration ): store any key/value pair in this entity's dialog contexts. Value must be a number (int or float). Will last for duration (set 0 to mean 'forever').
SetContextThink void SetContextThink(string pszContextName, handle hThinkFunc, float flInterval) Set a think function on this entity.
SetEntityName void SetEntityName(string pName) Set the name (targetname) of an entity.
SetForwardVector void SetForwardVector(Vector forwardVec) Set the orientation of the entity to have this forward forwardVec
SetFriction void SetFriction(float flFriction) Set PLAYER friction, ignored for objects
SetGravity void SetGravity(float flGravity) Set PLAYER gravity, ignored for objects
SetHealth void SetHealth(int hp) No Description Set
SetLocalAngles void SetLocalAngles(float pitch, float yaw, float roll) Set the entity pitch, yaw, roll by component, relative to the local space of the entity's parent or attachment point.
SetLocalOrigin void SetLocalOrigin(Vector origin) Set the entity origin from a Vector, relative to the local space of the entity's parent or attachment point.
SetLocalScale void SetLocalScale(float scale) Set the entity scale relative to the entity's parent.
SetMass void SetMass(float flMass) Set the mass of an entity. (does nothing if it doesn't have a physics object)
SetMaxHealth void SetMaxHealth(int maxHP) No Description Set
SetOrigin void SetOrigin(Vector origin) No Description Set
SetOwner void SetOwner(handle owningEntity) Sets this entity's owner.
SetParent void SetParent(handle hParent, string pAttachmentname) Set the parent for this entity. The attachment is optional, pass an empty string to not use it.
SetTeam void SetTeam(int team) No Description Set
SetThink void SetThink(function thinkFunction, string thinkName, float initialDelay) Sets a thinker function to be called periodically.
SetVelocity void SetVelocity(Vector vecVelocity) Sets the world space velocity of the entity. Only functional on prop_dynamic entities with the Scripted Movement property set.
StopSound void StopSound(string soundName) Stops the named sound playing from this entity.
StopThink void StopThink (string thinkName) Stops the named thinker function.
TakeDamage int TakeDamage(damageinfo hInfo) Apply damage to this entity. Use CreateDamageInfo() to create a damageinfo object.
TransformPointEntityToWorld Vector TransformPointEntityToWorld(Vector vPoint) Returns the input Vector transformed from entity to world space.
TransformPointWorldToEntity Vector TransformPointWorldToEntity(Vector vPoint) Returns the input Vector transformed from world to entity space.
Trigger void Trigger() Fires off this entity's OnTrigger responses.
ValidatePrivateScriptScope void ValidatePrivateScriptScope() Validates the private script scope and creates it if one doesn't exist.

Hooks

Adding a function with this signature to the entity script causes it to be called from code at the appropriate moment.

Function Signature Description
Activate void Activate(int activateType) Called on Activate(), after the entity has spawned. If the entity is spawned on map load, Activate() is called after all entities have spawned. The activateType parameter contains an enumeration as documented here.
OnBreak void OnBreak() Called when a breakable entity is broken.
Todo: Find out what entity classes this works for?
OnEntText string OnEntText() Called every frame when ent text is enabled on the entity. Return a string to be added to the ent_text printout.
OnTakeDamage unknown OnTakeDamage(table damageTable) Called when the entity takes damage. Table format: {inflictor = handle, damage_direction = Vector, damage_position = Vector, damage_force = Vector, damage = int, attacker = handle}
Todo: Check if all entity calsses can take damage
Precache void Precache(CScriptPrecacheContext context) Called when the entity is precached. Used to precache any additional resources needed by the script using the global Precache family of script functions.
Spawn void Spawn(CScriptKeyValues spawnkeys) Called on Spawn(), just after the entity has been created, but before it has been initialized. Passes a CScriptKeyValues handle that can be used to query the entity spawn keyvalues.
UpdateOnRemove void UpdateOnRemove() Called before the entity is killed.

CEntityInstance

extends CBaseEntity

All entities inherit from this.

Methods

Function Signature Description
ConnectOutput void ConnectOutput(string string_1, string string_2) Adds an I/O connection that will call the named function on this entity when the specified output fires.
Destroy void Destroy() No Description Set
DisconnectOutput void DisconnectOutput(string string_1, string string_2) Removes a connected script function from an I/O event on this entity.
DisconnectRedirectedOutput void DisconnectRedirectedOutput(string string_1, string string_2, handle handle_3) Removes a connected script function from an I/O event on the passed entity.
entindex int entindex() No Description Set
FireOutput void FireOutput(string outputName, handle activator, handle caller, table args, float delay) Fire an entity output
GetClassname string GetClassname() No Description Set
GetDebugName string GetDebugName() Get the entity name w/help if not defined (i.e. classname/etc)
GetEntityHandle ehandle GetEntityHandle() Get the entity as an EHANDLE
GetEntityIndex int GetEntityIndex() No Description Set
GetIntAttr int GetIntAttr(string string_1) Get Integer Attribute
GetName string GetName() No Description Set
GetOrCreatePrivateScriptScope handle GetOrCreatePrivateScriptScope() Retrieve, creating if necessary, the private per-instance script-side data associated with an entity
GetOrCreatePublicScriptScope handle GetOrCreatePublicScriptScope() Retrieve, creating if necessary, the public script-side data associated with an entity
GetPrivateScriptScope handle GetPrivateScriptScope() Retrieve the private per-instance script-side data associated with an entity
GetPublicScriptScope handle GetPublicScriptScope() Retrieve the public script-side data associated with an entity
RedirectOutput void RedirectOutput(string string_1, string string_2, handle handle_3) Adds an I/O connection that will call the named function on the passed entity when the specified output fires.
RemoveSelf void RemoveSelf() Delete this entity
SetIntAttr void SetIntAttr(string string_1, int int_2) Set Integer Attribute

CBaseModelEntity

extends CBaseEntity

Entities with models inherit from this.

Methods

Function Signature Description
GetMaterialGroupHash unsigned GetMaterialGroupHash() Get the material group hash of this entity.
GetMaterialGroupMask <unknown> GetMaterialGroupMask() Get the mesh group mask of this entity.
GetRenderAlpha int GetRenderAlpha() Get the alpha modulation of this entity.
GetRenderColor Vector GetRenderColor() Get the render color of the entity.
SetBodygroup void SetBodygroup(int iGroup, int iValue) Sets a bodygroup by index.
SetBodygroupByName void SetBodygroupByName(int iGroup, int iValue) Sets a bodygroup by name.
SetLightGroup void SetLightGroup(string pLightGroup) Sets the light group of the entity.
SetMaterialGroup void SetMaterialGroup(string pMaterialGroup) Set the material group of this entity.
SetMaterialGroupHash void SetMaterialGroupHash(uint32 nHash) Set the material group hash of this entity.
SetMaterialGroupMask void SetMaterialGroupMask(uint64 nMeshGroupMask) Set the mesh group mask of this entity.
SetModel void SetModel(string pModelName) Changes the model of the entity. Make sure the new model is precached before using.
SetRenderAlpha void SetRenderAlpha(int nAlpha) Set the alpha modulation of this entity.
SetRenderColor void SetRenderColor(int red, int green, int blue) Sets the render color of the entity.
SetRenderMode void SetRenderMode(int nMode) Sets the render mode of the entity.
SetSingleMeshGroup void SetSingleMeshGroup(string pMeshGroupName) Set a single mesh group for this entity.
SetSize void SetSize(Vector mins, Vector maxs)


CBasePlayer

Entity class for players.

Methods

Function Signature Description
AreChaperoneBoundsVisible bool AreChaperoneBoundsVisible() Returns whether this player's chaperone bounds are visible.
EquipPropTool void EquipPropTool(CDestinationsPropTool propTool, int handId) Equips the prop tool passed in the hand specified.
GetHMDAnchor handle GetHMDAnchor() Returns the HMD anchor entity for this player if it exists.
GetHMDAvatar CPropHMDAvatar GetHMDAvatar() Returns the HMD Avatar entity for this player if it exists.
GetPlayArea Vector GetPlayArea(int nPoint) Returns the Vector position of the point you ask for. Pass 0-3 to get the four points.
GetUserID int GetUserID() Returns the player's user ID.
GetVRControllerType int GetVRControllerType() Returns the type of controller being used while in VR. See list at the bottom of the page for controller types.
IsActionActiveForHand bool IsActionActiveForHand(int nLiteralHandType, int nDigitalAction) Returns true if the action is active for the given hand.
IsNoclipping bool IsNoclipping() Returns true if the player is in noclip mode.
IsUsePressed bool IsUsePressed() Returns true if the use key is pressed.
IsVRControllerButtonPressed bool IsVRControllerButtonPressed(int nButton) Returns true if the controller button is pressed.
IsVRDashboardShowing bool IsVRDashboardShowing() Returns true if the SteamVR dashboard is showing for this player.
Quit void Quit() Quit the game from script.
RemovePropTool void RemovePropTool(string pModelName, int nHandId) Removes a prop tool from the players hand if it uses the model passed in.


CSteamTours_Player

Todo: Player subclass?

Methods

Function Signature Description
AllowTeleportFromHand void AllowTeleportFromHand(int nHandID, bool bTeleportAllowed) Sets whether the player is allowed to teleport using the specified hand.
AreAnyVRControllersConnected bool AreAnyVRControllersConnected() Checks to see if any VR controllers are present.
IsContentBrowserShowing bool IsContentBrowserShowing() Returns true if the content browser is showing.
IsInventoryEnabledForHand bool IsInventoryEnabledForHand(int nHandID) Checks to see if the player is allowed to use the quick inventory for the specified hand.
IsTeleportAllowedFromHand bool IsTeleportAllowedFromHand(int nHandID) Checks to see if the player is allowed to teleport using the specified hand.
SetContentBrowserAllowed void SetContentBrowserAllowed(bool bAllowed) Sets whether the content browser is allowed to be brought up by the player.
SetInventoryEnabledForHand void SetInventoryEnabledForHand(int nHandID, bool bInventoryAllowed) Sets whether the player is allowed to use the quick inventory for the specified hand.
SetIsInTutorialMode void SetIsInTutorialMode(bool bTutorial) Sets whether the player is in tutorial mode.
SetSteamVRDashBoardEnabled void SetSteamVRDashBoardEnabled(bool bEnabled) Control Availability of Dashboard. Only used by special cases, such as tutorials.


CBaseAnimating

extends CBaseEntity

A class containing methods involved in animations. Most model based entities inherit this.

Methods

Function Signature Description
ActiveSequenceDuration float ActiveSequenceDuration() Returns the duration in seconds of the active sequence.
GetAttachmentAngles Vector GetAttachmentAngles(int iAttachment) Get the attachment id's angles as a p,y,r vector
GetAttachmentForward Vector GetAttachmentForward(int iAttachment) Get the attachment id's forward vector.
GetAttachmentOrigin Vector GetAttachmentOrigin(int iAttachment) Get the attachment id's origin vector
GetCycle float GetCycle() Get the cycle of the animation.
GetGraphParameter table GetGraphParameter(string pszParam) Get the value of the given animGraph parameter.
GetModelScale float GetModelScale() Get scale of entity's model.
GetSequence string GetSequence() Returns the name of the active sequence.
IsSequenceFinished bool IsSequenceFinished() Ask whether the main sequence is done playing
ResetSequence void ResetSequence(string pSequenceName) Sets the active sequence by name, resetting the current cycle
ScriptLookupAttachment int ScriptLookupAttachment(string pAttachmentName) Get the named attachment id
SequenceDuration float SequenceDuration(string pSequenceName) Returns the duration in seconds of the given sequence name.
SetGraphLookTarget void SetGraphLookTarget(Vector vValue) Pass the desired look target in world space to the graph.
SetGraphParameter void SetGraphParameter(string pszParam, table svArg) Set the specific param value, type is inferred from the type in script.
SetGraphParameterBool void SetGraphParameterBool(string szName, bool bValue) Set the specific boolean parameter on or off.
SetGraphParameterEnum void SetGraphParameterEnum(string szName, int nValue) Pass the enum (int) value to the specified param.
SetGraphParameterFloat void SetGraphParameterFloat(string szName, float flValue) Pass the float value to the specified parameter.
SetGraphParameterInt void SetGraphParameterInt(string szName, int nValue) Pass the int value to the specified param.
SetGraphParameterVector void SetGraphParameterVector(string szName, Vector vValue) Pass the vector value to the specified param in the graph.
SetModelScale void SetModelScale(float scale) Sets the model's scale to scale,
so if a unit had its model scale at 1, and you use SetModelScale(10.0), it would set the scale to 10.0.
SetPoseParameter float SetPoseParameter(string szName, float fValue) Set the specified pose parameter to the specified value.
SetProceduralIKTarget bool SetProceduralIKTarget(string pChainName, string pTargetName, Vector vTargetPosition, QAngle qTargetRotation) Sets the named procedural IK target.
SetProceduralIKTargetWeight bool SetProceduralIKTargetWeight(string pChainName, string pTargetName, float flWeight) Sets the named procedural IK targets weight: 0 = full animation, 1 = full IK.
SetSequence void SetSequence(string pSequenceName) Sets the active sequence by name, keeping the current cycle.
SetSkin void SetSkin(int iSkin) Sets the model skin by index.
StopAnimation void StopAnimation() Stop the current animation by setting playback rate to 0.0.


CBaseFlex

extends CBaseAnimating

Animated entities that have vertex flex capability.

Methods

Function Signature Description
GetCurrentScene handle GetCurrentScene() Returns the instance of the oldest active scene entity (if any).
GetSceneByIndex handle GetSceneByIndex(int index) Returns the instance of the scene entity at the specified index.
ScriptPlayScene float ScriptPlayScene(string pszSceneFile, float flDelay) Play the specified .vcd file.

CBaseCombatCharacter

No Description Set

Function Signature Description
GetEquippedWeapons table GetEquippedWeapons() Returns an array of all the equipped weapons
GetFaction int GetFaction() Get the combat character faction.
GetWeaponCount int GetWeaponCount() Gets the number of weapons currently equipped
ShootPosition Vector ShootPosition(int nHand) Returns the shoot position eyes (or hand in VR).


CBodyComponent

No Description Set

Methods

Function Signature Description
AddImpulseAtPosition void AddImpulseAtPosition(Vector Vector_1, Vector Vector_2) Apply an impulse at a worldspace position to the physics
AddVelocity void AddVelocity(Vector Vector_1, Vector Vector_2) Add linear and angular velocity to the physics object
DetachFromParent void DetachFromParent() Detach from its parent
GetSequence <unknown> GetSequence() Returns the active sequence
IsAttachedToParent bool IsAttachedToParent() Is attached to parent
LookupSequence <unknown> LookupSequence(string string_1) Returns a sequence id given a name
SequenceDuration float SequenceDuration(string string_1) Returns the duration in seconds of the specified sequence
SetAngularVelocity void SetAngularVelocity(Vector Vector_1) No Description Set
SetAnimation void SetAnimation(string string_1) Pass string for the animation to play on this model
SetBodyGroup void SetBodyGroup(string string_1) No Description Set
SetMaterialGroup void SetMaterialGroup(utlstringtoken utlstringtoken_1) No Description Set
SetVelocity void SetVelocity(Vector velocity) No Description Set


CEntities

Provides methods to enumerate all server-side entities.

Global accessor variable: Entities

Methods

Function Signature Description
CreateByClassname handle CreateByClassname(string className) Creates an entity by class name.
FindAllByClassname table FindAllByClassname(string string_1) Finds all entities by class name. Returns an array containing all the found entities.
FindAllByClassnameWithin table FindAllByClassnameWithin(string string_1, Vector Vector_2, float float_3) Find entities by class name within a radius.
FindAllByModel table FindAllByModel(string modelName) Find entities by model name.
FindAllByName table FindAllByName(string name) Find all entities by name. Returns an array containing all the found entities in it.
FindAllByNameWithin table FindAllByNameWithin(string name, Vector origin, float maxRadius) Find entities by name within a radius.
FindAllByTarget table FindAllByTarget(string targetName) Find entities by targetname.
FindAllInSphere table FindAllInSphere(Vector origin, float maxRadius) Find entities within a radius.
FindByClassname handle FindByClassname(handle startFrom, string className) Find entities by class name. Pass nil to start an iteration, or reference to a previously found entity to continue a search
FindByClassnameNearest handle FindByClassnameNearest(string className, Vector origin, float maxRadius) Find entities by class name nearest to a point.
FindByClassnameWithin handle FindByClassnameWithin(handle startFrom, string className, Vector origin, float maxRadius) Find entities by class name within a radius. Pass nil to start an iteration, or reference to a previously found entity to continue a search
FindByModel handle FindByModel(handle startFrom, string modelName) Find entities by model name. Pass nil to start an iteration, or reference to a previously found entity to continue a search
FindByModelWithin handle FindByModelWithin(handle startFrom, string modelName, Vector origin, float maxRadius) Find entities by model name within a radius. Pass nil to start an iteration, or reference to a previously found entity to continue a search
FindByName handle FindByName(handle lastEnt, string searchString) Find entities by name. Pass nil to start an iteration, or reference to a previously found entity to continue a search
FindByNameNearest handle FindByNameNearest(string name, Vector origin, float maxRadius) Find entities by name nearest to a point.
FindByNameWithin handle FindByNameWithin(handle startFrom, string name, Vector origin, float maxRadius) Find entities by name within a radius. Pass nil to start an iteration, or reference to a previously found entity to continue a search
FindByTarget handle FindByTarget(handle startFrom, string targetName) Find entities by targetname. Pass nil to start an iteration, or reference to a previously found entity to continue a search
FindInSphere handle FindInSphere(handle startFrom, Vector origin, float maxRadius) Find entities within a radius. Pass nil to start an iteration, or reference to a previously found entity to continue a search
First handle First() Begin an iteration over the list of entities
GetLocalPlayer handle GetLocalPlayer() Get the local player.
Next handle Next(handle startFrom) Continue an iteration over the list of entities, providing reference to a previously found entity


CAI_BaseNPC

No Description Set

Methods

Function Signature Description
GetSquad handle GetSquad() Get the squad to which this NPC belongs.


CBaseTrigger

extends CBaseEntity

Entity class for triggers.

Methods

Function Signature Description
Disable void Disable() Disable the trigger
Enable void Enable() Enable the trigger
IsTouching bool IsTouching(handle hEnt) Checks whether the passed entity is touching the trigger.


CDestinationsGameTrophy

Entity class for game trophies.

Methods

Function Signature Description
GetAccountID unsigned GetAccountID() Get owner's Steam accountid.
GetAchievementLevel unsigned GetAchievementLevel() Get achievement level.
GetAppID unsigned GetAppID() Get appid.
GetBadgeLevel unsigned GetBadgeLevel() Get badge level.


CDestinationsPropDrawing

[Todo]

Methods

Function Signature Description
AddPointGlobal void AddPointGlobal(Vector vPos, float flRadius, Vector vColor)
AddPointLocal void AddPointLocal(Vector vPos, float flRadius, Vector vColor)
BeginStroke void BeginStroke(Vector vOrigin, string pParticleName)
EndStroke void EndStroke()
Finalize void Finalize()
IsFinalized bool IsFinalized()


CDestinationsPropItemPhysics

Entity class for prop destinations physics.

Props spawned through the menu use this class.

Methods

Function Signature Description
EnableUse void EnableUse(bool bAllowUse) Enable (or disable) 'use' aka 'picking up' this entity.
Freeze void Freeze(bool bFreeze) Freeze (or unfreeze) this entity in place, but still allow use/pickup.
GetCreator CSteamTours_Player GetCreator() Returns the (player) creator of this entity.
GetItemDefID string GetItemDefID() Get the Item Definition ID from the ContentDB for this entity.
GetPublishedFileID <unknown> GetPublishedFileID() Get the published file ID for this entity. The id will be 0 it was not published on the Steam workshop.
IsFrozen bool IsFrozen() Returns whether this entity is frozen in place.
IsUseEnabled bool IsUseEnabled() Returns whether 'use' aka 'picking up' is enabled on this entity.
SetCreator void SetCreator(CSteamTours_Player hCreator) Sets the (player) creator of this entity.

Hooks

Adding a function with this signature to the entity script causes it to be called from code at the appropriate moment.

Function Signature Description
OnPickedUp void OnPickedUp(handle self, CPropVRHand hand) Called when a player picks up the prop.
OnDropped void OnDropped(handle self, CPropVRHand hand) Called when a player drops the prop.

CDestinationsPropTool

Entity class for prop destinations tool.

A generic tool prop that can be picked up by the player. The tool functionality is implemented using scripts. When picked up by the player, attaches to the vr_controller_root attachment of the model.

Methods

Function Signature Description
ForceDropTool void ForceDropTool() Drops the tool from the players hand.

Hooks

Adding a function with this signature to the entity script causes it to be called from code at the appropriate moment.

Todo: May have more undocumented hooks
Function Signature Description
SetEquipped bool SetEquipped(handle self, CPropVRHand pHand, int nHandID, handle pHandAttachment, CBasePlayer pPlayer) Called when the player equips the tool.
Todo: Effect of the return value
SetUnequipped bool SetUnequipped() Called when the tool is unequipped.
OnHandleInput table OnHandleInput(table input) Called every frame with the state of the motion controller inputs. Return the input table with bits toggled off in the members to disable the rest of the game from receiving the inputs.


CDestinationsQuestGeocache

No Description Set

Methods

Function Signature Description
DisableCollision void DisableCollision() Disable physics collision for this entity.
EnableCollision void EnableCollision() Enable physics collision for this entity.


CEnvTimeOfDay2

No Description Set

Methods

Function Signature Description
GetFloat float GetFloat(utilstringtoken unknown, float unknown) Lookup dynamic time-of-day float value.
GetVector Vector GetVector(utilstringtoken unknown, Vector unknown) Lookup dynamic time-of-day vector value.

CEnvEntityMaker

extends CBaseEntity

Entity class for env entity maker.

Methods

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


CEntityScriptFramework

Interface to the C++-side of entity framework


Global accessor variable: EntityFramework

Methods

No methods available.

Hooks

Called on the entity framework script.

Function Signature Description
CreateEntity void CreateEntity(string className, handle instance)
DispatchActivate bool DispatchActivate(handle entity)
DispatchInput bool DispatchInput(string inputName, table target,unknown args)
DispatchPrecache void DispatchPrecache(handle entity, CScriptPrecacheContext context)
DispatchSpawn void DispatchSpawn(handle entity, CScriptKeyValuesspawnkeys)
DispatchUpdateOnRemove bool DispatchUpdateOnRemove(handle entity)
GetClassNameOverride string GetClassNameOverride(string className)
GetDesignerNameForScriptClass string GetDesignerNameForScriptClass(string className,handle instance)
GetInputsForScriptClass table GetInputsForScriptClass(string scriptClassName)
GetNativeClassForScriptClass string GetNativeClassForScriptClass(string scriptClassName)
GetNativeOutputsForClass CNativeOutputs GetNativeOutputsForClass(string scriptClassName)
GetScriptClassForDesignerName string GetScriptClassForDesignerName(string designerName)
InstallClasses void InstallClasses()


CInfoWorldLayer

Entity class for info world layer.


Methods

Function Signature Description
HideWorldLayer void HideWorldLayer() Hides this layer.
ShowWorldLayer void ShowWorldLayer() Shows this layer.


CMarkupVolumeTagged

No Description Set

Methods

Function Signature Description
HasTag bool HasTag(string pszTagName) Does this volume have the given tag.


CScriptPrecacheContext

Container to hold context published to precache functions in script

Methods

Function Signature Description
AddResource void AddResource(string string_1) Precaches a specific resource
GetValue variable GetValue(string key) Reads a spawn key.


CScriptKeyValues

Container holding keyvalues published to the Spawn() hook function.

Methods

Function Signature Description
GetValue variable GetValue(string key) Reads a spawn key.


CNativeOutputs

Container for holding outputs published by scripted entity classes to the game code.

Methods

Function Signature Description
constructor void CNativeOutputs() Creates a new CNativeOutputs object.
AddOutput void AddOutput(string outputName, string description) Add an output.
Init void Init(int numOutputs) Initialize with specified number of outputs.


CEnvProjectedTexture

extends CBaseEntity

Entity class for env projected texture.

Methods

Function Signature Description
SetFarRange void SetFarRange(float flRange) Set light maximum range
SetLinearAttenuation void SetLinearAttenuation(float flAtten) Set light linear attenuation value
SetNearRange void SetNearRange(float flRange) Set light minimum range
SetQuadraticAttenuation void SetQuadraticAttenuation(float flAtten) Set light quadratic attenuation value
SetVolumetrics void SetVolumetrics(bool bOn, float flIntensity, float flNoise, int nPlanes, float flPlaneOffset) Turn on/off light volumetrics: bool bOn, float flIntensity, float flNoise, int nPlanes, float flPlaneOffset


CInfoData

No Description Set

Methods

Function Signature Description
QueryColor Vector QueryColor(utlstringtoken tok, Vector vDefault) Query color data for this key
QueryFloat float QueryFloat(utlstringtoken tok, float flDefault) Query float data for this key
QueryInt int QueryInt(utlstringtoken tok, int nDefault) Query int data for this key
QueryNumber float QueryNumber(utlstringtoken tok, float flDefault) Query number data for this key
QueryString string QueryString(utlstringtoken tok, string pDefault) Query string data for this key
QueryVector Vector QueryVector(utlstringtoken tok, Vector vDefault) Query vector data for this key


CPhysicsProp

Entity class for prop physics and related classes.

Methods

Function Signature Description
SetDynamicVsDynamicContinuous void SetDynamicVsDynamicContinuous(bool bIsDynamicVsDynamicContinuousEnabled) Enable/disable dynamic vs dynamic continuous collision traces.
DisableMotion void DisableMotion() Enable motion for the prop.
EnableMotion void EnableMotion() Enable motion for the prop.


CDebugOverlayScriptHelper

No Description Set

Methods

Function Signature Description
Axis void Axis(Vector Vector_1, Quaternion Quaternion_2, float float_3, bool bool_4, float float_5) Draws an axis. Specify origin + orientation in world space.
Box void Box(Vector Vector_1, Vector Vector_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) Draws a world-space axis-aligned box. Specify bounds in world space.
BoxAngles void BoxAngles(Vector Vector_1, Vector Vector_2, Vector Vector_3, Quaternion Quaternion_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) Draws an oriented box at the origin. Specify bounds in local space.
Capsule void Capsule(Vector Vector_1, Quaternion Quaternion_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) Draws a capsule. Specify base in world space.
Circle void Circle(Vector Vector_1, Quaternion Quaternion_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) Draws a circle. Specify center in world space.
CircleScreenOriented void CircleScreenOriented(Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) Draws a circle oriented to the screen. Specify center in world space.
Cone void Cone(Vector Vector_1, Vector Vector_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) Draws a wireframe cone. Specify endpoint and direction in world space.
Cross void Cross(Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) Draws a screen-aligned cross. Specify origin in world space.
Cross3D void Cross3D(Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) Draws a world-aligned cross. Specify origin in world space.
Cross3DOriented void Cross3DOriented(Vector Vector_1, Quaternion Quaternion_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) Draws an oriented cross. Specify origin in world space.
DrawTickMarkedLine void DrawTickMarkedLine(Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) Draws a dashed line. Specify endpoint's in world space.
EntityAttachments void EntityAttachments(ehandle ehandle_1, float float_2, float float_3) Draws the attachments of the entity
EntityAxis void EntityAxis(ehandle ehandle_1, float float_2, bool bool_3, float float_4) Draws the axis of the entity origin
EntityBounds void EntityBounds(ehandle ehandle_1, int int_2, int int_3, int int_4, int int_5, bool bool_6, float float_7) Draws bounds of an entity
EntitySkeleton void EntitySkeleton(ehandle ehandle_1, float float_2) Draws the skeleton of the entity
EntityText void EntityText(ehandle ehandle_1, int int_2, string string_3, int int_4, int int_5, int int_6, int int_7, float float_8) Draws text on an entity
FilledRect2D void FilledRect2D(Vector2D Vector2D_1, Vector2D Vector2D_2, int int_3, int int_4, int int_5, int int_6, float float_7) Draws a screen-space filled 2D rectangle. Coordinates are in pixels.
HorzArrow void HorzArrow(Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) Draws a horizontal arrow. Specify endpoint's in world space.
Line void Line(Vector Vector_1, Vector Vector_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) Draws a line between two point's
Line2D void Line2D(Vector2D Vector2D_1, Vector2D Vector2D_2, int int_3, int int_4, int int_5, int int_6, float float_7) Draws a line between two point's in screenspace
PopDebugOverlayScope void PopDebugOverlayScope() Pops the identifier used to group overlays. Overlays marked with this identifier can be deleted in a big batch.
PushAndClearDebugOverlayScope void PushAndClearDebugOverlayScope(utlstringtoken utlstringtoken_1) Pushes an identifier used to group overlays. Deletes all existing overlays using this overlay id.
PushDebugOverlayScope void PushDebugOverlayScope(utlstringtoken utlstringtoken_1) Pushes an identifier used to group overlays. Overlays marked with this identifier can be deleted in a big batch.
RemoveAllInScope void RemoveAllInScope(utlstringtoken utlstringtoken_1) Removes all overlays marked with a specific identifier, regardless of their lifetime.
SolidCone void SolidCone(Vector Vector_1, Vector Vector_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) Draws a solid cone. Specify endpoint and direction in world space.
Sphere void Sphere(Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8) Draws a wireframe sphere. Specify center in world space.
SweptBox void SweptBox(Vector Vector_1, Vector Vector_2, Vector Vector_3, Vector Vector_4, Quaternion Quaternion_5, int int_6, int int_7, int int_8, int int_9, float float_10) Draws a swept box. Specify endpoint's in world space and the bounds in local space.
Text void Text(Vector Vector_1, int int_2, string string_3, float float_4, int int_5, int int_6, int int_7, int int_8, float float_9) Draws 2D text. Specify origin in world space.
Texture void Texture(string string_1, Vector2D Vector2D_2, Vector2D Vector2D_3, int int_4, int int_5, int int_6, int int_7, Vector2D Vector2D_8, Vector2D Vector2D_9, float float_10) Draws a screen-space texture. Coordinates are in pixels.
Triangle void Triangle(Vector Vector_1, Vector Vector_2, Vector Vector_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) Draws a filled triangle. Specify vertices in world space.
UnitTestCycleOverlayRenderType void UnitTestCycleOverlayRenderType() Toggles the overlay render type, for unit tests
VectorText3D void VectorText3D(Vector Vector_1, Quaternion Quaternion_2, string string_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) Draws 3D text. Specify origin + orientation in world space.
VertArrow void VertArrow(Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9) Draws a vertical arrow. Specify endpoint's in world space.
YawArrow void YawArrow(Vector Vector_1, float float_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10) Draws a arrow associated with a specific yaw. Specify endpoint's in world space.


CSceneEntity

extends CBaseEntity

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

Methods

Function Signature Description
AddBroadcastTeamTarget void AddBroadcastTeamTarget(int int_1) Adds a team (by index) to the broadcast list
Cancel void Cancel() Cancel scene playback
EstimateLength float EstimateLength() Returns length of this scene in seconds.
FindCamera handle FindCamera() Get the camera
FindNamedEntity handle FindNamedEntity(string string_1) given an entity reference, such as !target, get actual entity from scene object
IsPaused bool IsPaused() If this scene is currently paused.
IsPlayingBack bool IsPlayingBack() If this scene is currently playing.
LoadSceneFromString bool LoadSceneFromString(string string_1, string string_2) given a dummy scene name and a vcd string, load the scene
RemoveBroadcastTeamTarget void RemoveBroadcastTeamTarget(int int_1) Removes a team (by index) from the broadcast list
Start void Start(handle handle_1) Start scene playback, takes activatorEntity as param


CCustomGameEventManager

No Description Set

Methods

Global accessor variable: CustomGameEventManager

Function Signature Description
RegisterListener int RegisterListener(string string_1, handle handle_2) ( string EventName, func CallbackFunction ) - Register a callback to be called when a particular custom event arrives. Returns a listener ID that can be used to unregister later.
Send_ServerToAllClients void Send_ServerToAllClients(string string_1, handle handle_2) ( string EventName, table EventData )
Send_ServerToPlayer void Send_ServerToPlayer(handle handle_1, string string_2, handle handle_3) ( Entity Player, string EventName, table EventData )
Send_ServerToTeam void Send_ServerToTeam(int int_1, string string_2, handle handle_3) ( int TeamNumber, string EventName, table EventData )
UnregisterListener void UnregisterListener(int int_1) ( int ListnerID ) - Unregister a specific listener


CCustomNetTableManager

Used to communicate with clientside Javascript used by Panorama. See Linking Lua with Javascript for usage.

Global accessor variable: CustomNetTables

Methods

Function Signature Description
GetTableValue handle GetTableValue(string TableName, string KeyName) ( string TableName, string KeyName )
SetTableValue bool SetTableValue(string TableName, string KeyName, handle Value) ( string TableName, string KeyName, script_table Value )


CParticleSystem

Todo: Entity class for particle systems? No methods available.


CPointClientUIWorldPanel

Entity class for point clientui world panel

A 2D Panorama panel projected at a set position in the world.

Methods

Function Signature Description
AcceptUserInput void AcceptUserInput() Tells the panel to accept user input.
AddCSSClasses void AddCSSClasses(string classes) Adds CSS class(es) to the panel.
IgnoreUserInput void IgnoreUserInput() Tells the panel to ignore user input.
IsGrabbable void IsGrabbable() Returns whether this entity is grabbable.
RemoveCSSClasses void RemoveCSSClasses(string classes) Remove CSS class(es) from the panel.


CPointTemplate

Entity class for point template

Methods

Function Signature Description
DeleteCreatedSpawnGroups void DeleteCreatedSpawnGroups() DeleteCreatedSpawnGroups() : Deletes any spawn groups that this point_template has spawned. Note: The point_template will not be deleted by this.
ForceSpawn void ForceSpawn() ForceSpawn() : Spawns all of the entities the point_template is pointing at.
GetSpawnedEntities handle GetSpawnedEntities() GetSpawnedEntities() : Get the list of the most recent spawned entities
SetSpawnCallback void SetSpawnCallback(handle hCallbackFunc, handle hCallbackScope) SetSpawnCallback( hCallbackFunc, hCallbackScope, hCallbackData ) : Set a callback for when the template spawns entities. The spawned entities will be passed in as an array.


CPointWorldText

Entity class for point worldtext.

Methods

Function Signature Description
SetMessage void SetMessage(string pMessage) Set the message on this entity.


CPropHMDAvatar

Entity class for prop hmd avatar.

Methods

Function Signature Description
GetVRHand CPropVRHand GetVRHand(int nHandID) Get VR hand by ID (0 and 1).


CPropVRHand

Entity class for prop vr hand. Represents a VR motion controller. The controllers can be enumerated for each player using the CPropHMDAvatar::GetVRHand() method.

Methods

Function Signature Description
AddHandAttachment void AddHandAttachment(handle attachment) Add the attachment to this hand.
AddHandModelOverride void AddHandModelOverride(string modelName) Add a model override for this hand.
FindHandModelOverride handle FindHandModelOverride(string pModelName) Find a specific model override for this hand.
FireHapticPulse void FireHapticPulse(int strength) Fire a haptic pulse on this hand. Integer range [0, 1, 2] for strength.
FireHapticPulsePrecise void FireHapticPulsePrecise(int nPulseDuration) Fire a haptic pulse on this hand. Specify the duration in micro seconds.
GetHandAttachment handle GetHandAttachment() Get the attachment on this hand.
GetHandID int GetHandID() Get the players hand ID for this hand.
GetLiteralHandType int GetLiteralHandType() Get literal type for this hand.
GetPlayer CBasePlayer GetPlayer() Get the player for this hand.
GetVelocity Vector GetVelocity() Get the filtered controller velocity.
GetVRControllerTypeName string GetVRControllerTypeName() Returns the controller type name of the first found controller.
RemoveAllHandModelOverrides void RemoveAllHandModelOverrides() Remove all model overrides for this hand.
RemoveHandAttachmentByHandle void RemoveHandAttachmentByHandle(handle hAttachment) Remove hand attachment by handle.
RemoveHandModelOverride void RemoveHandModelOverride(string pModelName) Remove a model override for this hand.
SetHandAttachment void SetHandAttachment(handle hAttachment) Set the attachment for this hand.


CScriptParticleManager

Allows the creation and manipulation of particle systems.

Global accessor variable: ParticleManager

Function Signature Description
CreateParticle int CreateParticle(string particleName, int particleAttach, handle owningEntity) Creates a new particle effect. Returns the index of the created effect.
CreateParticleForPlayer int CreateParticleForPlayer(string particleName, int particleAttach, handle owningEntity, handle owningPlayer) Creates a new particle effect that only plays for the specified player. Returns the index of the created effect.
DestroyParticle void DestroyParticle(int particleID, bool immediately) Destroys particle.
GetParticleReplacement string GetParticleReplacement(string string_1, handle handle_2) No Description Set
ReleaseParticleIndex void ReleaseParticleIndex(int particleId) Frees the specified particle index
SetParticleAlwaysSimulate void SetParticleAlwaysSimulate(int int_1) No Description Set
SetParticleControl void SetParticleControl(int particleId, int controlIndex, Vector controlData) Set the control point data for a control on a particle effect
SetParticleControlEnt void SetParticleControlEnt(int particleId, int controlIndex, handle entity, ParticleAttachment_t attachType, string attachment, Vector origin, bool unknown) Attaches the control point to an entity.
SetParticleControlForward void SetParticleControlForward(int FXIndex, int controlIndex, Vector forward) Set the forward direction for a control point on a particle effect.
SetParticleControlOffset void SetParticleControlOffset(int iIndex, int iPoint, Vector vecOffset) Set the linear offset for a control on a particle effect.
SetParticleControlOrientation void SetParticleControlOrientation(int FXIndex, int controlIndex, Vector forward, Vector right, Vector up) Set the orientation for a control point on a particle effect.
Note.pngNote:This is left handed -- bad!!
SetParticleControlOrientationFLU void SetParticleControlOrientationFLU(int FXIndex, int controlIndex, Vector forward, Vector left, Vector up) Set the orientation for a control point on a particle effect.

CRigidParticleTrail

[Todo]

Function Signature Description
AddPointGlobal void AddPointGlobal(Vector vPos, float flRadius, Vector vColor)
AddPointLocal void AddPointLocal(Vector vPos, float flRadius, Vector vColor)


CSteamToursBaseGameMode

Game mode entity.

Global object accessed via GameRules:GetGameModeEntity()

Methods

Function Signature Description
GetDetectorQuestCount int GetDetectorQuestCount(CBasePlayer player) Returns the number of active detector quests for the given player.
GetDetectorQuestID string GetDetectorQuestID(CBasePlayer player, int idx) Returns the detector quest's ID, if any, for the given player and index.
GetDetectorQuestLocation Vector GetDetectorQuestLocation(CBasePlayer player, int idx) Returns the detector quest location, if any, for the given player and index.
GetDetectorQuestNumItemsUnlocked int GetDetectorQuestNumItemsUnlocked(CBasePlayer player, string questID) Returns the number of items unlocked for the player and quest.
GetDetectorQuestUnlockedItemDefID string GetDetectorQuestUnlockedItemDefID(CBasePlayer player, string questID, int idx) Returns the item definition ID for the item that was unlocked for the given player and quest.
UnlockItem void UnlockItem(CBasePlayer player, string itemName) Unlocks an item from /scripts/contentdb.txt for the given player. Item names are set using the dev_name key.


CSteamToursGameRules

Game rule manager.

Global accessor variable: GameRules

Methods

Function Signature Description
GetGameModeEntity CSteamToursBaseGameMode GetGameModeEntity() Returns the game mode entity.
GetItemDefData table GetItemDefData(string itemID) Gets the item definition data for the specified item def ID.
SetPlayersCanSpawnAnyItems void SetPlayersCanSpawnAnyItems(bool allowItems) Allow control of whether players can spawn any items or not.
SetPlayersCanSpawnTools void SetPlayersCanSpawnTools(bool allowTools) Allow control of whether players can spawn tools or not.


CSteamTours_ItemTool_Base

Entity class for steamtours itemtool base. This is the hand attachment model spawned when holding a tool.

The color picker widget attaches to the color_picker attachment point on the tool model.

Methods

Function Signature Description
GetColorPickerChannel int GetColorPickerChannel() Returns the color picker's current channel index, or -1 if none.
GetColorPickerColor Vector GetColorPickerColor() Returns a Vector containing RGB (0..255)
GetColorPickerHSV Vector GetColorPickerHSV() Returns a Vector containing Hue (0..360) Saturation (0..1) Value (0..1)
GetColorPickerMode unsigned GetColorPickerMode()
HandleColorPickerInput void HandleColorPickerInput(float x, float y) Updates HSV/color and current channel.
GetColorPickerChannel bool IsColorPickerVisible()
SetColorPickerChannel void SetColorPickerChannel(int nChannel) Sets the color picker's current channel index. (use -1 if none)
SetColorPickerColor void SetColorPickerColor(Vector vColor) Takes a Vector containing RGB (0..255)
SetColorPickerHSV void SetColorPickerHSV(Vector vHSV) Takes a Vector containing Hue (0..360) Saturation (0..1) Value (0..1)
SetColorPickerMode void SetColorPickerMode(unsigned nMode)
SetColorPickerVisible void SetColorPickerVisible(bool bVisible)


SteamInfo

Methods

Function Signature Description
IsPublicUniverse bool IsPublicUniverse() Is the script connected to the public Steam universe.


CTakeDamageInfo

DamageInfo handle returned by CreateDamageInfo()

Methods

Function Signature Description
AddDamage void AddDamage(float addAmount) Adds to the damage value.
AddDamageType void AddDamageType(int bitsDamageType) Adds damage type bit flags.
AllowFriendlyFire bool AllowFriendlyFire()
BaseDamageIsValid bool BaseDamageIsValid()
CanBeBlocked bool CanBeBlocked()
GetAmmoType int GetAmmoType()
GetAttacker CBaseEntity GetAttacker() Returns the attacker entity.
GetBaseDamage float GetBaseDamage()
GetDamage float GetDamage() Returns the damage value.
GetDamageCustom int GetDamageCustom()
GetDamageForce Vector GetDamageForce() Returns the damage force.
GetDamagePosition int GetDamagePosition() Returns the damage position.
GetDamageTaken float GetDamageTaken()
GetDamageType int GetDamageType() Returns the damage type bitfield.
GetInflictor CBaseEntity GetInflictor() Returns the inflictor entity (usually the weapon).
GetMaxDamage float GetMaxDamage()
GetOriginalDamage float GetOriginalDamage()
GetRadius float GetRadius()
GetReportedPosition Vector GetReportedPosition()
GetStabilityDamage float GetStabilityDamage()
ScaleDamage void ScaleDamage(float scaleAmount)
SetAllowFriendlyFire void SetAllowFriendlyFire(bool allow)
SetAmmoType void SetAmmoType(intammoType)
SetAttacker void SetAttacker(CBaseEntity attacker)
SetCanBeBlocked void SetCanBeBlocked(bool block)
SetDamage void SetDamage(float damage) Set new damage value.
SetDamageCustom void SetDamageCustom(int damageCustom)
SetDamageForce void SetDamageForce(Vector damageForce) Sets the damage force vector.
SetDamagePosition void SetDamagePosition(Vector damagePosition) Sets the global space damage position.
SetDamageTaken void SetDamageTaken(int damageTaken)
SetDamageType void SetDamageType(int bitsDamageType) Set the damage type bitfield.
SetMaxDamage void SetMaxDamage(float maxDamage)
SetOriginalDamage void SetOriginalDamage(float originalDamage)
SetRadius void SetRadius(float radius)
SetReportedPosition void SetReportedPosition(Vector reportedPosition)
SetStabilityDamage void SetStabilityDamage(float stabilityDamage)


CVROverlayEntity

Methods

Function Signature Description
IsGrabbable bool IsGrabbable() Returns whether this entity is grabbable.


Convars

Allows access to read and modify console variables.

Global accessor variable: ConVars

Methods

Function Signature Description
GetBool table GetBool(string variableName) GetBool(name) : returns the convar as a boolean flag.
GetCommandClient handle GetCommandClient() GetCommandClient() : returns the player who issued this console command.
GetFloat table GetFloat(string name) GetFloat(name) : returns the convar as a float. May return nil if no such convar.
GetInt table GetInt(string string_1) GetInt(name) : returns the convar as an int. May return nil if no such convar.
GetStr table GetStr(string variableName) GetStr(name) : returns the convar as a string. May return nil if no such convar.
RegisterCommand void RegisterCommand(string variableName, handle function, string helpText, int flags) RegisterCommand(name, fn, helpString, flags) : register a console command.
RegisterConvar void RegisterConvar(string name, string defaultValue, string helpText, int flags) RegisterConvar(name, defaultValue, helpString, flags): register a new console variable.
SetBool void SetBool(string variableName, bool value) SetBool(name, val) : sets the value of the convar to the bool.
SetFloat void SetFloat(string variableName, float value) SetFloat(name, val) : sets the value of the convar to the float.
SetInt void SetInt(string string_1, int int_2) SetInt(name, val) : sets the value of the convar to the int.
SetStr void SetStr(string string_1, string string_2) SetStr(name, val) : sets the value of the convar to the string.


Decider

No Description Set

Methods

Function Signature Description
AddRule bool AddRule(CRule rule) Add a CRule object (defined in rulescript_base.nut)
FindAllMatches handle FindAllMatches(handle query, float leeway) Returns an array of all matching responses. If leeway is nonzero, all results scoring within 'leeway' of the best score return.
FindBestMatch handle FindBestMatch(handle query) Query the database and return the best result found. If multiple of equal score found, an arbitrary one returns.


GlobalSys

Used to read the command line parameters the game was started with.

Global accessor variable: GlobalSys

Methods

Function Signature Description
CommandLineCheck bool CommandLineCheck(string name) Returns true if the command line param was used, otherwise false.
CommandLineFloat float CommandLineFloat(string name) Returns the command line param as a float.
CommandLineInt int CommandLineInt(string name) Returns the command line param as an int.
CommandLineStr string CommandLineStr(string name) Returns the command line param as a string.


Uint64

Integer with binary operations. Used for motion controller button masks.

Methods

Function Signature Description
BitwiseAnd int BitwiseAnd(Uint64 operand) Performs bitwise AND between two integers.
BitwiseOr int BitwiseOr(Uint64 operand) Performs bitwise OR between two integers.
BitwiseXor int BitwiseXor(Uint64 operand) Performs bitwise XOR between two integers.
BitwiseNot int BitwiseNot(Uint64 operand) Performs bitwise NOT between two integers.
ClearBit int ClearBit(int bitvalue) Clears the specified bit.
IsBitSet bool IsBitSet(int bitvalue) Checks if a bit is set.
SetBit int SetBit(int bitvalue) Sets the specified bit.
ToggleBit int ToggleBit(int bitvalue) Toggles the specified bit.
ToHexString string ToHexString() Returns a hexadecimal string representation of the integer.


QAngle

Class for angles.

Methods

Function Signature Description
constructor QAngle(float pitch, float yaw, float roll) Creates a new QAngle.
__add QAngle __add(QAngle a, QAngle b) Overloaded +. Adds angles together.
Note.pngNote:Use RotateOrientation() instead to properly rotate angles.
__eq bool __eq(QAngle a, QAngle b) Overloaded ==. Tests for Equality
__tostring string __tostring() Overloaded .. Converts the QAngle to a human readable string.
Forward Vector Forward() Returns the forward vector.
Left Vector Left() Returns the left vector.
Up Vector Up() Returns the up vector.

Members

Variable Description
x Pitch angle
y Yaw angle
z Roll angle

Quarternion

Class for quaterinions.

Global accessor variable: None available

Icon-Bug.pngBug: This class is broken and cannot be instantiated.
Todo:  List of methods doesn't seem to be available.

Vector

3D vector class.

Methods

Function Signature Description
constructor Vector(float x, float y, float z) Creates a new vector with the specified Cartesian coordinates.
__add Vector __add(Vector a, Vector b) Overloaded +. Adds vectors together.
__div Vector __div(Vector a, Vector b) Overloaded /. Divides vectors.
__eq bool __eq(Vector a, Vector b) Overloaded ==. Tests for Equality.
__len float __len() Overloaded # returns the length of the vector.
__mul Vector __mul(Vector a, Vector b) Overloaded * returns the vectors multiplied together. can also be used to multiply with scalars.
__sub Vector __sub(Vector a, Vector b) Overloaded -. Subtracts vectors
__tostring string __tostring() Overloaded .. Converts vectors to strings
__unm Vector __unm() Overloaded unary - operator. Reverses the vector.
Cross Vector Cross(Vector a, Vector b) Cross product of two vectors.
Dot float Dot(Vector a, Vector b) Dot product of two vectors.
Length float Length() Length of the Vector.
Length2D float Length2D() Length of the Vector in the XY plane.
Lerp Vector Lerp(Vector target, float t) Linear interpolation between the vector and the passed in target over t = [0,1].
Normalized Vector Normalized() Returns the vector normalized.

Members

Variable Description
x X-axis
y Y-axis
z Z-axis

Enumerations

Todo: More undocumented enumerations exist.


Activation types

Passed to the Activate() hook function.

Name Value Description
ACTIVATE_TYPE_INITIAL_CREATION 0 When the function is called after entity creation.
ACTIVATE_TYPE_DATAUPDATE_CREATION 1 [Todo]
ACTIVATE_TYPE_ONRESTORE 2 When the function is called after the entity has been restored from a saved game.


Damage types

Name Value Description
DMG_GENERIC 0
DMG_CRUSH 1
DMG_BULLET 2
DMG_SLASH 4
DMG_BURN 8
DMG_VEHICLE 16
DMG_FALL 32
DMG_BLAST 64
DMG_CLUB 128
DMG_SHOCK 256
DMG_SONIC 512
DMG_ENERGYBEAM 1024
DMG_PREVENT_PHYSICS_FORCE 2048
DMG_NEVERGIB 4096
DMG_ALWAYSGIB 8192
DMG_DROWN 16384
DMG_PARALYZE 32768
DMG_NERVEGAS 65536
DMG_POISON 131072
DMG_RADIATION 262144
DMG_DROWNRECOVER 524288
DMG_ACID 1048576
DMG_SLOWBURN 2097152
DMG_REMOVENORAGDOLL 4194304
DMG_PHYSGUN 8388608
DMG_PLASMA 16777216
DMG_AIRBOAT 33554432
DMG_DISSOLVE 67108864
DMG_BLAST_SURFACE 134217728
DMG_DIRECT 268435456


Controller types

Player VR controller types returned by CBasePlayer::GetVRControllerType()

Name Value Description
VR_CONTROLLER_TYPE_UNKNOWN 0
VR_CONTROLLER_TYPE_X360 1
VR_CONTROLLER_TYPE_VIVE 2
VR_CONTROLLER_TYPE_TOUCH 3
VR_CONTROLLER_TYPE_RIFT_S 4
5
Todo:  Unknown, no enum available.
VR_CONTROLLER_TYPE_KNUCKLES 6
VR_CONTROLLER_TYPE_WINDOWSMR 7
VR_CONTROLLER_TYPE_WINDOWSMR_SAMSUNG 8
VR_CONTROLLER_TYPE_GENERIC_TRACKED 9
VR_CONTROLLER_TYPE_COSMOS 10


Input digital actions

Corresponds to the SteamVR Input key binds. Used in CBasePlayer::IsActionActiveForHand()

Name Value Description
DEFAULT_TOGGLE_MENU 0
DEFAULT_LCLICK 1
DEFAULT_RCLICK 2
DEFAULT_USE 3
DEFAULT_USE_GRIP 4
DEFAULT_SHOW_INVENTORY 5
DEFAULT_PAD 6
DEFAULT_PAD_TOUCH 7
MOVE_TELEPORT 8
MOVE_TURN_LEFT 9
MOVE_TURN_RIGHT 10
PROP_TOOL_MENU 11
PROP_TOOL_USE 12
PROP_TOOL_DROP 13
PROP_TOOL_PAD 14
PROP_TOOL_PAD_TOUCH 15
PROP_TOOL_PAD_LEFT 16
PROP_TOOL_PAD_RIGHT 17
PROP_TOOL_PAD_UP 18
PROP_TOOL_PAD_DOWN 19


Motion controller buttons

Legacy input mappings used by some functions.

Name Value Description
IN_USE_HAND0 24 When the trigger is pressed. Same for Oculus Touch.
IN_USE_HAND1 25 When the trigger is pressed. Same for Oculus Touch.
IN_PAD_LEFT_HAND0 26 When the pad is pressed on the left side.
IN_PAD_RIGHT_HAND0 27 When the pad is pressed on the right side.
IN_PAD_UP_HAND0 28 When the pad is pressed on the top.
IN_PAD_DOWN_HAND0 29 When the pad is pressed on the bottom.
IN_PAD_LEFT_HAND1 30 When the pad is pressed on the left side.
IN_PAD_RIGHT_HAND1 31 When the pad is pressed on the right side.
IN_PAD_UP_HAND1 32 When the pad is pressed on the top.
IN_PAD_DOWN_HAND1 33 When the pad is pressed on the bottom.
IN_MENU_HAND0 34 Menu button above the touchpad.
IN_MENU_HAND1 35 Menu button above the touchpad.
IN_GRIP_HAND0 36 Pressing the grip. Lightly pushing the grip for Oculus Touch.
IN_GRIP_HAND1 37 Pressing the grip. Lightly pushing the grip for Oculus Touch.
IN_GRIPANALOG_HAND0
IN_GRIPANALOG_HAND1
IN_PAD_HAND0 38 When the pad is pressed anywhere. Heavily pushing the grip for Oculus Touch.
IN_PAD_HAND1 39 When the pad is pressed anywhere. Heavily pushing the grip for Oculus Touch.
IN_PAD_TOUCH_HAND0 40 When the pad is touched anywhere. Pushing the thumbstick on Oculus Touch.
IN_PAD_TOUCH_HAND1 41 When the pad is touched anywhere. Pushing the thumbstick on Oculus Touch.
42 Touching the thumbstick on Oculus Touch.
43 Touching the thumbstick on Oculus Touch.


ParticleAttachment_t

Name Value Description
PATTACH_INVALID -1
PATTACH_ABSORIGIN 0 Spawn on entity origin.
PATTACH_ABSORIGIN_FOLLOW 1 Follow the entity origin.
PATTACH_CUSTOMORIGIN 2
PATTACH_CUSTOMORIGIN_FOLLOW 3
PATTACH_POINT 4 Spawn on entity attachment point.
PATTACH_POINT_FOLLOW 5 Follow entity attachment point.
PATTACH_EYES_FOLLOW 6
PATTACH_OVERHEAD_FOLLOW 7
PATTACH_WORLDORIGIN 8 Spawn on map origin.
PATTACH_ROOTBONE_FOLLOW 9
PATTACH_RENDERORIGIN_FOLLOW 10
PATTACH_MAIN_VIEW 11
PATTACH_WATERWAKE 12
PATTACH_CENTER_FOLLOW 13
PATTACH_CUSTOM_GAME_STATE_1 14
MAX_PATTACH_TYPES 15