Nuclear Dawn/Scripting/Script Functions: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Mv moved page List of ND Script Functions to Nuclear Dawn/Scripting/Script Functions: I may want to make an examples page so)
(Add CEnvEntityMaker)
Line 236: Line 236:
|}
|}
=== CNDPlayer ===
=== CNDPlayer ===
Extends <code>CBaseEntity</code>.
==== Methods ====
==== Methods ====
{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
Line 292: Line 293:


=== CNDTeam ===
=== CNDTeam ===
Extends <code>CBaseEntity</code>.
==== Methods ====
==== Methods ====
{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
Line 328: Line 330:


=== CNDSquad ===
=== CNDSquad ===
Extends <code>CBaseEntity</code>.
==== Methods ====
==== Methods ====
{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
Line 352: Line 355:


=== CNDBaseWeapon ===
=== CNDBaseWeapon ===
Extends <code>CBaseEntity</code>.
==== Methods ====
==== Methods ====
{| class="standard-table" style="width: 100%;"
{| class="standard-table" style="width: 100%;"
Line 377: Line 381:
| <code>int CNDBaseWeapon::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.
|}
|}



Revision as of 07:06, 19 November 2025

Automatically generated Squirrel functions list for Nuclear Dawn 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

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.

See also