switchableUnits: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Take[ _]On[ _]Helicopters(\|.*)?\]\]" to "{{GameCategory|tkoh|Scripting Commands}}")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Command|Comments=
{{Command|Comments=
____________________________________________________________________________________________


| arma1 |Game name=
| arma1 |Game name=
Line 13: Line 12:


|gr3= Object Detection |GROUP3=
|gr3= Object Detection |GROUP3=
____________________________________________________________________________________________


| Returns a list of playable units available for switching to.
| Returns a list of playable units available for switching to.
Line 21: Line 19:
{{Informative | In Multiplayer, [[switchableUnits]] are only available when [[description.ext#respawn|respawn]] type is set to SIDE or GROUP, the mission contains units marked playable and [[player]] is able to switch to any of those units. }}<br>
{{Informative | In Multiplayer, [[switchableUnits]] are only available when [[description.ext#respawn|respawn]] type is set to SIDE or GROUP, the mission contains units marked playable and [[player]] is able to switch to any of those units. }}<br>
In order to get all ''playable'' units regardless of their [[side]], see the [[playableUnits]] command. |DESCRIPTION=
In order to get all ''playable'' units regardless of their [[side]], see the [[playableUnits]] command. |DESCRIPTION=
____________________________________________________________________________________________


| [[switchableUnits]] |SYNTAX=
| [[switchableUnits]] |SYNTAX=
Line 28: Line 25:


|x1= _availableUnits = [[switchableUnits]]; |Example 1=
|x1= _availableUnits = [[switchableUnits]]; |Example 1=
____________________________________________________________________________________________


|  [[allPlayers]], [[units]], [[allCurators]], [[allGroups]], [[allDead]], [[playableUnits]], [[vehicles]], [[allUnitsUAV]], [[allDeadMen]], [[teamSwitch]], [[Team_Switch]] |SEEALSO=  
|  [[allPlayers]], [[units]], [[allCurators]], [[allGroups]], [[allDead]], [[playableUnits]], [[vehicles]], [[allUnitsUAV]], [[allDeadMen]], [[teamSwitch]], [[Team_Switch]] |SEEALSO=  

Revision as of 05:00, 17 January 2021

Hover & click on the images for description

Description

Description:
Returns a list of playable units available for switching to. Command is relative to the client on which it is executed and will only show playable units for the same side as player's group + player himself, unless in singleplayer where playable units from all sides will be accessible via this command.
Dead and player-controlled units are automatically removed from the resulting array.

In Multiplayer, switchableUnits are only available when respawn type is set to SIDE or GROUP, the mission contains units marked playable and player is able to switch to any of those units.

In order to get all playable units regardless of their side, see the playableUnits command.
Groups:
MultiplayerTeam SwitchObject Detection

Syntax

Syntax:
switchableUnits
Return Value:
Array

Examples

Example 1:
_availableUnits = switchableUnits;

Additional Information

See also:
allPlayersunitsallCuratorsallGroupsallDeadplayableUnitsvehiclesallUnitsUAVallDeadMenteamSwitchTeam_Switch

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 July 06, 2011 - 13:32
Messiah2
On dedicated server this command returns empty array.

Bottom Section