hcSetGroup: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Comments" to "|Comments=")
mNo edit summary
 
(57 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


| Add group to unit's [[High Command|high command]] bar.
|game3= tkoh
<br>
|version3= 1.00
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=
|game4= arma3
|version4= 0.50


|p1= unit: [[Object]] -  |PARAMETER1=  
|gr1= High Command


|p2= array: [[Array]] -  |PARAMETER2=
|descr= Add group to unit's [[High Command|high command]] bar.


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


| Nothing |RETURNVALUE=  
|s1= unit [[hcSetGroup]] [group, groupName, team]


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


|x1= <code>unit [[hcSetGroup]] [group, "HQ", teamred];</code>|EXAMPLE1=
|p2= group: [[Group]]


|x2= <code>player [[hcSetGroup]] [group];</code>|EXAMPLE2=
|p3= groupName: [[String]] - (Optional)
____________________________________________________________________________________________


| [[High Command]],[[hcAllGroups]],[[hcGroupParams]],[[hcLeader]],[[hcRemoveAllGroups]],[[hcRemoveGroup]],[[hcSelected]],[[hcSelectGroup]],[[hcShowBar]],[[hcShownBar]],[[onHCGroupSelectionChanged]] |SEEALSO=
|p4= team: [[String]] Enum - (Optional, default "teamMain") can be one of:
* "teamMain"
* "teamRed"
* "teamGreen"
* "teamBlue"
* "teamYellow"


| |MPBEHAVIOUR=  
|r1= [[Nothing]]
____________________________________________________________________________________________
 
}}
|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:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
}}
[[Category:Scripting Commands ArmA2|{{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