Globals
ActivatePaint
Activates the specified paint power on the player.
AddBranchLevelName
Adds a level to the specified branche's list.
AddCoopCreditsName
Adds a name to the coop credit's list.
CreateEntityByName
(string className, table entKeyVals) - Create entity by class string with specified key values
CreateProp
Create a physics prop
CreateSceneEntity
Create a scene entity to play the specified scene.
DeactivateAllPaints
Deactivates all the paints on the player.
DeactivatePaint
Deactivates the specified paint power on the player.
DebugDrawBox
Draw a debug overlay box
DebugDrawBoxAngles
Draw a debug overlay box with angles
DebugDrawEntityText
Draw debug overlay entity text
DebugDrawEntityTextAtPosition
Draw a debug overlay entity text at position
DebugDrawGrid
Draw debug overlay grid
DebugDrawLine
Draw a debug overlay box
DebugDrawScreenText
Draw debug overlay screen text
DebugDrawText
Draw debug overlay text
DebugDrawTri
Draw a debug overlay triangle
DispatchParticleEffect
Dispatches a one-off particle system
DoIncludeScript
Execute a script (internal)
EntFire
Generate and entity i/o event
EntFireByHandle
Generate and entity i/o event. First parameter is an entity instance.
FindPortalByID
Finds a portal by linkage ID and portal number. Portal number 1 is the primary portal, 2 is the secondary. Linkage ID should be <255
FrameTime
Get the time spent on the server in the last frame
GetBluePlayerIndex
Player index of the blue player.
GetCoopBranchLevelIndex
Given the 'branch' argument, returns the current chosen level.
GetCoopSectionIndex
Section that the coop players have selected to load.
GetDeveloperLevel
Gets the level of 'developer'
GetHighestActiveBranch
Returns which branches should be available in the hub.
GetMapIndexInPlayOrder
Determines which index (by order played) this map is. Returns -1 if entry is not found. -2 if this is not a known community map.
GetMapName
Get the name of the map.
GetNumMapsPlayed
Returns how many maps the player has played through.
GetOrangePlayerIndex
Player index of the orange player.
GetPlayer
Returns the player (SP Only).
GetPlayerByIndex
Gets the player by their index. This is a one-based index and must be in the range (1 <= index <= GetPlayerCount())
GetPlayerCount
Returns the number of connected clients, this will always be 1 for listen servers
GetPlayerSilenceDuration
Time that the specified player has been silent on the mic.
GivePlayerPaintgun
Give player the paintgun with no paints active.
GivePlayerPortalgun
Give player the portalgun.
IsCoOp
Is this a co-op game?
IsLevelComplete
Returns true if the level in the specified branch is completed by either player.
IsMultiplayer
Is this a multiplayer game?
IsPlayerLevelComplete
Returns true if the level in the specified branch is completed by a specific player.
LoopSinglePlayerMaps
Run the single player maps in a continuous loop.
MarkMapComplete
Marks a maps a complete for both players.
PrecacheMovie
Precaches a named movie. Only valid to call within the entity's 'Precache' function called on mapspawn.
RandomFloat
Generate a random floating point number within a range, inclusive
RandomInt
Generate a random integer within a range, inclusive
RecordAchievementEvent
Records achievement event or progress
RequestMapRating
Pops up the map rating dialog for user input
ScriptIsLocalPlayerUsingController
Is the local player using a controller?
ScriptPrintMessageCenterAll
Prints an alert message in the center print method to all players.
ScriptPrintMessageCenterAllWithParams
Prints an alert message in the center print method to all players. Needs to pass token/message. param1, param2, param3. Can pass null if you need less than 3.
ScriptPrintMessageCenterTeam
Prints an alert message in the center print method to the specified team.
ScriptPrintMessageChatAll
Prints a message in chat to all players.
ScriptPrintMessageChatTeam
Prints a message in chat to the specified team.
ScriptShowHudMessageAll
Show center print text message.
ScriptSteamShowURL
Bring up the steam overlay and shows the specified URL. (Full address with protocol type is required, e.g. http://www.steamgames.com/ )
SendToConsole
Send a string to the console as a command
SendToConsoleServer
Send a string that gets executed on the server as a ServerCommand
SendToPanorama
Send an event to Panorama
SetDucking
Set the level of an audio ducking channel
SetMapAsPlayed
Adds the current map to the play order and returns the new index therein. Returns -2 if this is not a known community map.
ShowMessage
Print a hud message on all clients
Time
Get the current server time
TraceHull
Sweeps a hull along the specified line. Returns a CGameTrace with the trace result
TraceLine
given 2 points & ent to ignore, return fraction along line that hits world or models
TraceLineEx
Given 2 points, ent to ignore, collision group and trace mask, returns a CGameTrace with the result
TraceLinePlayersIncluded
given 2 points & ent to ignore, return fraction along line that hits world, models, players or npcs
TracePortalLine
Same as TraceLineEx, but will transform the trace based on any portals it passes through. If the last bool is true, it will transform based on the first portal it went though.
TryDLC1InstalledOrCatch
Tests if the DLC1 is installed for Try/Catch blocks.
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.
UpgradePlayerPaintgun
Upgrades the players paintgun, if they are not holding one it will give them one.
UpgradePlayerPortalgun
Give player the portalgun.
UpgradePlayerPotatogun
Give player the portalgun.