switchableUnits: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<!-- Note Section [A-Z]+ --> " to "")
(page overhaul)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma1
|game1= arma1


|1.00
|version1= 1.00
 
|game2= arma2
 
|version2= 1.00
 
|game3= arma2oa
 
|version3= 1.51
 
|game4= tkoh
 
|version4= 1.00
 
|game5= arma3
 
|version5= 0.50


|eff= local
|eff= local
Line 13: Line 29:
|gr3= Object Detection
|gr3= Object Detection


| Returns a list of playable units available for switching to.
|descr= 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,
* 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.<br>
* 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.<br><br>
* Dead and player-controlled units are automatically removed from the resulting array
{{Feature | 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
In order to get all ''playable'' units regardless of their [[side]], see the [[playableUnits]] command.


| [[switchableUnits]]
|mp= 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. On dedicated servers, this command returns an empty array,.


| [[Array]]
|s1= [[switchableUnits]]


|x1= _availableUnits = [[switchableUnits]];
|r1= [[Array]]


|seealso= [[allPlayers]], [[units]], [[allCurators]], [[allGroups]], [[allDead]], [[playableUnits]], [[vehicles]], [[allUnitsUAV]], [[allDeadMen]], [[teamSwitch]], [[Team_Switch]]
|x1= <code>_availableUnits = [[switchableUnits]];</code>
 
|seealso= [[Team Switch]] [[playableUnits]] [[allPlayers]] [[teamSwitch]]
}}
}}
<dl class="command_description">
<dd class="notedate">Posted on July 06, 2011 - 13:32</dd>
<dt class="note">[[User:Messiah2|Messiah2]]</dt>
<dd class="note">On dedicated server this command returns empty array.
</dl>
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}

Revision as of 12:21, 13 May 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
  • 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 order to get all playable units regardless of their side, see the playableUnits command
Multiplayer:
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. On dedicated servers, this command returns an empty array,.
Groups:
MultiplayerTeam SwitchObject Detection

Syntax

Syntax:
switchableUnits
Return Value:
Array

Examples

Example 1:
_availableUnits = switchableUnits;

Additional Information

See also:
Team Switch playableUnits allPlayers teamSwitch

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