Nuclear Dawn/Scripting/Script Functions: Difference between revisions
m (Fixed formatting) |
(Add CBaseAnimating, CCallChainer and CSimpleCallChainer) |
||
| (6 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
Automatically generated Squirrel functions list for {{nd|4}}. | |||
== Classes == | == Classes == | ||
=== | === :: (Global functions) === | ||
==== Methods ==== | |||
{| class="standard-table" style="width: 100%;" | {| class="standard-table" style="width: 100%;" | ||
! Function | ! Function | ||
| Line 10: | Line 9: | ||
! Description | ! Description | ||
|- | |- | ||
| <code> | | <code>DebugDrawBox</code> | ||
| <code>handle | | <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>GetConVarFloat</code> | |||
| <code>float GetConVarFloat(string)</code> | |||
| Retrieves a ConVar's value as a float | |||
|- | |||
| <code>GetConVarInt</code> | |||
| <code>int GetConVarInt(string)</code> | |||
| Retrieves a ConVar's value as an integer | |||
|- | |- | ||
| <code> | | <code>GetConVarString</code> | ||
| <code> | | <code>string GetConVarString(string)</code> | ||
| | | Retrieves a ConVar's value as a string | ||
|- | |- | ||
| <code> | | <code>GetMapName</code> | ||
| <code> | | <code>string GetMapName()</code> | ||
| | | Get the name of the map. | ||
|- | |- | ||
| <code> | | <code>GetTeam</code> | ||
| <code>handle | | <code>handle GetTeam(int)</code> | ||
| | | Returns a team's handle. | ||
|- | |- | ||
| <code> | | <code>RandomFloat</code> | ||
| <code> | | <code>float RandomFloat(float, float)</code> | ||
| | | Generate a random floating point number within a range, inclusive | ||
|- | |- | ||
| <code> | | <code>RandomInt</code> | ||
| <code> | | <code>int RandomInt(int, int)</code> | ||
| | | Generate a random integer within a range, inclusive | ||
|- | |- | ||
| <code> | | <code>SendToConsole</code> | ||
| <code> | | <code>void SendToConsole(string)</code> | ||
| | | Send a string to the console as a command | ||
|- | |- | ||
| <code> | | <code>SetConVarFloat</code> | ||
| <code> | | <code>void SetConVarFloat(string, float)</code> | ||
| | | Sets a ConVar's value from a float | ||
|- | |- | ||
| <code> | | <code>SetConVarInt</code> | ||
| <code> | | <code>void SetConVarInt(string, int)</code> | ||
| | | Sets a ConVar's value from an integer | ||
|- | |- | ||
| <code> | | <code>SetConVarString</code> | ||
| <code> | | <code>void SetConVarString(string, string)</code> | ||
| | | Sets a ConVar's value from a string | ||
|- | |- | ||
| <code> | | <code>ShowMessage</code> | ||
| <code> | | <code>void ShowMessage(string)</code> | ||
| | | Print a hud message on all clients | ||
|- | |- | ||
| <code> | | <code>Time</code> | ||
| <code> | | <code>float Time()</code> | ||
| | | Get the current server time | ||
|} | |} | ||
=== CBaseEntity === | === CBaseEntity === | ||
==== Methods ==== | |||
{| class="standard-table" style="width: 100%;" | {| class="standard-table" style="width: 100%;" | ||
! Function | ! Function | ||
| Line 65: | Line 80: | ||
! Description | ! Description | ||
|- | |- | ||
| <code>ConnectOutput</code> | | <code>CBaseEntity::__KeyValueFromInt</code> | ||
| <code>void ConnectOutput(string, string)</code> | | <code>void CBaseEntity::__KeyValueFromInt(string, int)</code> | ||
| Sets int value for key name on the entity. | |||
|- | |||
| <code>CBaseEntity::__KeyValueFromString</code> | |||
| <code>void CBaseEntity::__KeyValueFromString(string, string)</code> | |||
| Sets string value for key name on the entity. | |||
|- | |||
| <code>CBaseEntity::__KeyValueFromVector</code> | |||
| <code>void CBaseEntity::__KeyValueFromVector(string, vector)</code> | |||
| Sets vector value for key name on the entity. | |||
|- | |||
| <code>CBaseEntity::ConnectOutput</code> | |||
| <code>void CBaseEntity::ConnectOutput(string, string)</code> | |||
| Adds an I/O connection that will call the named function when the specified output fires | | Adds an I/O connection that will call the named function when the specified output fires | ||
|- | |- | ||
| <code>DisconnectOutput</code> | | <code>CBaseEntity::DisconnectOutput</code> | ||
| <code>void DisconnectOutput(string, string)</code> | | <code>void CBaseEntity::DisconnectOutput(string, string)</code> | ||
| Removes a connected script function from an I/O event. | | Removes a connected script function from an I/O event. | ||
|- | |- | ||
| <code>GetHealth</code> | | <code>CBaseEntity::FirstMoveChild</code> | ||
| <code>int GetHealth()</code> | | <code>handle CBaseEntity::FirstMoveChild()</code> | ||
| | | | ||
|- | |||
| <code>CBaseEntity::GetClassname</code> | |||
| <code>string CBaseEntity::GetClassname()</code> | |||
| | |||
|- | |||
| <code>CBaseEntity::GetForwardVector</code> | |||
| <code>Vector CBaseEntity::GetForwardVector()</code> | |||
| Get the forward vector of the entity | |||
|- | |||
| <code>CBaseEntity::GetHealth</code> | |||
| <code>int CBaseEntity::GetHealth()</code> | |||
| | |||
|- | |||
| <code>CBaseEntity::GetLifeState</code> | |||
| <code>int CBaseEntity::GetLifeState()</code> | |||
| | |||
|- | |||
| <code>CBaseEntity::GetMaxHealth</code> | |||
| <code>int CBaseEntity::GetMaxHealth()</code> | |||
| | |||
|- | |||
| <code>CBaseEntity::GetMoveParent</code> | |||
| <code>handle CBaseEntity::GetMoveParent()</code> | |||
| If in hierarchy, retrieves the entity's parent | |||
|- | |||
| <code>CBaseEntity::GetName</code> | |||
| <code>string CBaseEntity::GetName()</code> | |||
| | |||
|- | |- | ||
| <code> | | <code>CBaseEntity::GetOrigin</code> | ||
| <code> | | <code>Vector CBaseEntity::GetOrigin()</code> | ||
| | | | ||
|- | |- | ||
| <code> | | <code>CBaseEntity::GetPreTemplateName</code> | ||
| <code> | | <code>string CBaseEntity::GetPreTemplateName()</code> | ||
| | | Get the entity name stripped of template unique decoration | ||
|- | |- | ||
| <code> | | <code>CBaseEntity::GetRootMoveParent</code> | ||
| <code>handle | | <code>handle CBaseEntity::GetRootMoveParent()</code> | ||
| | | If in hierarchy, walks up the hierarchy to find the root parent | ||
|- | |- | ||
| <code> | | <code>CBaseEntity::GetScriptId</code> | ||
| <code> | | <code>string CBaseEntity::GetScriptId()</code> | ||
| | | Retrieve the unique identifier used to refer to the entity within the scripting system | ||
|- | |- | ||
| <code> | | <code>CBaseEntity::GetScriptScope</code> | ||
| <code> | | <code>handle CBaseEntity::GetScriptScope()</code> | ||
| | | Retrieve the script-side data associated with an entity | ||
|- | |- | ||
| <code> | | <code>CBaseEntity::GetTeam</code> | ||
| <code> | | <code>handle CBaseEntity::GetTeam()</code> | ||
| | | | ||
|- | |- | ||
| <code> | | <code>CBaseEntity::GetTeamNumber</code> | ||
| <code> | | <code>int CBaseEntity::GetTeamNumber()</code> | ||
| | | | ||
|- | |- | ||
| <code> | | <code>CBaseEntity::GetVelocity</code> | ||
| <code> | | <code>Vector CBaseEntity::GetVelocity()</code> | ||
| | | | ||
|- | |- | ||
| <code> | | <code>CBaseEntity::NextMovePeer</code> | ||
| <code> | | <code>handle CBaseEntity::NextMovePeer()</code> | ||
| | | | ||
|- | |- | ||
| <code> | | <code>CBaseEntity::SetAbsOrigin</code> | ||
| <code>void | | <code>void CBaseEntity::SetAbsOrigin(Vector)</code> | ||
| | | SetAbsOrigin | ||
|- | |- | ||
| <code> | | <code>CBaseEntity::SetForwardVector</code> | ||
| <code> | | <code>void CBaseEntity::SetForwardVector(Vector)</code> | ||
| | | Set the orientation of the entity to have this forward vector | ||
|- | |- | ||
| <code> | | <code>CBaseEntity::SetHealth</code> | ||
| <code>void | | <code>void CBaseEntity::SetHealth(int)</code> | ||
| | | | ||
|- | |- | ||
| <code> | | <code>CBaseEntity::SetOrigin</code> | ||
| <code> | | <code>void CBaseEntity::SetOrigin(Vector)</code> | ||
| | | | ||
|- | |- | ||
| <code>SetVelocity</code> | | <code>CBaseEntity::SetVelocity</code> | ||
| <code>void SetVelocity( | | <code>void CBaseEntity::SetVelocity(Vector)</code> | ||
| | | | ||
|- | |- | ||
| <code> | | <code>CBaseEntity::ValidateScriptScope</code> | ||
| <code> | | <code>bool CBaseEntity::ValidateScriptScope()</code> | ||
| | | Ensure that an entity's script scope has been created | ||
|} | |||
=== CBaseAnimating === | |||
Extends <code>CBaseEntity</code>. | |||
There is no new methods for this class | |||
<!-- i probably shouldn't have added this but it's funny doe, i've verified this does exist --~~~~ --> | |||
=== CEntities === | |||
==== Methods ==== | |||
{| class="standard-table" style="width: 100%;" | |||
! Function | |||
! Signature | |||
! Description | |||
|- | |- | ||
| <code> | | <code>CEntities::CreateByClassname</code> | ||
| <code>handle | | <code>handle CEntities::CreateByClassname(string)</code> | ||
| | | Creates an entity by classname | ||
|- | |- | ||
| <code> | | <code>CEntities::FindByClassname</code> | ||
| <code>handle | | <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> | | <code>CEntities::FindByClassnameNearest</code> | ||
| <code>handle | | <code>handle CEntities::FindByClassnameNearest(string, Vector, float)</code> | ||
| | | Find entities by class name nearest to a point. | ||
|- | |- | ||
| <code> | | <code>CEntities::FindByClassnameWithin</code> | ||
| <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> | | <code>CEntities::FindByNameWithin</code> | ||
| <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> | | <code>CEntities::FindByTarget</code> | ||
| <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> | | <code>CEntities::FindInSphere</code> | ||
| <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> | | <code>CEntities::First</code> | ||
| <code>handle | | <code>handle CEntities::First()</code> | ||
| | | Begin an iteration over the list of entities | ||
|- | |- | ||
| <code> | | <code>CEntities::Next</code> | ||
| <code> | | <code>handle CEntities::Next(handle)</code> | ||
| | | Continue an iteration over the list of entities, providing reference to a previously found entity | ||
|} | |} | ||
=== CNDPlayer === | === CNDPlayer === | ||
Extends <code>CBaseEntity</code>. | |||
==== Methods ==== | |||
{| class="standard-table" style="width: 100%;" | {| class="standard-table" style="width: 100%;" | ||
! Function | ! Function | ||
| Line 180: | Line 261: | ||
! Description | ! Description | ||
|- | |- | ||
| <code>IsCommander</code> | | <code>CNDPlayer::IsCommander</code> | ||
| <code>bool IsCommander()</code> | | <code>bool CNDPlayer::IsCommander()</code> | ||
| Get whether or not the player is the commander for their team. | | Get whether or not the player is the commander for their team. | ||
|- | |- | ||
| <code>IsCommanding</code> | | <code>CNDPlayer::IsCommanding</code> | ||
| <code>bool IsCommanding()</code> | | <code>bool CNDPlayer::IsCommanding()</code> | ||
| Get whether or not the player is currently in RTS mode. | | Get whether or not the player is currently in RTS mode. | ||
|- | |- | ||
| <code>GetSquad</code> | | <code>CNDPlayer::GetSquad</code> | ||
| <code>handle GetSquad()</code> | | <code>handle CNDPlayer::GetSquad()</code> | ||
| Returns handle to the player's squad. | | Returns handle to the player's squad. | ||
|- | |- | ||
| <code>GetSquadNumber</code> | | <code>CNDPlayer::GetSquadNumber</code> | ||
| <code>int GetSquadNumber()</code> | | <code>int CNDPlayer::GetSquadNumber()</code> | ||
| Returns squad index of the player (0 - Alpha, 1 - Bravo, 2 - Charlie, 3 - Delta). | | Returns squad index of the player (0 - Alpha, 1 - Bravo, 2 - Charlie, 3 - Delta). | ||
|- | |- | ||
| <code>GetClass</code> | | <code>CNDPlayer::GetClass</code> | ||
| <code>int GetClass()</code> | | <code>int CNDPlayer::GetClass()</code> | ||
| Returns class index of the player. | | Returns class index of the player. | ||
|- | |- | ||
| <code>GetKit</code> | | <code>CNDPlayer::GetKit</code> | ||
| <code>int GetKit()</code> | | <code>int CNDPlayer::GetKit()</code> | ||
| Returns kit index of the player. | | Returns kit index of the player. | ||
|- | |- | ||
| <code>GetActiveGizmo</code> | | <code>CNDPlayer::GetActiveGizmo</code> | ||
| <code>int GetActiveGizmo()</code> | | <code>int CNDPlayer::GetActiveGizmo()</code> | ||
| Returns index of the player's currently selected gizmo. | | Returns index of the player's currently selected gizmo. | ||
|- | |- | ||
| <code>IsGizmoActive</code> | | <code>CNDPlayer::IsGizmoActive</code> | ||
| <code>bool IsGizmoActive(int)</code> | | <code>bool CNDPlayer::IsGizmoActive(int)</code> | ||
| Returns whether effect of gizmo is active, either from equipped on player or active gizmo for player's squad. | | Returns whether effect of gizmo is active, either from equipped on player or active gizmo for player's squad. | ||
|- | |- | ||
| <code>IsInCondition</code> | | <code>CNDPlayer::IsInCondition</code> | ||
| <code>bool IsInCondition(int)</code> | | <code>bool CNDPlayer::IsInCondition(int)</code> | ||
| Returns whether given condition is currently applied to the player. | | Returns whether given condition is currently applied to the player. | ||
|- | |- | ||
| <code>GetWeaponByName</code> | | <code>CNDPlayer::GetWeaponByName</code> | ||
| <code>handle GetWeaponByName(string)</code> | | <code>handle CNDPlayer::GetWeaponByName(string)</code> | ||
| Returns handle to weapon owned by player of specified classname or null if unowned. | | Returns handle to weapon owned by player of specified classname or null if unowned. | ||
|- | |- | ||
| <code>GetAmmoCount</code> | | <code>CNDPlayer::GetAmmoCount</code> | ||
| <code>int GetAmmoCount(int)</code> | | <code>int CNDPlayer::GetAmmoCount(int)</code> | ||
| Returns reserve ammo count of the player of specificed ammo type. | | Returns reserve ammo count of the player of specificed ammo type. | ||
|- | |- | ||
| <code>GiveAmmo</code> | | <code>CNDPlayer::GiveAmmo</code> | ||
| <code>void GiveAmmo(int, int)</code> | | <code>void CNDPlayer::GiveAmmo(int, int)</code> | ||
| Gives the player ammo of specified type. | | Gives the player ammo of specified type. | ||
|} | |} | ||
=== CNDTeam === | === CNDTeam === | ||
Extends <code>CBaseEntity</code>. | |||
==== Methods ==== | |||
{| class="standard-table" style="width: 100%;" | {| class="standard-table" style="width: 100%;" | ||
! Function | ! Function | ||
| Line 235: | Line 318: | ||
! Description | ! Description | ||
|- | |- | ||
| <code>GetTeamName</code> | | <code>CNDTeam::GetTeamName</code> | ||
| <code>string GetTeamName()</code> | | <code>string CNDTeam::GetTeamName()</code> | ||
| Returns name of the team. | | Returns name of the team. | ||
|- | |- | ||
| <code>GetResources</code> | | <code>CNDTeam::GetResources</code> | ||
| <code>int GetResources()</code> | | <code>int CNDTeam::GetResources()</code> | ||
| Returns resource count of the team. | | Returns resource count of the team. | ||
|- | |- | ||
| <code>SetResources</code> | | <code>CNDTeam::SetResources</code> | ||
| <code>void SetResources(int)</code> | | <code>void CNDTeam::SetResources(int)</code> | ||
| Sets resource count of the team. | | Sets resource count of the team. | ||
|- | |- | ||
| <code>GetCommander</code> | | <code>CNDTeam::GetCommander</code> | ||
| <code>handle GetCommander()</code> | | <code>handle CNDTeam::GetCommander()</code> | ||
| Returns handle to team's commander player. | | Returns handle to team's commander player. | ||
|- | |- | ||
| <code>GetSquad</code> | | <code>CNDTeam::GetSquad</code> | ||
| <code>handle GetSquad(int)</code> | | <code>handle CNDTeam::GetSquad(int)</code> | ||
| Returns handle to indexed squad for the team. | | Returns handle to indexed squad for the team. | ||
|- | |- | ||
| <code>GetPlayerCount</code> | | <code>CNDTeam::GetPlayerCount</code> | ||
| <code>int GetPlayerCount()</code> | | <code>int CNDTeam::GetPlayerCount()</code> | ||
| Returns the number of players in the team. | | Returns the number of players in the team. | ||
|- | |- | ||
| <code>GetPlayer</code> | | <code>CNDTeam::GetPlayer</code> | ||
| <code>handle GetPlayer(int)</code> | | <code>handle CNDTeam::GetPlayer(int)</code> | ||
| Returns handle to player at specified index of team players (0-based). | | Returns handle to player at specified index of team players (0-based). | ||
|} | |} | ||
=== CNDSquad === | === CNDSquad === | ||
Extends <code>CBaseEntity</code>. | |||
==== Methods ==== | |||
{| class="standard-table" style="width: 100%;" | {| class="standard-table" style="width: 100%;" | ||
! Function | ! Function | ||
| Line 270: | Line 355: | ||
! Description | ! Description | ||
|- | |- | ||
| <code>GetActiveGizmo</code> | | <code>CNDSquad::GetActiveGizmo</code> | ||
| <code>int GetActiveGizmo</code> | | <code>int CNDSquad::GetActiveGizmo</code> | ||
| Returns the active gizmo for the squad. | | Returns the active gizmo for the squad. | ||
|- | |- | ||
| <code>AddPlayer</code> | | <code>CNDSquad::AddPlayer</code> | ||
| <code>void AddPlayer(handle)</code> | | <code>void CNDSquad::AddPlayer(handle)</code> | ||
| Adds player to the squad. | | Adds player to the squad. | ||
|- | |- | ||
| <code>RemovePlayer</code> | | <code>CNDSquad::RemovePlayer</code> | ||
| <code>void RemovePlayer(handle)</code> | | <code>void CNDSquad::RemovePlayer(handle)</code> | ||
| Removes player from the squad. | | Removes player from the squad. | ||
|- | |- | ||
| <code>HasPlayer</code> | | <code>CNDSquad::HasPlayer</code> | ||
| <code>bool HasPlayer(handle)</code> | | <code>bool CNDSquad::HasPlayer(handle)</code> | ||
| Returns whether or not the player is in the squad. | | Returns whether or not the player is in the squad. | ||
|} | |} | ||
=== CNDBaseWeapon === | === CNDBaseWeapon === | ||
Extends <code>CBaseEntity</code>. | |||
==== Methods ==== | |||
{| class="standard-table" style="width: 100%;" | {| class="standard-table" style="width: 100%;" | ||
! Function | ! Function | ||
| Line 293: | Line 380: | ||
! Description | ! Description | ||
|- | |- | ||
| <code>GetClipAmmoCount</code> | | <code>CNDBaseWeapon::GetClipAmmoCount</code> | ||
| <code>int GetClipAmmoCount()</code> | | <code>int CNDBaseWeapon::GetClipAmmoCount()</code> | ||
| Returns the current ammo count inside the clip of the weapon. | | Returns the current ammo count inside the clip of the weapon. | ||
|- | |- | ||
| <code>SetClipAmmoCount</code> | | <code>CNDBaseWeapon::SetClipAmmoCount</code> | ||
| <code>void SetClipAmmoCount(int)</code> | | <code>void CNDBaseWeapon::SetClipAmmoCount(int)</code> | ||
| Sets the current ammo count inside the clip of the weapon. | | Sets the current ammo count inside the clip of the weapon. | ||
|- | |- | ||
| <code>GetAmmoType</code> | | <code>CNDBaseWeapon::GetAmmoType</code> | ||
| <code>int GetAmmoType()</code> | | <code>int CNDBaseWeapon::GetAmmoType()</code> | ||
| Returns the ammo type used by the weapon. | | Returns the ammo type used by the weapon. | ||
|- | |- | ||
| <code>GetMaxClipAmmoCount</code> | | <code>CNDBaseWeapon::GetMaxClipAmmoCount</code> | ||
| <code>int GetMaxClipAmmoCount()</code> | | <code>int CNDBaseWeapon::GetMaxClipAmmoCount()</code> | ||
| Returns the maximum amount of ammo that the clip of the weapon can hold. | | Returns the maximum amount of ammo that the clip of the weapon can hold. | ||
|- | |- | ||
| <code>GetDefaultClipAmmoCount</code> | | <code>CNDBaseWeapon::GetDefaultClipAmmoCount</code> | ||
| <code>int GetDefaultClipAmmoCount()</code> | | <code>int CNDBaseWeapon::GetDefaultClipAmmoCount()</code> | ||
| Returns the default amount of ammo that the clip of the weapon holds. | | Returns the default amount of ammo that the clip of the weapon holds. | ||
|} | |} | ||
=== CEnvEntityMaker === | |||
Extends <code>CBaseEntity</code>. | |||
=== | Script handle class for [[env_entity_maker]]. | ||
==== Methods ==== | |||
{| class="standard-table" style="width: 100%;" | |||
! Function !! Signature !! Description | |||
|- | |||
| <code>CEnvEntityMaker::SpawnEntity</code> | |||
| <code>void CEnvEntityMaker::SpawnEntity()</code> | |||
| Create an entity at the location of the maker. | |||
|- | |||
| <code>CEnvEntityMaker::SpawnEntityAtEntityOrigin</code> | |||
| <code>void CEnvEntityMaker::SpawnEntityAtEntityOrigin(CBaseEntity entity)</code> | |||
| Create an entity at the location of a specified entity instance. | |||
|- | |||
| <code>CEnvEntityMaker::SpawnEntityAtLocation</code> | |||
| <code>void CEnvEntityMaker::SpawnEntityAtLocation(Vector origin, QAngle orientation)</code> | |||
| Create an entity at a specified location and orientation. | |||
|- | |||
| <code>CEnvEntityMaker::SpawnEntityAtNamedEntityOrigin</code> | |||
| <code>void CEnvEntityMaker::SpawnEntityAtNamedEntityOrigin(string name)</code> | |||
| Create an entity at the location of a named entity. | |||
|} | |||
=== CCallChainer === | === CCallChainer === | ||
'''CCallChainer''' objects collect all functions with a matching prefix in a given scope, then inserts it all into the chains table with the prefix removed. All collected unprefixed functions can then be called in a chain using the class's Call() method, given the method's ''event'' argument matches the functions' name. | |||
Whenever a '''CCallChainer''' object is created, a function named Dispatch followed by its given prefix will also be created, which the class binds the environment of its Call() method to. | |||
== | ==== Methods ==== | ||
= | |||
{| class="standard-table" style="width: 100%;" | {| class="standard-table" style="width: 100%;" | ||
! Function | ! Function | ||
| Line 331: | Line 436: | ||
! Description | ! Description | ||
|- | |- | ||
| <code> | | <code>constructor</code> | ||
| <code>void | | <code>CCallChainer(string ''functionPrefix'', table ''scope'' = null)</code> | ||
| | | Creates a CCallChainer object that'll collect functions that have a matching prefix in the given scope. | ||
|- | |||
| <code>CCallChainer::PostScriptExecute</code> | |||
| <code>void CCallChainer::PostScriptExecute()</code> | |||
| Search for all non-native functions with matching prefixes, then push them into the chains table. | |||
|- | |||
| <code>CCallChainer::Call</code> | |||
| <code>bool CCallChainer::Call(string ''event'', any ...)</code> | |||
| Find an unprefixed function name in the chains table and call it with the given arguments. | |||
|} | |||
==== Members ==== | |||
{| class="standard-table" style="width: 100%;" | |||
! Instance | |||
! Type | |||
! Description | |||
|- | |- | ||
| <code> | | <code>chains</code> | ||
| <code> | | <code>table</code> | ||
| | | Contains names of unprefixed functions, each with an array of functions to call. | ||
|- | |- | ||
| <code> | | <code>prefix</code> | ||
| <code> | | <code>string</code> | ||
| | | Prefix that functions should have to be added into the chains table. Set by the constructor. | ||
|- | |- | ||
| <code> | | <code>scope</code> | ||
| <code> | | <code>table</code> | ||
| | | If set, seek functions in this scope instead. Set by the constructor. | ||
|} | |||
=== CSimpleCallChainer === | |||
Intended to be simpler to use than CCallChainer, the class '''CSimpleCallChainer''' holds only a single chain of functions inside an array instead of multiple inside a table. As such, its Call() method does not need a function's name. | |||
==== Methods ==== | |||
{| class="standard-table" style="width: 100%;" | |||
! Function | |||
! Signature | |||
! Description | |||
|- | |- | ||
| <code> | | <code>constructor</code> | ||
| <code> | | <code>CSimpleCallChainer(string ''functionPrefix'', table ''scope'' = null, exactMatch = false)</code> | ||
| | | Creates a CSimpleCallChainer object that'll collect functions that have a matching prefix in the given scope, unless it seek for an exact name match. | ||
|- | |- | ||
| <code> | | <code>CSimpleCallChainer::PostScriptExecute</code> | ||
| <code> | | <code>void CSimpleCallChainer::PostScriptExecute()</code> | ||
| | | Begin searching for all non-native functions with matching prefixes, then push them into the chain array. | ||
|- | |- | ||
| <code> | | <code>CSimpleCallChainer::Call</code> | ||
| <code> | | <code>bool CSimpleCallChainer::Call(any ...)</code> | ||
| | | Call all functions inside the chain array with the given arguments. | ||
|} | |||
==== Members ==== | |||
{| class="standard-table" style="width: 100%;" | |||
! Instance | |||
! Type | |||
! Description | |||
|- | |- | ||
| <code> | | <code>chain</code> | ||
| <code> | | <code>array</code> | ||
| | | All functions to be called by the Call() method. | ||
|- | |- | ||
| <code> | | <code>exactMatch</code> | ||
| <code> | | <code>bool</code> | ||
| | | If set, names of non-native functions and prefix must be an exact match. Set by the constructor. | ||
|- | |- | ||
| <code> | | <code>prefix</code> | ||
| <code> | | <code>string</code> | ||
| | | Prefix that functions should have to be added into the chain array. Set by the constructor. | ||
|- | |- | ||
| <code> | | <code>scope</code> | ||
| <code> | | <code>table</code> | ||
| | | If set, seek functions in this scope instead. Set by the constructor. | ||
|} | |} | ||
== See also == | == See also == | ||
* [[ | * [[VScript]] | ||
* [[ | * [[VScript Fundamentals]] | ||
* {{ | * {{sq}} [[Squirrel]] | ||
Latest revision as of 07:58, 19 November 2025
Automatically generated Squirrel functions list for
Nuclear Dawn.
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) |
GetConVarFloat
|
float GetConVarFloat(string)
|
Retrieves a ConVar's value as a float |
GetConVarInt
|
int GetConVarInt(string)
|
Retrieves a ConVar's value as an integer |
GetConVarString
|
string GetConVarString(string)
|
Retrieves a ConVar's value as a string |
GetMapName
|
string GetMapName()
|
Get the name of the map. |
GetTeam
|
handle GetTeam(int)
|
Returns a team's handle. |
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 |
SetConVarFloat
|
void SetConVarFloat(string, float)
|
Sets a ConVar's value from a float |
SetConVarInt
|
void SetConVarInt(string, int)
|
Sets a ConVar's value from an integer |
SetConVarString
|
void SetConVarString(string, string)
|
Sets a ConVar's value from a string |
ShowMessage
|
void ShowMessage(string)
|
Print a hud message on all clients |
Time
|
float Time()
|
Get the current server time |
CBaseEntity
Methods
| Function | Signature | Description |
|---|---|---|
CBaseEntity::__KeyValueFromInt
|
void CBaseEntity::__KeyValueFromInt(string, int)
|
Sets int value for key name on the entity. |
CBaseEntity::__KeyValueFromString
|
void CBaseEntity::__KeyValueFromString(string, string)
|
Sets string value for key name on the entity. |
CBaseEntity::__KeyValueFromVector
|
void CBaseEntity::__KeyValueFromVector(string, vector)
|
Sets vector value for key name on the entity. |
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::GetLifeState
|
int CBaseEntity::GetLifeState()
|
|
CBaseEntity::GetMaxHealth
|
int CBaseEntity::GetMaxHealth()
|
|
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::GetTeam
|
handle CBaseEntity::GetTeam()
|
|
CBaseEntity::GetTeamNumber
|
int CBaseEntity::GetTeamNumber()
|
|
CBaseEntity::GetVelocity
|
Vector CBaseEntity::GetVelocity()
|
|
CBaseEntity::NextMovePeer
|
handle CBaseEntity::NextMovePeer()
|
|
CBaseEntity::SetAbsOrigin
|
void CBaseEntity::SetAbsOrigin(Vector)
|
SetAbsOrigin |
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 |
CBaseAnimating
Extends CBaseEntity.
There is no new methods for this class
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 |
CNDPlayer
Extends CBaseEntity.
Methods
| Function | Signature | Description |
|---|---|---|
CNDPlayer::IsCommander
|
bool CNDPlayer::IsCommander()
|
Get whether or not the player is the commander for their team. |
CNDPlayer::IsCommanding
|
bool CNDPlayer::IsCommanding()
|
Get whether or not the player is currently in RTS mode. |
CNDPlayer::GetSquad
|
handle CNDPlayer::GetSquad()
|
Returns handle to the player's squad. |
CNDPlayer::GetSquadNumber
|
int CNDPlayer::GetSquadNumber()
|
Returns squad index of the player (0 - Alpha, 1 - Bravo, 2 - Charlie, 3 - Delta). |
CNDPlayer::GetClass
|
int CNDPlayer::GetClass()
|
Returns class index of the player. |
CNDPlayer::GetKit
|
int CNDPlayer::GetKit()
|
Returns kit index of the player. |
CNDPlayer::GetActiveGizmo
|
int CNDPlayer::GetActiveGizmo()
|
Returns index of the player's currently selected gizmo. |
CNDPlayer::IsGizmoActive
|
bool CNDPlayer::IsGizmoActive(int)
|
Returns whether effect of gizmo is active, either from equipped on player or active gizmo for player's squad. |
CNDPlayer::IsInCondition
|
bool CNDPlayer::IsInCondition(int)
|
Returns whether given condition is currently applied to the player. |
CNDPlayer::GetWeaponByName
|
handle CNDPlayer::GetWeaponByName(string)
|
Returns handle to weapon owned by player of specified classname or null if unowned. |
CNDPlayer::GetAmmoCount
|
int CNDPlayer::GetAmmoCount(int)
|
Returns reserve ammo count of the player of specificed ammo type. |
CNDPlayer::GiveAmmo
|
void CNDPlayer::GiveAmmo(int, int)
|
Gives the player ammo of specified type. |
CNDTeam
Extends CBaseEntity.
Methods
| Function | Signature | Description |
|---|---|---|
CNDTeam::GetTeamName
|
string CNDTeam::GetTeamName()
|
Returns name of the team. |
CNDTeam::GetResources
|
int CNDTeam::GetResources()
|
Returns resource count of the team. |
CNDTeam::SetResources
|
void CNDTeam::SetResources(int)
|
Sets resource count of the team. |
CNDTeam::GetCommander
|
handle CNDTeam::GetCommander()
|
Returns handle to team's commander player. |
CNDTeam::GetSquad
|
handle CNDTeam::GetSquad(int)
|
Returns handle to indexed squad for the team. |
CNDTeam::GetPlayerCount
|
int CNDTeam::GetPlayerCount()
|
Returns the number of players in the team. |
CNDTeam::GetPlayer
|
handle CNDTeam::GetPlayer(int)
|
Returns handle to player at specified index of team players (0-based). |
CNDSquad
Extends CBaseEntity.
Methods
| Function | Signature | Description |
|---|---|---|
CNDSquad::GetActiveGizmo
|
int CNDSquad::GetActiveGizmo
|
Returns the active gizmo for the squad. |
CNDSquad::AddPlayer
|
void CNDSquad::AddPlayer(handle)
|
Adds player to the squad. |
CNDSquad::RemovePlayer
|
void CNDSquad::RemovePlayer(handle)
|
Removes player from the squad. |
CNDSquad::HasPlayer
|
bool CNDSquad::HasPlayer(handle)
|
Returns whether or not the player is in the squad. |
CNDBaseWeapon
Extends CBaseEntity.
Methods
| Function | Signature | Description |
|---|---|---|
CNDBaseWeapon::GetClipAmmoCount
|
int CNDBaseWeapon::GetClipAmmoCount()
|
Returns the current ammo count inside the clip of the weapon. |
CNDBaseWeapon::SetClipAmmoCount
|
void CNDBaseWeapon::SetClipAmmoCount(int)
|
Sets the current ammo count inside the clip of the weapon. |
CNDBaseWeapon::GetAmmoType
|
int CNDBaseWeapon::GetAmmoType()
|
Returns the ammo type used by the weapon. |
CNDBaseWeapon::GetMaxClipAmmoCount
|
int CNDBaseWeapon::GetMaxClipAmmoCount()
|
Returns the maximum amount of ammo that the clip of the weapon can hold. |
CNDBaseWeapon::GetDefaultClipAmmoCount
|
int CNDBaseWeapon::GetDefaultClipAmmoCount()
|
Returns the default amount of ammo that the clip of the weapon holds. |
CEnvEntityMaker
Extends CBaseEntity.
Script handle class for env_entity_maker.
Methods
| Function | Signature | Description |
|---|---|---|
CEnvEntityMaker::SpawnEntity
|
void CEnvEntityMaker::SpawnEntity()
|
Create an entity at the location of the maker. |
CEnvEntityMaker::SpawnEntityAtEntityOrigin
|
void CEnvEntityMaker::SpawnEntityAtEntityOrigin(CBaseEntity entity)
|
Create an entity at the location of a specified entity instance. |
CEnvEntityMaker::SpawnEntityAtLocation
|
void CEnvEntityMaker::SpawnEntityAtLocation(Vector origin, QAngle orientation)
|
Create an entity at a specified location and orientation. |
CEnvEntityMaker::SpawnEntityAtNamedEntityOrigin
|
void CEnvEntityMaker::SpawnEntityAtNamedEntityOrigin(string name)
|
Create an entity at the location of a named entity. |
CCallChainer
CCallChainer objects collect all functions with a matching prefix in a given scope, then inserts it all into the chains table with the prefix removed. All collected unprefixed functions can then be called in a chain using the class's Call() method, given the method's event argument matches the functions' name.
Whenever a CCallChainer object is created, a function named Dispatch followed by its given prefix will also be created, which the class binds the environment of its Call() method to.
Methods
| Function | Signature | Description |
|---|---|---|
constructor
|
CCallChainer(string functionPrefix, table scope = null)
|
Creates a CCallChainer object that'll collect functions that have a matching prefix in the given scope. |
CCallChainer::PostScriptExecute
|
void CCallChainer::PostScriptExecute()
|
Search for all non-native functions with matching prefixes, then push them into the chains table. |
CCallChainer::Call
|
bool CCallChainer::Call(string event, any ...)
|
Find an unprefixed function name in the chains table and call it with the given arguments. |
Members
| Instance | Type | Description |
|---|---|---|
chains
|
table
|
Contains names of unprefixed functions, each with an array of functions to call. |
prefix
|
string
|
Prefix that functions should have to be added into the chains table. Set by the constructor. |
scope
|
table
|
If set, seek functions in this scope instead. Set by the constructor. |
CSimpleCallChainer
Intended to be simpler to use than CCallChainer, the class CSimpleCallChainer holds only a single chain of functions inside an array instead of multiple inside a table. As such, its Call() method does not need a function's name.
Methods
| Function | Signature | Description |
|---|---|---|
constructor
|
CSimpleCallChainer(string functionPrefix, table scope = null, exactMatch = false)
|
Creates a CSimpleCallChainer object that'll collect functions that have a matching prefix in the given scope, unless it seek for an exact name match. |
CSimpleCallChainer::PostScriptExecute
|
void CSimpleCallChainer::PostScriptExecute()
|
Begin searching for all non-native functions with matching prefixes, then push them into the chain array. |
CSimpleCallChainer::Call
|
bool CSimpleCallChainer::Call(any ...)
|
Call all functions inside the chain array with the given arguments. |
Members
| Instance | Type | Description |
|---|---|---|
chain
|
array
|
All functions to be called by the Call() method. |
exactMatch
|
bool
|
If set, names of non-native functions and prefix must be an exact match. Set by the constructor. |
prefix
|
string
|
Prefix that functions should have to be added into the chain array. Set by the constructor. |
scope
|
table
|
If set, seek functions in this scope instead. Set by the constructor. |