entities: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
| arma2oa | | arma2oa | ||
|1.60 | |1.60 | ||
|gr1= Object Detection | |gr1= Object Detection | ||
| Returns a list of all alive and dead entities of the given type or deriving from the given type. Units in vehicles are ignored with the primary syntax. | | Returns a list of all alive and dead entities of the given type or deriving from the given type. Units in vehicles are ignored with the primary syntax. | ||
{{Informative | '''Optimisation tip''': Keep number of types in both ''includeTypes'' and ''excludeTypes'' arrays to a minimum by possibly using parent/base classes.<br>If you have to use several types, arrange them in order so that the more common types go at the beginning of the array.}} | {{Informative | '''Optimisation tip''': Keep number of types in both ''includeTypes'' and ''excludeTypes'' arrays to a minimum by possibly using parent/base classes.<br>If you have to use several types, arrange them in order so that the more common types go at the beginning of the array.}} | ||
| [[entities]] type | | [[entities]] type | ||
|p1= type: [[String]] - if an empty string <tt>""</tt> is provided, all entities are returned | |p1= type: [[String]] - if an empty string <tt>""</tt> is provided, all entities are returned | ||
| [[Array]] | | [[Array]] | ||
|s2= [[entities]] [typesInclude, typesExclude, includeCrews, excludeDead] {{Since|arma3|1.65.138685|y}} | |s2= [[entities]] [typesInclude, typesExclude, includeCrews, excludeDead] {{Since|arma3|1.65.138685|y}} | ||
|p21= typesInclude: [[Array]] - in format [type1, type2, ...typeN], where type is a [[String]]. Empty array [] means include every entity. Method used for filtering - [[isKindOf]] |PARAMETER21= | |p21= typesInclude: [[Array]] - in format [type1, type2, ...typeN], where type is a [[String]]. Empty array [] means include every entity. Method used for filtering - [[isKindOf]] |PARAMETER21= | ||
Line 26: | Line 26: | ||
|p24= excludeDead: [[Boolean]] - (Optional, default [[false]]) exclude dead entities |PARAMETER24= | |p24= excludeDead: [[Boolean]] - (Optional, default [[false]]) exclude dead entities |PARAMETER24= | ||
|r2= [[Array]] | |r2= [[Array]] | ||
|x1= <code>_allcars = [[entities]] "Car";</code> | |x1= <code>_allcars = [[entities]] "Car";</code> | ||
|x2= Return all alive entities on the map:<code>_allalive = [[entities]] [<nowiki/>[], [], [[true]], [[true]]];</code> | |x2= Return all alive entities on the map:<code>_allalive = [[entities]] [<nowiki/>[], [], [[true]], [[true]]];</code> | ||
|x3= Return dead and alive entities but logic:<code>_notlogic = [[entities]] [<nowiki/>[], ["Logic"], [[true]]];</code> | |x3= Return dead and alive entities but logic:<code>_notlogic = [[entities]] [<nowiki/>[], ["Logic"], [[true]]];</code> | ||
|x4= Return all alive [[west]] soldiers on foot:<code>_footsoldiers = [[entities]] [<nowiki/>["SoldierWB"], [], [[false]], [[true]]];</code> | |x4= Return all alive [[west]] soldiers on foot:<code>_footsoldiers = [[entities]] [<nowiki/>["SoldierWB"], [], [[false]], [[true]]];</code> | ||
| [[nearEntities]], [[allUnits]], [[vehicles]], [[agents]], [[allMissionObjects]] | | [[nearEntities]], [[allUnits]], [[vehicles]], [[agents]], [[allMissionObjects]] | ||
}} | }} | ||
Revision as of 00:35, 18 January 2021
Description
- Description:
- Returns a list of all alive and dead entities of the given type or deriving from the given type. Units in vehicles are ignored with the primary syntax.
- Groups:
- Object Detection
Syntax
- Syntax:
- entities type
- Parameters:
- type: String - if an empty string "" is provided, all entities are returned
- Return Value:
- Array
Alternative Syntax
- Syntax:
- entities [typesInclude, typesExclude, includeCrews, excludeDead] Template:Since
- Parameters:
- typesInclude: Array - in format [type1, type2, ...typeN], where type is a String. Empty array [] means include every entity. Method used for filtering - isKindOf
- typesExclude: Array - in format [type1, type2, ...typeN], where type is a String. Empty array [] means exclude no entity. Method used for filtering - isKindOf
- includeCrews: Boolean - (Optional, default false) include crews currently in vehicles
- excludeDead: Boolean - (Optional, default false) exclude dead entities
- Return Value:
- Array
Examples
- Example 1:
_allcars = entities "Car";
- Example 2:
- Return all alive entities on the map:
_allalive = entities [[], [], true, true];
- Example 3:
- Return dead and alive entities but logic:
_notlogic = entities [[], ["Logic"], true];
- Example 4:
- Return all alive west soldiers on foot:
_footsoldiers = entities [["SoldierWB"], [], false, true];
Additional Information
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