Getting Entities

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

Creating entities is documented here.

Players

array<entity> GetPlayerArray()

Get array of all players

array<entity> 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<entity> GetPlayerArrayOfTeam(int team)

Get array of all players that are in a team

array<entity> GetPlayerArrayOfEnemies(int team)

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

array<entity> GetPlayerArray_Alive()

Get array of all players that are alive

array<entity> GetPlayerArrayOfTeam_Alive(int team)

Get array of all players in a team that are alive

array<entity> GetPlayerArrayOfEnemies_Alive(int team)
array<entity> GetPlayerArray_Pilots()

Get array of all players that are not titans

array<entity> GetPlayerArrayOfTeam_Pilots(int team)
array<entity> GetPlayerArrayOfEnemies_Pilots(int team)
array<entity> GetPlayerArray_AlivePilots()
array<entity> GetPlayerArrayOfTeam_AlivePilots(int team)
array<entity> GetPlayerArrayOfEnemies_AlivePilots(int team)
array<entity> GetPlayerDecoryArray()

Connecting Players

array<entity> GetConnectingAndConnectedPlayerArray()

Get array of all players, even ones who are connecting

int GetPendingClientsCount()

Titans

Get all players in a titan and souls.

array<entity> GetTitanArray()
array<entity> GetTitanArrayOfTeam(int team)
array<entity> GetTitanArrayOfEnemies(int team)
array<enitity> GetTitanSoulArray()
int GetTitanCountForTeam(int team)
int GetTeamPlayerCount(int team)

NPCs & Props

int GetSurfacePropForEntity(entity ent)
entity GetEntByIndex(int index)
array<entity> GetNPCArray()
array<entity> GetNPCArrayOfTeam(int team)
array<entity> GetNPCArrayOfEnemies(int team)
array<entity> 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<int> 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<entity> GetNPCArrayByClass(string classname)

Get array of all NPCs of class

array<entity> ScriptGetNPCArrayByClassAndSubclass(string classname, array<int> subclasses)

Get array of all NPCs of class and subclass

Projectiles

array<entity> GetProjectileArray()
array<entity> 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<entity> GetEntArrayByName_Expensive(string name)

Get array of entitites matching a name

array<entity> GetEntArrayByNameWildCard_Expensive(string name)

Get array of entities matching a name with support for *

array<entity> GetEntArrayByClass_Expensive(string className)

Get array of entities matching a class

array<entity> GetEntArrayByClassWildCard_Expensive(string classname)

Get array of entities matching a class with support for *

array<entity> GetEntArrayByScriptName(string name)

Get array of entities matching a script name

array<entity> GetEntArrayByScriptNameInInstance(string scriptName, string instanceName)

Get array of entities matching a script name and instance

array<entity> GetWeaponArray(bool onlyNotOwned)

Get weapons in the world