Skip to content

Getting Entities

There are a multitude of selectors to get specific kinds of entities.

Creating entities is documented here.

Players

array GetPlayerArray()

Get array of all players

array GetPlayerArrayEx( string classname, int onSameTeamAsNum, int enemiesOfTeamNum, vector origin, float maxdist )

Get array of all players by class, team within dist. team -1 for any team, "any" for any class, otherwise "titan" or "pilot", -1 for any dist

array GetPlayerArrayOfTeam( int team )

Get array of all players that are in a team

array GetPlayerArrayOfEnemies( int team )

Get array of all players that are not allied with the team

array GetPlayerArray_Alive()

Get array of all players that are alive

array GetPlayerArrayOfTeam_Alive( int team )

Get array of all players in a team that are alive

array GetPlayerArrayOfEnemies_Alive( int team )

array GetPlayerArray_Pilots()

Get array of all players that are not titans

array GetPlayerArrayOfTeam_Pilots( int team )

array GetPlayerArrayOfEnemies_Pilots( int team )

array GetPlayerArray_AlivePilots()

array GetPlayerArrayOfTeam_AlivePilots( int team )

array GetPlayerArrayOfEnemies_AlivePilots( int team )

array GetPlayerDecoryArray()

Connecting Players

array GetConnectingAndConnectedPlayerArray()

Get array of all players, even ones who are connecting

int GetPendingClientsCount()

Titans

Get all players in a titan and souls.

array GetTitanArray()

array GetTitanArrayOfTeam( int team )

array GetTitanArrayOfEnemies( int team )

array GetTitanSoulArray()

int GetTitanCountForTeam( int team )

int GetTeamPlayerCount( int team )

NPCs & Props

int GetSurfacePropForEntity( entity ent )

entity GetEntByIndex( int index )

array GetNPCArray()

array GetNPCArrayOfTeam( int team )

array GetNPCArrayOfEnemies( int team )

array GetNPCArrayEx( string classname, int onSameTeamAsNum, int enemiesOfTeamNum, vector origin, float maxdist )

Get array of all NPCs by class, team, within dist. team -1 for any team, "any" for any class, otherwise "titan" or "pilot", -1 for any dist

GetNPCArrayWithSubclassEx( string classname, int onSameTeamAsNum, int enemiesOfTeamNum, vector origin, float maxdist, array subclasses )

Get array of all NPCs by class, team, and subclass (array), within dist. team -1 for any team, "'any" for any class, -1 for any dist

array GetNPCArrayByClass( string classname )

Get array of all NPCs of class

array ScriptGetNPCArrayByClassAndSubclass( string classname, array subclasses )

Get array of all NPCs of class and subclass

Projectiles

array GetProjectileArray()

array GetProjectileArrayEx( string classname, int onSameTeamAsNum, int enemiesOfTeamNum, vector origin, float maxdist )

Get array of all NPCs by class, team, within dist. team -1 for any team, "any" for any class, otherwise "titan" or "pilot", -1 for any dist

Find Entities

entity Entities_First()

entity Entities_Next( entity ent )

entity Entities_FindByClassname( entity ent, string className )

entity Entities_FindByName( entity ent, string name )

entity Entities_FindInSphere( entity ent, vector sphereDir, float radius )

entity Entities_FindByTarget( entity ent, string target )

entity Entities_FindByNameNearest( string name, vector dir, float length )

entity Entities_FindByNameWithin( entity ent, string name, vector v, float len )

entity Entities_FindByClassnameNearest( string className, vector v, float f )

entity Entities_FindByClassnameWithin( entity ent, string className, vector v, float f )

entity GetEntByScriptName( string name )

entity GetEntByScriptNameInInstance( string name, string instanceName )

entity GetTeamEnt( int team )

Get Multiple Entites

array GetEntArrayByName_Expensive( string name )

Get array of entitites matching a name

array GetEntArrayByNameWildCard_Expensive( string name )

Get array of entities matching a name with support for *

array GetEntArrayByClass_Expensive( string className )

Get array of entities matching a class

array GetEntArrayByClassWildCard_Expensive( string classname )

Get array of entities matching a class with support for *

array GetEntArrayByScriptName( string name )

Get array of entities matching a script name

array GetEntArrayByScriptNameInInstance( string scriptName, string instanceName )

Get array of entities matching a script name and instance

array GetWeaponArray( bool onlyNotOwned )

Get weapons in the world