Alien Swarm/Scripting/Script Functions: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Make the ASW script index fancier and not a script_help paste.)
Line 1: Line 1:
[[Category:Alien Swarm]]
Automatically generated Squirrel functions list for {{alienswarm|4}}.
[[Category:Scripting]]
{{cmd|script_help}} dump
<pre>
Function:    CBaseEntity::ConnectOutput
Signature:  void CBaseEntity::ConnectOutput(string, string)
Description: Adds an I/O connection that will call the named function when the specified output fires


Function:   CBaseEntity::Destroy
== Classes ==
Signature:   void CBaseEntity::Destroy()
=== :: (Global functions) ===
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
| <code>CreateProp</code>
| <code>handle CreateProp(string, Vector, string, int)</code>
| Create a physics prop
|-
| <code>CreateSceneEntity</code>
| <code>handle CreateSceneEntity(string)</code>
| Create a scene entity to play the specified scene.
|-
| <code>DebugDrawBox</code>
| <code>void DebugDrawBox(Vector, Vector, Vector, int, int, int, int, float)</code>
| Draw a debug overlay box
|-
| <code>DebugDrawLine</code>
| <code>void DebugDrawLine(Vector, Vector, int, int, int, bool, float)</code>
| Draw a debug overlay box
|-
| <code>DoIncludeScript</code>
| <code>bool DoIncludeScript(string, handle)</code>
| Execute a script (internal)
|-
| <code>EntFireByHandle</code>
| <code>void EntFireByHandle(handle, string, string, float, handle, handle)</code>
| Generate and entity i/o event. First parameter is an entity instance.
|-
| <code>FrameTime</code>
| <code>float FrameTime()</code>
| Get the time spent on the server in the last frame
|-
| <code>GetMapName</code>
| <code>string GetMapName()</code>
| Get the name of the map.
|-
| <code>RandomFloat</code>
| <code>float RandomFloat(float, float)</code>
| Generate a random floating point number within a range, inclusive
|-
| <code>RandomInt</code>
| <code>int RandomInt(int, int)</code>
| Generate a random integer within a range, inclusive
|-
| <code>SendToConsole</code>
| <code>void SendToConsole(string)</code>
| Send a string to the console as a command
|-
| <code>ShowMessage</code>
| <code>void ShowMessage(string)</code>
| Print a hud message on all clients
|-
| <code>Time</code>
| <code>float Time()</code>
| Get the current server time
|-
| <code>TraceLine</code>
| <code>float TraceLine(Vector, Vector, handle)</code>
| given 2 points & ent to ignore, return fraction along line that hits world or models
|}
=== CEntities ===
==== Methods ====
{| class="standard-table" style="width: 100%;"
! Function
! Signature
! Description
|-
| <code>CEntities::CreateByClassname</code>
| <code>handle CEntities::CreateByClassname(string)</code>
| Creates an entity by classname
|-
| <code>CEntities::FindByClassname</code>
| <code>handle CEntities::FindByClassname(handle, string)</code>
| Find entities by class name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
|-
| <code>CEntities::FindByClassnameNearest</code>
| <code>handle CEntities::FindByClassnameNearest(string, Vector, float)</code>
| Find entities by class name nearest to a point.
|-
| <code>CEntities::FindByClassnameWithin</code>
| <code>handle CEntities::FindByClassnameWithin(handle, string, Vector, float)</code>
| 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
|-
| <code>CEntities::FindByModel</code>
| <code>handle CEntities::FindByModel(handle, string)</code>
| Find entities by model name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
|-
| <code>CEntities::FindByName</code>
| <code>handle CEntities::FindByName(handle, string)</code>
| Find entities by name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
|-
| <code>CEntities::FindByNameNearest</code>
| <code>handle CEntities::FindByNameNearest(string, Vector, float)</code>
| Find entities by name nearest to a point.
|-
| <code>CEntities::FindByNameWithin</code>
| <code>handle CEntities::FindByNameWithin(handle, string, Vector, float)</code>
| Find entities by name within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
|-
| <code>CEntities::FindByTarget</code>
| <code>handle CEntities::FindByTarget(handle, string)</code>
| Find entities by targetname. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
|-
| <code>CEntities::FindInSphere</code>
| <code>handle CEntities::FindInSphere(handle, Vector, float)</code>
| Find entities within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
|-
| <code>CEntities::First</code>
| <code>handle CEntities::First()</code>
| Begin an iteration over the list of entities
|-
| <code>CEntities::Next</code>
| <code>handle CEntities::Next(handle)</code>
| Continue an iteration over the list of entities, providing reference to a previously found entity
|}


