hcSetGroup: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(51 intermediate revisions by 2 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


|gr1= High Command |=GROUP1
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| Add group to unit's [[High Command|high command]] bar.
|game4= arma3
<br>
|version4= 0.50
Array parameters are group, group-name and team (teammain, teamred, teamgreen, teamblue, teamyellow).
<br>
Group is the only necessary parameter. |DESCRIPTION=
____________________________________________________________________________________________


| unit '''hcSetGroup''' array |SYNTAX=
|gr1= High Command


|p1= unit: [[Object]] -  |PARAMETER1=
|descr= Add group to unit's [[High Command|high command]] bar.


|p2= array: [[Array]] |PARAMETER2=
{{Feature|informative|The previous HC leader should be [[hcRemoveGroup|removed]] before adding the new one (see '''{{Link|#Example 3}}''').}}


|p3= |PARAMETER3=  
|s1= unit [[hcSetGroup]] [group, groupName, team]


| Nothing |RETURNVALUE=  
|p1= unit: [[Object]] - the leader


|p2= group: [[Group]]


|x1= <code>unit [[hcSetGroup]] [group, "HQ", teamred];</code>|EXAMPLE1=
|p3= groupName: [[String]] - (Optional)


|x2= <code>player [[hcSetGroup]] [group];</code>|EXAMPLE2=
|p4= team: [[String]] Enum - (Optional, default "teamMain") can be one of:
____________________________________________________________________________________________
* "teamMain"
* "teamRed"
* "teamGreen"
* "teamBlue"
* "teamYellow"


| [[High Command]],[[hcAllGroups]],[[hcGroupParams]],[[hcLeader]],[[hcRemoveAllGroups]],[[hcRemoveGroup]],[[hcSelected]],[[hcSelectGroup]],[[hcShowBar]],[[hcShownBar]],[[onHCGroupSelectionChanged]] |SEEALSO=
|r1= [[Nothing]]


| |MPBEHAVIOUR=  
|x1= <sqf>unit hcSetGroup [group, "HQ", "teamred"];</sqf>
____________________________________________________________________________________________
}}


<h3 style='display:none'>Notes</h3>
|x2= <sqf>player hcSetGroup [group];</sqf>
<dl class='command_description'>
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x3= <sqf>
</dl>
if (player != hcLeader _group) then
{
hcLeader _group hcRemoveGroup _group;
player hcSetGroup [_group];
};
</sqf>


<h3 style='display:none'>Bottom Section</h3>
|seealso= [[High Command]] [[hcAllGroups]] [[hcGroupParams]] [[hcLeader]] [[hcRemoveAllGroups]] [[hcRemoveGroup]] [[hcSelected]] [[hcSelectGroup]] [[hcShowBar]] [[hcShownBar]] [[onHCGroupSelectionChanged]]
 
}}
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 21:54, 26 September 2024

Hover & click on the images for description

Description

Description:
Add group to unit's high command bar.
The previous HC leader should be removed before adding the new one (see Example 3).
Groups:
High Command

Syntax

Syntax:
unit hcSetGroup [group, groupName, team]
Parameters:
unit: Object - the leader
group: Group
groupName: String - (Optional)
team: String Enum - (Optional, default "teamMain") can be one of:
  • "teamMain"
  • "teamRed"
  • "teamGreen"
  • "teamBlue"
  • "teamYellow"
Return Value:
Nothing

Examples

Example 1:
unit hcSetGroup [group, "HQ", "teamred"];
Example 2:
player hcSetGroup [group];
Example 3:
if (player != hcLeader _group) then { hcLeader _group hcRemoveGroup _group; player hcSetGroup [_group]; };

Additional Information

See also:
High Command hcAllGroups hcGroupParams hcLeader hcRemoveAllGroups hcRemoveGroup hcSelected hcSelectGroup hcShowBar hcShownBar onHCGroupSelectionChanged

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