Nuclear Dawn/Scripting/Script Functions: Difference between revisions
Jump to navigation
Jump to search
(Make the script functions list for Nuclear Dawn be accurate to the game. Previous page before this edit previously noted functions that didn't exist and that the page may contain invalid functions. I don't think that's going to happen any day soon) |
("Previous page before this edit previously noted functions that didn't exist and that the page may contain invalid functions" me when i lie for no reason... ok to be fair i don't know how these functions were added but these did not print on script_help, i just checked if they are working and yes they are) |
||
| Line 234: | Line 234: | ||
| <code>handle CEntities::Next(handle)</code> | | <code>handle CEntities::Next(handle)</code> | ||
| Continue an iteration over the list of entities, providing reference to a previously found entity | | Continue an iteration over the list of entities, providing reference to a previously found entity | ||
|} | |||
=== CNDPlayer === | |||
{| class="standard-table" style="width: 100%;" | |||
! Function | |||
! Signature | |||
! Description | |||
|- | |||
| <code>CNDPlayer::IsCommander</code> | |||
| <code>bool CNDPlayer::IsCommander()</code> | |||
| Get whether or not the player is the commander for their team. | |||
|- | |||
| <code>CNDPlayer::IsCommanding</code> | |||
| <code>bool CNDPlayer::IsCommanding()</code> | |||
| Get whether or not the player is currently in RTS mode. | |||
|- | |||
| <code>CNDPlayer::GetSquad</code> | |||
| <code>handle CNDPlayer::GetSquad()</code> | |||
| Returns handle to the player's squad. | |||
|- | |||
| <code>CNDPlayer::GetSquadNumber</code> | |||
| <code>int CNDPlayer::GetSquadNumber()</code> | |||
| Returns squad index of the player (0 - Alpha, 1 - Bravo, 2 - Charlie, 3 - Delta). | |||
|- | |||
| <code>CNDPlayer::GetClass</code> | |||
| <code>int CNDPlayer::GetClass()</code> | |||
| Returns class index of the player. | |||
|- | |||
| <code>CNDPlayer::GetKit</code> | |||
| <code>int CNDPlayer::GetKit()</code> | |||
| Returns kit index of the player. | |||
|- | |||
| <code>CNDPlayer::GetActiveGizmo</code> | |||
| <code>int CNDPlayer::GetActiveGizmo()</code> | |||
| Returns index of the player's currently selected gizmo. | |||
|- | |||
| <code>CNDPlayer::IsGizmoActive</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. | |||
|- | |||
| <code>CNDPlayer::IsInCondition</code> | |||
| <code>bool CNDPlayer::IsInCondition(int)</code> | |||
| Returns whether given condition is currently applied to the player. | |||
|- | |||
| <code>CNDPlayer::GetWeaponByName</code> | |||
| <code>handle CNDPlayer::GetWeaponByName(string)</code> | |||
| Returns handle to weapon owned by player of specified classname or null if unowned. | |||
|- | |||
| <code>CNDPlayer::GetAmmoCount</code> | |||
| <code>int CNDPlayer::GetAmmoCount(int)</code> | |||
| Returns reserve ammo count of the player of specificed ammo type. | |||
|- | |||
| <code>CNDPlayer::GiveAmmo</code> | |||
| <code>void CNDPlayer::GiveAmmo(int, int)</code> | |||
| Gives the player ammo of specified type. | |||
|} | |||
=== CNDTeam === | |||
{| class="standard-table" style="width: 100%;" | |||
! Function | |||
! Signature | |||
! Description | |||
|- | |||
| <code>CNDTeam::GetTeamName</code> | |||
| <code>string CNDTeam::GetTeamName()</code> | |||
| Returns name of the team. | |||
|- | |||
| <code>CNDTeam::GetResources</code> | |||
| <code>int CNDTeam::GetResources()</code> | |||
| Returns resource count of the team. | |||
|- | |||
| <code>CNDTeam::SetResources</code> | |||
| <code>void CNDTeam::SetResources(int)</code> | |||
| Sets resource count of the team. | |||
|- | |||
| <code>CNDTeam::GetCommander</code> | |||
| <code>handle CNDTeam::GetCommander()</code> | |||
| Returns handle to team's commander player. | |||
|- | |||
| <code>CNDTeam::GetSquad</code> | |||
| <code>handle CNDTeam::GetSquad(int)</code> | |||
| Returns handle to indexed squad for the team. | |||
|- | |||
| <code>CNDTeam::GetPlayerCount</code> | |||
| <code>int CNDTeam::GetPlayerCount()</code> | |||
| Returns the number of players in the team. | |||
|- | |||
| <code>CNDTeam::GetPlayer</code> | |||
| <code>handle CNDTeam::GetPlayer(int)</code> | |||
| Returns handle to player at specified index of team players (0-based). | |||
|} | |||
=== CNDSquad === | |||
{| class="standard-table" style="width: 100%;" | |||
! Function | |||
! Signature | |||
! Description | |||
|- | |||
| <code>CNDSquad::GetActiveGizmo</code> | |||
| <code>int CNDSquad::GetActiveGizmo</code> | |||
| Returns the active gizmo for the squad. | |||
|- | |||
| <code>CNDSquad::AddPlayer</code> | |||
| <code>void CNDSquad::AddPlayer(handle)</code> | |||
| Adds player to the squad. | |||
|- | |||
| <code>CNDSquad::RemovePlayer</code> | |||
| <code>void CNDSquad::RemovePlayer(handle)</code> | |||
| Removes player from the squad. | |||
|- | |||
| <code>CNDSquad::HasPlayer</code> | |||
| <code>bool CNDSquad::HasPlayer(handle)</code> | |||
| Returns whether or not the player is in the squad. | |||
|} | |||
=== CNDBaseWeapon === | |||
{| class="standard-table" style="width: 100%;" | |||
! Function | |||
! Signature | |||
! Description | |||
|- | |||
| <code>CNDBaseWeapon::GetClipAmmoCount</code> | |||
| <code>int CNDBaseWeapon::GetClipAmmoCount()</code> | |||
| Returns the current ammo count inside the clip of the weapon. | |||
|- | |||
| <code>CNDBaseWeapon::SetClipAmmoCount</code> | |||
| <code>void CNDBaseWeapon::SetClipAmmoCount(int)</code> | |||
| Sets the current ammo count inside the clip of the weapon. | |||
|- | |||
| <code>CNDBaseWeapon::GetAmmoType</code> | |||
| <code>int CNDBaseWeapon::GetAmmoType()</code> | |||
| Returns the ammo type used by the weapon. | |||
|- | |||
| <code>CNDBaseWeapon::GetMaxClipAmmoCount</code> | |||
| <code>int CNDBaseWeapon::GetMaxClipAmmoCount()</code> | |||
| Returns the maximum amount of ammo that the clip of the weapon can hold. | |||
|- | |||
| <code>CNDBaseWeapon::GetDefaultClipAmmoCount</code> | |||
| <code>int CNDBaseWeapon::GetDefaultClipAmmoCount()</code> | |||
| Returns the default amount of ammo that the clip of the weapon holds. | |||
|} | |} | ||
Revision as of 06:25, 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::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 |
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
| 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
| 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
| 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
| 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. |