Function:    CBaseEntity::DisconnectOutput
== See also ==
Signature:  void CBaseEntity::DisconnectOutput(string, string)
* [[VScript]]
Description: Removes a connected script function from an I/O event.
* [[VScript Fundamentals]]
* {{sq}} [[Squirrel]]


Function:   CBaseEntity::EmitSound
[[Category:Alien Swarm]]
Signature:  void CBaseEntity::EmitSound(string)
[[Category:Scripting]]
Description: Plays a sound from this entity.
 
Function:    CBaseEntity::EyePosition
Signature:  Vector CBaseEntity::EyePosition()
Description: Get vector to eye position - absolute coords
 
Function:    CBaseEntity::FirstMoveChild
Signature:  handle CBaseEntity::FirstMoveChild()
 
Function:    CBaseEntity::GetAngles
Signature:  Vector CBaseEntity::GetAngles()
Description: Get entity pitch, yaw, roll as a vector
 
Function:    CBaseEntity::GetAngularVelocity
Signature:  Vector CBaseEntity::GetAngularVelocity()
Description: Get the local angular velocity - returns a vector of pitch,yaw,roll
 
Function:    CBaseEntity::GetBoundingMaxs
Signature:  Vector CBaseEntity::GetBoundingMaxs()
Description: Get a vector containing max bounds, centered on object
 
Function:    CBaseEntity::GetBoundingMins
Signature:  Vector CBaseEntity::GetBoundingMins()
Description: Get a vector containing min bounds, centered on object
 
Function:    CBaseEntity::GetCenter
Signature:  Vector CBaseEntity::GetCenter()
Description: Get vector to center of object - absolute coords
 
Function:    CBaseEntity::GetClassname
Signature:  string CBaseEntity::GetClassname()
 
Function:    CBaseEntity::GetForwardVector
Signature:  Vector CBaseEntity::GetForwardVector()
Description: Get the forward vector of the entity
 
Function:    CBaseEntity::GetHealth
Signature:  int CBaseEntity::GetHealth()
 
Function:    CBaseEntity::GetLeftVector
Signature:  Vector CBaseEntity::GetLeftVector()
Description: Get the left vector of the entity
 
Function:    CBaseEntity::GetMaxHealth
Signature:  int CBaseEntity::GetMaxHealth()
 
Function:    CBaseEntity::GetModelKeyValues
Signature:  handle CBaseEntity::GetModelKeyValues()
Description: Get a KeyValue class instance on this entity's model
 
Function:    CBaseEntity::GetModelName
Signature:  string CBaseEntity::GetModelName()
Description: Returns the name of the model
 
Function:    CBaseEntity::GetMoveParent
Signature:  handle CBaseEntity::GetMoveParent()
Description: If in hierarchy, retrieves the entity's parent
 
Function:    CBaseEntity::GetName
Signature:  string CBaseEntity::GetName()
 
Function:    CBaseEntity::GetOrigin
Signature:  Vector CBaseEntity::GetOrigin()
 
Function:    CBaseEntity::GetOwner
Signature:  handle CBaseEntity::GetOwner()
Description: Gets this entity's owner
 
Function:    CBaseEntity::GetPreTemplateName
Signature:  string CBaseEntity::GetPreTemplateName()
Description: Get the entity name stripped of template unique decoration
 
