entities: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "|PARAMETER2=1" to "|PARAMETER21=") |
Lou Montana (talk | contribs) |
||
Line 7: | Line 7: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Returns a list of all alive and dead entities of the given type or deriving from the given type. Units in vehicles are ignored. When empty string "" is passed for the type, all entity types are returned. | | Returns a list of all alive and dead entities of the given type or deriving from the given type. Units in vehicles are ignored. When empty string "" is passed for the type, all entity types are returned.<br><br> | ||
<br><br>Alternative syntax introduced in Arma 3 v1.65.138685 allows to filter entities by type and alive status as well as to return entities currently in vehicles.<br><br>'''Optimisation tip''': Keep number of types in both ''includeTypes'' and ''excludeTypes'' arrays to a minimum by possibly using parent/base classes. If you have to use several types, arrange them in order so that the more common types go at the beginning of the array. |DESCRIPTION= | Alternative syntax introduced in Arma 3 v1.65.138685 allows to filter entities by type and alive status as well as to return entities currently in vehicles.<br><br>'''Optimisation tip''': Keep number of types in both ''includeTypes'' and ''excludeTypes'' arrays to a minimum by possibly using parent/base classes. If you have to use several types, arrange them in order so that the more common types go at the beginning of the array. |DESCRIPTION= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | [[entities]] type |SYNTAX= | ||
|p1= type: [[String]] |PARAMETER1= | |p1= type: [[String]] |PARAMETER1= | ||
Line 17: | Line 17: | ||
| [[Array]] |RETURNVALUE= | | [[Array]] |RETURNVALUE= | ||
| s2= | |s2= [[entities]] [typesInclude, typesExclude, includeCrews, excludeDead] ''since Arma 3 v1.65.138685'' |SYNTAX2= | ||
|p21= [typesInclude, typesExclude, includeCrews, excludeDead]: [[Array]] |PARAMETER21= | |p21= [typesInclude, typesExclude, includeCrews, excludeDead]: [[Array]] |PARAMETER21= | ||
|p22= typesInclude: [[Array]] - in format [type1, type2, ...typeN], where type is a [[String]]. Empty array [] means include every entity. Method used for filtering - [[isKindOf]]| | |p22= typesInclude: [[Array]] - in format [type1, type2, ...typeN], where type is a [[String]]. Empty array [] means include every entity. Method used for filtering - [[isKindOf]]|PARAMETER22= | ||
|p23= typesExclude: [[Array]] - in format [type1, type2, ...typeN], where type is a [[String]]. Empty array [] means exclude no entity. Method used for filtering - [[isKindOf]]| | |p23= typesExclude: [[Array]] - in format [type1, type2, ...typeN], where type is a [[String]]. Empty array [] means exclude no entity. Method used for filtering - [[isKindOf]]|PARAMETER23= | ||
|p24= includeCrews (Optional): [[Boolean]] - include crews currently in vehicles. Default: [[false]] | | |p24= includeCrews (Optional): [[Boolean]] - include crews currently in vehicles. Default: [[false]] |PARAMETER24= | ||
|p25= excludeDead (Optional): [[Boolean]] - exclude dead entities. Default: [[false]] | | |p25= excludeDead (Optional): [[Boolean]] - exclude dead entities. Default: [[false]] |PARAMETER25= | ||
| r2= [[Array]] |RETURNVALUE= | | r2= [[Array]] |RETURNVALUE= | ||
Line 31: | Line 31: | ||
|x3= Return dead and alive entities but logic:<code>_notlogic = [[entities]] <nowiki>[</nowiki>[], ["Logic"], [[true]]];</code>|EXAMPLE3= | |x3= Return dead and alive entities but logic:<code>_notlogic = [[entities]] <nowiki>[</nowiki>[], ["Logic"], [[true]]];</code>|EXAMPLE3= | ||
|x4= Return all alive [[west]] soldiers on foot:<code>_footsoldiers = [[entities]] <nowiki>[</nowiki>["SoldierWB"], [], [[false]], [[true]]];</code>|EXAMPLE4= | |x4= Return all alive [[west]] soldiers on foot:<code>_footsoldiers = [[entities]] <nowiki>[</nowiki>["SoldierWB"], [], [[false]], [[true]]];</code>|EXAMPLE4= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[nearEntities]], [[allUnits]], [[vehicles]], [[agents]], [[allMissionObjects]] |SEEALSO= | | [[nearEntities]], [[allUnits]], [[vehicles]], [[agents]], [[allMissionObjects]] |SEEALSO= | ||
}} | }} | ||
Line 43: | Line 39: | ||
<dl class='command_description'> | <dl class='command_description'> | ||
<!-- Note Section BEGIN --> | <!-- Note Section BEGIN --> | ||
<!-- Note Section END --> | <!-- Note Section END --> | ||
</dl> | </dl> | ||
Line 50: | Line 45: | ||
<h3 style='display:none'>Bottom Section</h3> | <h3 style='display:none'>Bottom Section</h3> | ||
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] | ||
Revision as of 20:07, 1 October 2019
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. When empty string "" is passed for the type, all entity types are returned.
Alternative syntax introduced in Arma 3 v1.65.138685 allows to filter entities by type and alive status as well as to return entities currently in vehicles.
Optimisation tip: Keep number of types in both includeTypes and excludeTypes arrays to a minimum by possibly using parent/base classes. If you have to use several types, arrange them in order so that the more common types go at the beginning of the array. - Groups:
- Uncategorised
Syntax
Alternative Syntax
- Syntax:
- entities [typesInclude, typesExclude, includeCrews, excludeDead] since Arma 3 v1.65.138685
- Parameters:
- [typesInclude, typesExclude, includeCrews, excludeDead]: Array
- 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 (Optional): Boolean - include crews currently in vehicles. Default: false
- excludeDead (Optional): Boolean - exclude dead entities. Default: false
- 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