Revelations 2012/Scripting/Script Functions

From Valve Developer Community
Jump to navigation Jump to search

Automatically generated Squirrel functions list for Revelations 2012 Revelations 2012.

Classes

:: (Global functions)

Methods

Function Signature Description
DebugDrawBox void DebugDrawBox(Vector, Vector, Vector, int, int, int, int, float) Draw a debug overlay box
DebugDrawLine void DebugDrawLine(Vector, Vector, int, int, int, bool, float) Draw a debug overlay box
DoIncludeScript bool DoIncludeScript(string, handle) Execute a script (internal)
EntFire function EntFire(target, action, value, delay, activator) Generate and entity i/o event
RandomFloat float RandomFloat(float, float) Generate a random floating point number within a range, inclusive
RandomInt int RandomInt(int, int) Generate a random integer within a range, inclusive
SendToConsole void SendToConsole(string) Send a string to the console as a command
ShowMessage void ShowMessage(string) Print a hud message on all clients
Time float Time() Get the current server time
UniqueString function UniqueString(string) 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.

CDirector

Extends .

Methods

Function Signature Description
CDirector::GetAveragedSurvivorSpan float CDirector::GetAveragedSurvivorSpan() Get the distance between the lead and trailing survivors, smoothed over time
CDirector::GetAveragedSurvivorSpeed float CDirector::GetAveragedSurvivorSpeed() Get the rate at which the lead survivor is moving along the flow, smoothed over time
CDirector::GetFurthestSurvivorFlow float CDirector::GetFurthestSurvivorFlow() Get the maximum distance along the flow that the survivors have reached
CDirector::GetGameMode string CDirector::GetGameMode() Get the current game mode
CDirector::HasAnySurvivorLeftSafeArea bool CDirector::HasAnySurvivorLeftSafeArea() True when one or more survivors have left the starting safe area
CDirector::IsPlayingOnConsole bool CDirector::IsPlayingOnConsole() Return true if game is running on a console (such as Xbox 360)
CDirector::IsSinglePlayerGame bool CDirector::IsSinglePlayerGame() Return true if game is in single player
CDirector::L4D1SurvivorGiveItem void CDirector::L4D1SurvivorGiveItem() Let the L4D1 survivors know that now is a good time to give the players an item
CDirector::PlayMegaMobWarningSounds void CDirector::PlayMegaMobWarningSounds() Plays a horde scream sound and asks survivors to speak 'incoming horde' lines
CDirector::ResetMobTimer void CDirector::ResetMobTimer() Trigger a mob as soon as possible when in BUILD_UP

CNavMesh

Extends .

Methods

Function Signature Description
CNavMesh::UnblockRescueVehicleNav void CNavMesh::UnblockRescueVehicleNav() Unblock the rescue vehicle nav areas so bots can path through them

CEntities

Extends .

Methods

Function Signature Description
CEntities::FindByClassname handle CEntities::FindByClassname(handle, string) Find entities by class name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
CEntities::FindByClassnameNearest handle CEntities::FindByClassnameNearest(string, Vector, float) Find entities by class name nearest to a point.
CEntities::FindByClassnameWithin handle CEntities::FindByClassnameWithin(handle, string, Vector, float) Find entities by class name within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
CEntities::FindByModel handle CEntities::FindByModel(handle, string) Find entities by model name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
CEntities::FindByName handle CEntities::FindByName(handle, string) Find entities by name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
CEntities::FindByNameNearest handle CEntities::FindByNameNearest(string, Vector, float) Find entities by name nearest to a point.
CEntities::FindByNameWithin handle CEntities::FindByNameWithin(handle, string, Vector, float) Find entities by name within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
CEntities::FindByTarget handle CEntities::FindByTarget(handle, string) Find entities by targetname. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
CEntities::FindInSphere handle CEntities::FindInSphere(handle, Vector, float) Find entities within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
CEntities::First handle CEntities::First() Begin an iteration over the list of entities
CEntities::Next handle CEntities::Next(handle) Continue an iteration over the list of entities, providing reference to a previously found entity

CBaseEntity

Extends .

Methods

Function Signature Description
CBaseEntity::ConnectOutput void CBaseEntity::ConnectOutput(string, string) Adds an I/O connection that will call the named function when the specified output fires
CBaseEntity::DisconnectOutput void CBaseEntity::DisconnectOutput(string, string) Removes a connected script function from an I/O event.
CBaseEntity::FirstMoveChild handle CBaseEntity::FirstMoveChild()
CBaseEntity::GetClassname string CBaseEntity::GetClassname()
CBaseEntity::GetForwardVector Vector CBaseEntity::GetForwardVector() Get the forward vector of the entity
CBaseEntity::GetHealth int CBaseEntity::GetHealth()
CBaseEntity::GetMoveParent handle CBaseEntity::GetMoveParent() If in hierarchy, retrieves the entity's parent
CBaseEntity::GetName string CBaseEntity::GetName()
CBaseEntity::GetOrigin Vector CBaseEntity::GetOrigin()
CBaseEntity::GetPreTemplateName string CBaseEntity::GetPreTemplateName() Get the entity name stripped of template unique decoration
CBaseEntity::GetRootMoveParent handle CBaseEntity::GetRootMoveParent() If in hierarchy, walks up the hierarchy to find the root parent
CBaseEntity::GetScriptId string CBaseEntity::GetScriptId() Retrieve the unique identifier used to refer to the entity within the scripting system
CBaseEntity::GetScriptScope handle CBaseEntity::GetScriptScope() Retrieve the script-side data associated with an entity
CBaseEntity::GetVelocity Vector CBaseEntity::GetVelocity()
CBaseEntity::NextMovePeer handle CBaseEntity::NextMovePeer()
CBaseEntity::SetForwardVector void CBaseEntity::SetForwardVector(Vector) Set the orientation of the entity to have this forward vector
CBaseEntity::SetHealth void CBaseEntity::SetHealth(int)
CBaseEntity::SetOrigin void CBaseEntity::SetOrigin(Vector)
CBaseEntity::SetVelocity void CBaseEntity::SetVelocity(Vector)
CBaseEntity::ValidateScriptScope bool CBaseEntity::ValidateScriptScope() Ensure that an entity's script scope has been created

See also