Function:    CBaseEntity::GetRootMoveParent
Signature:  handle CBaseEntity::GetRootMoveParent()
Description: If in hierarchy, walks up the hierarchy to find the root parent
 
Function:    CBaseEntity::GetScriptId
Signature:  string CBaseEntity::GetScriptId()
Description: Retrieve the unique identifier used to refer to the entity within the scripting system
 
Function:    CBaseEntity::GetScriptScope
Signature:  handle CBaseEntity::GetScriptScope()
Description: Retrieve the script-side data associated with an entity
 
Function:    CBaseEntity::GetSoundDuration
Signature:  float CBaseEntity::GetSoundDuration(string, string)
Description: Returns float duration of the sound. Takes soundname and optional actormodelname.
 
Function:    CBaseEntity::GetTeam
Signature:  int CBaseEntity::GetTeam()
 
Function:    CBaseEntity::GetUpVector
Signature:  Vector CBaseEntity::GetUpVector()
Description: Get the up vector of the entity
 
Function:   CBaseEntity::GetVelocity
Signature:  Vector CBaseEntity::GetVelocity()
 
Function:    CBaseEntity::NextMovePeer
Signature:  handle CBaseEntity::NextMovePeer()
 
Function:    CBaseEntity::PrecacheSoundScript
Signature:  void CBaseEntity::PrecacheSoundScript(string)
Description: Precache a sound for later playing.
 
Function:    CBaseEntity::SetAbsOrigin
Signature:  void CBaseEntity::SetAbsOrigin(Vector)
Description: SetAbsOrigin
 
Function:    CBaseEntity::SetAngles
Signature:  void CBaseEntity::SetAngles(float, float, float)
Description: Set entity pitch, yaw, roll
 
Function:    CBaseEntity::SetAngularVelocity
Signature:  void CBaseEntity::SetAngularVelocity(float, float, float)
Description: Set the local angular velocity - takes float pitch,yaw,roll velocities
 
Function:    CBaseEntity::SetForwardVector
Signature:  void CBaseEntity::SetForwardVector(Vector)
Description: Set the orientation of the entity to have this forward vector
 
Function:    CBaseEntity::SetHealth
Signature:  void CBaseEntity::SetHealth(int)
 
Function:    CBaseEntity::SetMaxHealth
Signature:  void CBaseEntity::SetMaxHealth(int)
 
Function:    CBaseEntity::SetModel
Signature:  void CBaseEntity::SetModel(string)
 
Function:    CBaseEntity::SetOrigin
Signature:  void CBaseEntity::SetOrigin(Vector)
 
Function:    CBaseEntity::SetOwner
Signature:  void CBaseEntity::SetOwner(handle)
Description: Sets this entity's owner
 
Function:    CBaseEntity::SetSize
Signature:  void CBaseEntity::SetSize(Vector, Vector)
 
Function:    CBaseEntity::SetTeam
Signature:  void CBaseEntity::SetTeam(int)
 
Function:    CBaseEntity::SetVelocity
Signature:  void CBaseEntity::SetVelocity(Vector)
 
Function:    CBaseEntity::ValidateScriptScope
Signature:  bool CBaseEntity::ValidateScriptScope()
Description: Ensure that an entity's script scope has been created
 
Function:    CBaseEntity::entindex
Signature:  int CBaseEntity::entindex()
 
Function:    CEntities::CreateByClassname
Signature:  handle CEntities::CreateByClassname(string)
Description: Creates an entity by classname
 
Function:    CEntities::FindByClassname
Signature:  handle CEntities::FindByClassname(handle, string)
Description: Find entities by class name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
 
Function:    CEntities::FindByClassnameNearest
Signature:  handle CEntities::FindByClassnameNearest(string, Vector, float)
Description: Find entities by class name nearest to a point.
 
Function:    CEntities::FindByClassnameWithin
Signature:  handle CEntities::FindByClassnameWithin(handle, string, Vector, float)
Description: 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
 
Function:    CEntities::FindByModel
Signature:  handle CEntities::FindByModel(handle, string)
Description: Find entities by model name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
 
