allUnits: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(updated)
 
m (Text replacement - " (\|[pr][0-9]+ *= *[^-]+) *- *A([a-z])" to " $1 - a$2")
 
(77 intermediate revisions by 15 users not shown)
Line 1: Line 1:
{{RV|type=command


[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
|game1= arma2
|version1= 1.00
 
|game2= arma2oa
|version2= 1.50
 
|game3= tkoh
|version3= 1.00
 
|game4= arma3
|version4= 0.50
 
|gr1= Object Detection
 
|descr= Returns a list of all units, '''except agents, dead units or units waiting for respawn''', outside and inside vehicles that were created on the following sides [[east]], [[west]], [[independent]] and [[civilian]].
{{Feature|arma3|To get all units of given side, use {{hl|[[units]] [[Side]]}}.}}
 
|s1= [[allUnits]]
 
|r1= [[Array]] - array of [[Object|object]]s
 
|x1= <sqf>{ _x setDamage 0.5; _x groupChat "Braaains"; } forEach allUnits;</sqf>
 
|x2= <sqf>allUnits apply { diag_log _x; };</sqf>
 
|seealso= [[allGroups]] [[groups]] [[units]] [[vehicles]] [[entities]] [[agents]] [[playableUnits]] [[switchableUnits]] [[allPlayers]] [[allDead]] [[allDeadMen]] [[allUnitsUAV]] [[allCurators]] [[allObjects]] [[allMissionObjects]] [[allSimpleObjects]] [[allMines]]
}}
 
{{Note
|user= Pierre MGI
|timestamp= 20180906164300
|text= It returns also BIS_SUPP_HQ created by support modules and headquarters Entity from HQ modules.
}}

Latest revision as of 12:39, 8 November 2023

Hover & click on the images for description

Description

Description:
Returns a list of all units, except agents, dead units or units waiting for respawn, outside and inside vehicles that were created on the following sides east, west, independent and civilian.
Arma 3
To get all units of given side, use units Side.
Groups:
Object Detection

Syntax

Syntax:
allUnits
Return Value:
Array - array of objects

Examples

Example 1:
{ _x setDamage 0.5; _x groupChat "Braaains"; } forEach allUnits;
Example 2:
allUnits apply { diag_log _x; };

Additional Information

See also:
allGroups groups units vehicles entities agents playableUnits switchableUnits allPlayers allDead allDeadMen allUnitsUAV allCurators allObjects allMissionObjects allSimpleObjects allMines

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
Pierre MGI - c
Posted on Sep 06, 2018 - 16:43 (UTC)
It returns also BIS_SUPP_HQ created by support modules and headquarters Entity from HQ modules.