groupSelectUnit: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(populated)
m (Some wiki formatting)
 
(64 intermediate revisions by 12 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma2 |= Game name
|game1= arma2
|version1= 1.00


|1.00|= Game version
|game2= arma2oa
____________________________________________________________________________________________
|version2= 1.50


| Returns selected groups in sgroup. |= Description
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| '''groupSelect'''edUnits unit |= Syntax
|game4= arma3
|version4= 0.50


|p1= unit: [[Object]] -  |= PARAMETER1
|gr1= Interaction


|p2= |= PARAMETER2
|descr= Selects a unit from player's group. If player is the leader, the effect of this command is similar to player pressing {{Controls|F1}}, {{Controls|F2}}, {{Controls|F3}} etc to highlight units in his squad, after which the unit command menu is shown.
If leader is AI, player will get usual communication menu to interact with the leader.


|p3= |= PARAMETER3
|s1= player [[groupSelectUnit]] [unit, select]


| [[Array]] |= RETURNVALUE
|p1= player: [[Object]]


|p2= unit: [[Object]]


|x1= <code>(example)</code>|= EXAMPLE1
|p3= select: [[Boolean]]


____________________________________________________________________________________________
|r1= [[Nothing]]


| |= SEEALSO
|x1= After leaving menu, deselect all units (command menu is not opened → no selection)
<sqf>
{
player groupSelectUnit [_x, false];
} forEach (groupSelectedUnits player);
</sqf>


| |= MPBEHAVIOUR
|x2= Select all units when player is the leader:
____________________________________________________________________________________________
<sqf>
}}
{
player groupSelectUnit [_x, true];
} forEach units player;
</sqf>


<h3 style='display:none'>Notes</h3>
|x3= Open communication with group leader:
<dl class='command_description'>
<sqf>player groupSelectUnit [leader player, true];</sqf>
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|seealso= [[groupSelectedUnits]]
</dl>
}}
 
<h3 style='display:none'>Bottom Section</h3>
[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]

Latest revision as of 16:25, 15 August 2022

Hover & click on the images for description

Description

Description:
Selects a unit from player's group. If player is the leader, the effect of this command is similar to player pressing F1, F2, F3 etc to highlight units in his squad, after which the unit command menu is shown. If leader is AI, player will get usual communication menu to interact with the leader.
Groups:
Interaction

Syntax

Syntax:
player groupSelectUnit [unit, select]
Parameters:
player: Object
unit: Object
select: Boolean
Return Value:
Nothing

Examples

Example 1:
After leaving menu, deselect all units (command menu is not opened → no selection)
{ player groupSelectUnit [_x, false]; } forEach (groupSelectedUnits player);
Example 2:
Select all units when player is the leader:
{ player groupSelectUnit [_x, true]; } forEach units player;
Example 3:
Open communication with group leader:
player groupSelectUnit [leader player, true];

Additional Information

See also:
groupSelectedUnits

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