CAIAgentManager:GetAIAgentsOfGroupFromLUA v2

From Nomad DB

Retrieves the entity IDs of AI agents from the specified agent type.

Syntax

CAIAgentManager_GetInstance():GetAIAgentsOfGroupFromLUA_v2(agentType, affiliation, group, health, hostility)
  • agentType (string): Target AI agent type
  • affiliation (number): Target AI agent affiliation
  • group (string): currently unknown, usually empty string
  • health (number): Target AI agent health state
  • hostility (number): Target AI agent hostility type
  • Returns (table): Table containing entity IDs

Example

Retrieves AI agent entities that are part of the SFPD and are hostile towards the player.

local agentsList = CAIAgentManager_GetInstance():GetAIAgentsOfGroupFromLUA_v2("Human", 1, "", 1, 1)
local str = table.concat(agentsList, ", ")
print(str) -- returns a string containing the entity IDs of the specified agents

Parameters

Type

Name
All
Human
...

Health

ID State
0 Alive
1 Any
...

Hostility

ID State
0 Any
1 Enemy
2 Not Enemy
...

Related Pages