agents: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Take[ _]On[ _]Helicopters(\|.*)?]]" to "{{GameCategory|tkoh|Scripting Commands}}") |
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
||
Line 1: | Line 1: | ||
<br> | <br> | ||
{{Command|Comments= | {{Command|Comments= | ||
| arma2 |Game name= | | arma2 |Game name= | ||
Line 10: | Line 9: | ||
|gr2= Object Detection |GROUP2= | |gr2= Object Detection |GROUP2= | ||
| Return a list of agents in the current mission. |DESCRIPTION= | | Return a list of agents in the current mission. |DESCRIPTION= | ||
| '''agents''' |SYNTAX= | | '''agents''' |SYNTAX= | ||
Line 28: | Line 25: | ||
|x1= <code>{[[agent]] _x [[moveTo]] [[position]] [[player]]} [[forEach]] '''agents''';</code>|EXAMPLE1= | |x1= <code>{[[agent]] _x [[moveTo]] [[position]] [[player]]} [[forEach]] '''agents''';</code>|EXAMPLE1= | ||
| [[agent]], [[createAgent]], [[isAgent]], [[forEachMemberAgent]], [[entities]], [[allCurators]], [[allGroups]], [[allDead]], [[playableUnits]], [[switchableUnits]], [[vehicles]], [[allUnitsUAV]], [[allDeadMen]] |SEEALSO= | | [[agent]], [[createAgent]], [[isAgent]], [[forEachMemberAgent]], [[entities]], [[allCurators]], [[allGroups]], [[allDead]], [[playableUnits]], [[switchableUnits]], [[vehicles]], [[allUnitsUAV]], [[allDeadMen]] |SEEALSO= | ||
| |MPBEHAVIOUR= | | |MPBEHAVIOUR= | ||
}} | }} | ||
Revision as of 00:02, 17 January 2021
Description
- Description:
- Return a list of agents in the current mission.
- Groups:
- TeamsObject Detection
Syntax
- Syntax:
- agents
- Return Value:
- Array of Team Members
Examples
Additional Information
- See also:
- agentcreateAgentisAgentforEachMemberAgententitiesallCuratorsallGroupsallDeadplayableUnitsswitchableUnitsvehiclesallUnitsUAVallDeadMen
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Notes
- Posted on April 4, 2012 - 10:48 (GMT)
- Rocket
- Note that agents returns a reference to the agent itself, not the object. For example: {alive _x} count agents; would return an error. But you can assign the agent a reference using setVariable, and then reference it, for example: {alive (_x getVariable ["agentObject",objNull]) count agents; would return the number of agents still alive - BUT you would need to define "agentObject" after you create the agent, for example: _agent = createAgent [_type, _position, [], _radius, "NONE"];_agent setVariable["agentObject",_agent,true];
- Posted on August 1, 2013 - 21:55 (GMT)
- Killzone_Kid
- Alternatively, to get object from agent reference use agent command.
- Posted on May 26, 2020 - 14:10 (GMT)
- PierreMGI
- In debug console, pointing at an agent:
cursorObject // seems to refer to an agent (ex.: Agent 0xcbce41c0), but it is an object teamMember cursorObject // returns the same value Agent 0xcbce41c0, but now it is the agent cursorObject in Agents // so, will return false (even if you can read the value Agent 0xcbce41c0 in the agents array) teamMember cursorObject in Agents // returns true. TeamMember allows to refer to the agent under the cursorObject agent teamMember cursorObject isEqualTo cursorObject // True, same object.