Function:    CEntities::FindByName
Signature:  handle CEntities::FindByName(handle, string)
Description: Find entities by name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
 
Function:    CEntities::FindByNameNearest
Signature:  handle CEntities::FindByNameNearest(string, Vector, float)
Description: Find entities by name nearest to a point.
 
Function:    CEntities::FindByNameWithin
Signature:  handle CEntities::FindByNameWithin(handle, string, Vector, float)
Description: Find entities by name within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
 
Function:    CEntities::FindByTarget
Signature:  handle CEntities::FindByTarget(handle, string)
Description: Find entities by targetname. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
 
Function:    CEntities::FindInSphere
Signature:  handle CEntities::FindInSphere(handle, Vector, float)
Description: Find entities within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
 
Function:    CEntities::First
Signature:  handle CEntities::First()
Description: Begin an iteration over the list of entities
 
Function:    CEntities::Next
Signature:  handle CEntities::Next(handle)
Description: Continue an iteration over the list of entities, providing reference to a previously found entity
 
Function:    CreateProp
Signature:  handle CreateProp(string, Vector, string, int)
Description: Create a physics prop
 
Function:    CreateSceneEntity
Signature:  handle CreateSceneEntity(string)
Description: Create a scene entity to play the specified scene.
 
Function:    DebugDrawBox
Signature:  void DebugDrawBox(Vector, Vector, Vector, int, int, int, int, float)
Description: Draw a debug overlay box
 
Function:    DebugDrawLine
Signature:  void DebugDrawLine(Vector, Vector, int, int, int, bool, float)
Description: Draw a debug overlay box
 
Function:    DoIncludeScript
Signature:  bool DoIncludeScript(string, handle)
Description: Execute a script (internal)
 
Function:    EntFire
Signature:  function EntFire(target, action, value, delay, activator)
Description: Generate and entity i/o event
 
Function:    EntFireByHandle
Signature:  void EntFireByHandle(handle, string, string, float, handle, handle)
Description: Generate and entity i/o event. First parameter is an entity instance.
 
Function:    FrameTime
Signature:  float FrameTime()
Description: Get the time spent on the server in the last frame
 
Function:    GetMapName
Signature:  string GetMapName()
Description: Get the name of the map.
 
Function:    RandomFloat
Signature:  float RandomFloat(float, float)
Description: Generate a random floating point number within a range, inclusive
 
Function:    RandomInt
Signature:  int RandomInt(int, int)
Description: Generate a random integer within a range, inclusive
 
Function:    SendToConsole
Signature:  void SendToConsole(string)
Description: Send a string to the console as a command
 
Function:    ShowMessage
Signature:  void ShowMessage(string)
Description: Print a hud message on all clients
 
Function:    Time
Signature:  float Time()
Description: Get the current server time
 
Function:    TraceLine
Signature:  float TraceLine(Vector, Vector, handle)
Description: given 2 points & ent to ignore, return fraction along line that hits world or models
 
Function:    UniqueString
Signature:  function UniqueString(string)
Description: 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.
</pre>

Revision as of 09:39, 7 August 2025

Automatically generated Squirrel functions list for Template:Alienswarm.

Classes

:: (Global functions)

Methods

Function Signature Description
CreateProp handle CreateProp(string, Vector, string, int) Create a physics prop
CreateSceneEntity handle CreateSceneEntity(string) Create a scene entity to play the specified scene.
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)
EntFireByHandle void EntFireByHandle(handle, string, string, float, handle, handle) Generate and entity i/o event. First parameter is an entity instance.
FrameTime float FrameTime() Get the time spent on the server in the last frame
GetMapName string GetMapName() Get the name of the map.
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
TraceLine float TraceLine(Vector, Vector, handle) given 2 points & ent to ignore, return fraction along line that hits world or models

CEntities

Methods

Function Signature Description
CEntities::CreateByClassname handle CEntities::CreateByClassname(string) Creates an entity by classname
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

See also