bool SpawnEntityGroupFromTable(handle, bool, handle)
Hierarchically spawn an entity group from a set of spawn tables.
table LoadKeyValuesFromString(string)
Creates a table from the specified keyvalues string
handle EntIndexToHScript(int)
Turn an entity index integer to an HScript representing that entity's script instance.
void StartSoundEventReliable(string, handle)
Start a sound event with reliable delivery
void StopEffect(handle, string)
Pass entity and effect name
void Say(handle, string, bool)
Have Entity say string, and teamOnly or not
void DebugDrawBoxDirection(Vector, Vector, Vector, Vector, Vector, float, float)
Draw a debug forward box (cent, min, max, forward, vRgb, a, duration)
void StartSoundEventUnreliable(string, handle)
Start a sound event with optional delivery
int RandomInt(int, int)
Get a random int within a range
void SendToConsole(string)
Send a string to the console as a client command
QAngle VectorToAngles(Vector)
Get Qangles (with no roll) for a Vector.
bool IsDedicatedServer()
Returns true if this server is a dedicated server.
Vector SplineVectors(Vector, Vector, float)
(vector,vector,float) very basic interpolation of v0 to v1 over t on [0,1]
void Msg(string)
Print a message
Vector AnglesToVector(QAngle)
Generate a vector given a QAngles
bool rr_AddDecisionRule(handle)
Add a rule to the decision database.
table LoadKeyValues(string)
Creates a table from the specified keyvalues text file
bool TraceLine(handle)
Pass table - Inputs: startpos, endpos, mask, ignore -- outputs: pos, fraction, hit, enthit, startsolid
void ShowMessage(string)
Print a hud message on all clients
void UnloadSpawnGroup(string)
Unload a spawn group by name
handle GetListenServerHost()
Get the local player on a listen server.
bool StopListeningToGameEvent(int)
Stop listening to a particular game event.
Vector RotationDeltaAsAngularVelocity(QAngle, QAngle)
converts delta QAngle to an angular velocity Vector
void FireEntityIOInputVec(ehandle, string, Vector)
Fire Entity's Action Input with passed Vector - you own the memory
void DoEntFire(string, string, string, float, handle, handle)
#EntFire:Generate and entity i/o event
bool IsMarkedForDeletion(handle)
Returns true if the entity is valid and marked for deletion.
table LocalTime()
Get the current local time
Vector RotatePosition(Vector, QAngle, Vector)
Rotate a Vector around a point.
void UnloadSpawnGroupByHandle(int)
Unload a spawn group by handle
void PrintLinkedConsoleMessage(string, string)
Print a console message with a linked console command
int MakeStringToken(string)
Checks to see if the given hScript is a valid entity
Quaternion RotateQuaternionByAxisAngle(Quaternion, Vector, float)
(quaternion,vector,float) rotates a quaternion by the specified angle around the specified vector axis
void UTIL_MessageTextAll_WithContext(string, int, int, int, int, handle)
Sends colored text to all clients. (Valid context keys: player_id, value, team_id)
void StopSoundOn(string, handle)
Stop named sound on Entity
void ReloadMOTD()
Reloads the MotD file
bool TraceCollideable(handle)
Pass table - Inputs: start, end, ent, (optional mins, maxs) -- outputs: pos, fraction, hit, startsolid, normal
bool IsInToolsMode()
Returns true if this is lua running within tools mode.
void SetOpvarFloatPlayer(string, string, string, float, handle)
Sets an opvar value for a single player
void UTIL_RemoveImmediate(handle)
Immediately removes the specified entity
void SetQuestPhase(int)
Set the current quest phase.
void DebugDrawBox(Vector, Vector, Vector, int, int, int, int, float)
Draw a debug overlay box (origin, mins, maxs, forward, r, g, b, a, duration )
void FireEntityIOInputString(ehandle, string, string)
Fire Entity's Action Input with passed String - you own the memory
Vector CalcClosestPointOnEntityOBB(handle, Vector)
Compute the closest point on the OBB of an entity.
void UTIL_MessageTextAll(string, int, int, int, int)
Sends colored text to all clients.
bool IsClient()
Returns true if this is lua running from the client.dll.
handle CreateTriggerRadiusApproximate(Vector, float)
CreateTriggerRadiusApproximate( vecOrigin, flRadius ) : Creates and returns an AABB trigger thats bigger than the radius provided
Vector GetPhysVelocity(handle)
Get Velocity for VPHYS or normal object
bool CreateEffect(handle)
Pass table - Inputs: entity, effect
void ManuallyTriggerSpawnGroupCompletion(int)
Triggers the creation of entities in a manually-completed spawn group
Vector LerpVectors(Vector, Vector, float)
(vector,vector,float) lerp between two vectors by a float factor returning new vector
float CalcDistanceToLineSegment2D(Vector, Vector, Vector)
QAngle RotationDelta(QAngle, QAngle)
Find the delta between two QAngles.
void InitLogFile(string, string)
InitLogFile is deprecated. Print to the console for logging instead.
bool IsValidEntity(handle)
Checks to see if the given hScript is a valid entity
bool TraceHull(handle)
Pass table - Inputs: start, end, min, max, mask, ignore -- outputs: pos, fraction, hit, enthit, startsolid
void SetOpvarFloatAll(string, string, string, float)
Sets an opvar value for all players
Quaternion AxisAngleToQuaternion(Vector, float)
(vector,float) constructs a quaternion representing a rotation by angle around the specified vector axis
void UTIL_ResetMessageTextAll()
Clear all message text from all clients.
void DebugDrawSphere(Vector, Vector, float, float, bool, float)
Draw a debug sphere (center, vRgb, a, rad, ztest, duration)
void Warning(string)
Print a warning
void DebugDrawClear()
Try to clear all the debug overlay info
float cvar_getf(string)
Gets the value of the given cvar, as a float.
bool cvar_setf(string, float)
Sets the value of the given cvar, as a float.
void EmitSoundOn(string, handle)
Play named sound on Entity
int SpawnEntityListFromTableAsynchronous(handle, handle)
Asynchronously spawn an entity group from a list of spawn tables. A callback will be triggered when the spawning is complete
float AngleDiff(float, float)
Returns the number of degrees difference between two yaw angles
void DebugBreak()
Breaks in the debugger
handle CreateSceneEntity(string)
Create a scene entity to play the specified scene.
void UTIL_ResetMessageText(int)
Clear all message text on one client.
handle SpawnEntityFromTableSynchronous(string, handle)
Synchronously spawns a single entity from a table
bool DoIncludeScript(string, handle)
Execute a script (internal)
void SendToServerConsole(string)
Send a string to the console as a server command
void UTIL_MessageText_WithContext(int, string, int, int, int, int, handle)
Sends colored text to one client. (Valid context keys: player_id, value, team_id)
void SetQuestName(string)
Set the current quest name.
void UTIL_MessageText(int, string, int, int, int, int)
Sends colored text to one client.
void PrecacheEntityListFromTable(handle, handle)
Precache a list of entity KeyValues tables
handle CreateTrigger(Vector, Vector, Vector)
CreateTrigger( vecMin, vecMax ) : Creates and returns an AABB trigger
int GetFrameCount()
Returns the engines current frame count
void DoEntFireByInstanceHandle(handle, string, string, float, handle, handle)
#EntFireByHandle:Generate and entity i/o event
string DoUniqueString(string)
#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 tables when not sure what keys are already in use in that table.
void SetRenderingEnabled(ehandle, bool)
Set rendering on/off for an ehandle
handle PlayerInstanceFromIndex(int)
Get a script instance of a player by index.
void StartSoundEvent(string, handle)
Start a sound event
void DebugScreenTextPretty(float, float, int, string, int, int, int, int, float, string, int, bool)
Draw pretty debug text (x, y, lineOffset, text, r, g, b, a, duration, font, size, bBold)
Vector CrossVectors(Vector, Vector)
(vector,vector) cross product between two vectors
QAngle RotateOrientation(QAngle, QAngle)
Rotate a QAngle by another QAngle.
float CalcDistanceBetweenEntityOBB(handle, handle)
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.
void StopListeningToAllGameEvents(handle)
Stop listening to all game events within a specific context.
void DebugDrawLine(Vector, Vector, int, int, int, bool, float)
Draw a debug overlay line (origin, target, r, g, b, ztest, duration)
void PrecacheResource(string, string, handle)
( resourceType, resourcePath, context ) - Manually precache a single resource. Types: "model|model_folder|sound|soundfile|particle|particle_folder"
void FireGameEventLocal(string, handle)
Fire a game event without broadcasting to the client.
handle rr_GetResponseTargets()
Retrieve a table of all available expresser targets, in the form { name : handle, name: handle }.
void FireEntityIOInputNameOnly(ehandle, string)
Fire Entity's Action Input w/no data
void AppendToLogFile(string, string)
AppendToLogFile is deprecated. Print to the console for logging instead.
float RandomFloat(float, float)
Get a random float within a range
void ScreenShake(Vector, float, float, float, float, int, bool)
Start a screenshake with the following parameters. vecCenter, flAmplitude, flFrequency, flDuration, flRadius, eCommand( SHAKE_START = 0, SHAKE_STOP = 1 ), bAirShake
int ListenToGameEvent(string, handle, handle)
Register as a listener for a game event from script.
void SpawnEntityFromTableAsynchronous(string, handle, handle, handle)
Asynchronously spawns a single entity from a table
float FrameTime()
Get the time spent on the server in the last frame
void FireGameEvent(string, handle)
Fire a game event.
Quaternion SplineQuaternions(Quaternion, Quaternion, float)
(quaternion,quaternion,float) very basic interpolation of v0 to v1 over t on [0,1]
void EmitSoundOnClient(string, handle)
Play named sound only on the client for the passed in player
handle SpawnEntityListFromTableSynchronous(handle)
Synchronously spawn an entity group from a list of spawn tables.
float Time()
Get the current server time
void PrecacheModel(string, handle)
( modelName, context ) - Manually precache a single model
handle CreateDamageInfo(handle, handle, Vector, Vector, float, int)
(hInflictor, hAttacker, flDamage) - Allocate a damageinfo object, used as an argument to TakeDamage(). Call DestroyDamageInfo( hInfo ) to free the object.
int GetActiveSpawnGroupHandle()
Returns the currently active spawn group handle
void PrecacheEntityFromTable(string, handle, handle)
Precache an entity from KeyValues in table
void StopSoundEvent(string, handle)
Stops a sound event with optional delivery
void StartSoundEventFromPositionUnreliable(string, Vector)
Start a sound event from position with optional delivery
void RemoveSpawnGroupFilterProxy(string)
Remove the C proxy for a script-based spawn group filter
void DestroyDamageInfo(handle)
Free a damageinfo object that was created with CreateDamageInfo().
void DoScriptAssert(bool, string)
#ScriptAssert:Asserts the passed in value. Prints out a message and brings up the assert dialog.
void StartSoundEventFromPosition(string, Vector)
Start a sound event from position
void SetPhysAngularVelocity(handle, Vector)
Set Angular Velocity for VPHYS or normal object, from a vector of the axis of rotation, multiplied by the degrees of rotation per second.
void DebugDrawScreenTextLine(float, float, int, string, int, int, int, int, float)
Draw text with a line offset (x, y, lineOffset, text, r, g, b, a, duration)
void DebugDrawText(Vector, string, bool, float)
Draw text in 3d (origin, text, bViewCheck, duration)
void RegisterSpawnGroupFilterProxy(string)
Create a C proxy for a script-based spawn group filter
Vector GetPhysAngularVelocity(handle)
Get Angular Velocity for VPHYS or normal object. Returns a vector of the axis of rotation, multiplied by the degrees of rotation per second.
void DebugDrawLine_vCol(Vector, Vector, Vector, bool, float)
Draw a debug line using color vec (start, end, vRgb, a, ztest, duration)
float GetMaxOutputDelay(ehandle, string)
Get the longest delay for all events attached to an output
void DebugDrawCircle(Vector, Vector, float, float, bool, float)
Draw a debug circle (center, vRgb, a, rad, ztest, duration)
bool rr_CommitAIResponse(handle, handle)
Commit the result of QueryBestResponse back to the given entity to play. Call with params (entity, airesponse)
void UTIL_Remove(handle)
Removes the specified entity
bool rr_QueryBestResponse(handle, handle, handle)
Params: (entity, query) : tests 'query' against entity's response system and returns the best response found (or null if none found).
void CancelEntityIOEvents(ehandle)
Create all I/O events for a particular entity
string GetMapName()
Get the name of the map.
float ExponentialDecay(float, float, float)
Smooth curve decreasing slower as it approaches zero
void StartSoundEventFromPositionReliable(string, Vector)
Start a sound event from position with reliable delivery
bool IsServer()
Returns true if this is lua running from the server.dll.