Alien Swarm/Scripting/Script Functions: Difference between revisions
< Alien Swarm | Scripting
		
		
		
		Jump to navigation
		Jump to search
		|  (Make the ASW script index fancier and not a script_help paste.) |  (Note that they also apply to Lambda Wars and SFM) | ||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
| Automatically generated Squirrel functions list for {{ | Automatically generated Squirrel functions list for {{as|4}}. Note that these are also valid for {{lw|4}} and {{sfm|4}} as they contain the same functions listed here with no added functions. | ||
| == Classes == | == Classes == | ||
Latest revision as of 09:43, 7 August 2025
Automatically generated Squirrel functions list for  Alien Swarm. Note that these are also valid for
 Alien Swarm. Note that these are also valid for  Lambda Wars and
 Lambda Wars and  Source Filmmaker as they contain the same functions listed here with no added functions.
 Source Filmmaker as they contain the same functions listed here with no added functions.
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 | 
