hcSetGroup: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix example)
mNo edit summary
 
(48 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
|version4= 0.50


{{Informative|The previous HC leader should be [[hcRemoveGroup|removed]] before adding the new one (see '''[[#Examples|Example 3]]''').}} |DESCRIPTION=
|gr1= High Command
____________________________________________________________________________________________


| unit '''hcSetGroup''' [group, groupName, team] |SYNTAX=
|descr= Add group to unit's [[High Command|high command]] bar.


|p1= unit: [[Object]] - the leader |PARAMETER1=
{{Feature|informative|The previous HC leader should be [[hcRemoveGroup|removed]] before adding the new one (see '''{{Link|#Example 3}}''').}}


|p2= group: [[Group]] |PARAMETER2=
|s1= unit [[hcSetGroup]] [group, groupName, team]


|p3= groupName: [[String]] |PARAMETER3=
|p1= unit: [[Object]] - the leader


|p4= team: [[String]] - can be one of:
|p2= group: [[Group]]
 
|p3= groupName: [[String]] - (Optional)
 
|p4= team: [[String]] Enum - (Optional, default "teamMain") can be one of:
* "teamMain"
* "teamMain"
* "teamRed"
* "teamRed"
* "teamGreen"
* "teamGreen"
* "teamBlue"
* "teamBlue"
* "teamYellow" |PARAMETER4=
* "teamYellow"


| [[Nothing]] |RETURNVALUE=
|r1= [[Nothing]]


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


|x2= <code>[[player]] [[hcSetGroup]] [group];</code>|EXAMPLE2=
|x2= <sqf>player hcSetGroup [group];</sqf>


|x3= <code>[[if]] ([[player]] !{{=}} [[hcLeader]] _group) [[then]]
|x3= <sqf>
if (player != hcLeader _group) then
{
{
[[hcLeader]] _group [[hcRemoveGroup]] _group;
hcLeader _group hcRemoveGroup _group;
[[player]] [[hcSetGroup]] [_group];
player hcSetGroup [_group];
};</code> | EXAMPLE3=
};
____________________________________________________________________________________________
</sqf>
 
| [[High Command]],[[hcAllGroups]],[[hcGroupParams]],[[hcLeader]],[[hcRemoveAllGroups]],[[hcRemoveGroup]],[[hcSelected]],[[hcSelectGroup]],[[hcShowBar]],[[hcShownBar]],[[onHCGroupSelectionChanged]] |SEEALSO=


| |MPBEHAVIOUR=  
|seealso= [[High Command]] [[hcAllGroups]] [[hcGroupParams]] [[hcLeader]] [[hcRemoveAllGroups]] [[hcRemoveGroup]] [[hcSelected]] [[hcSelectGroup]] [[hcShowBar]] [[hcShownBar]] [[onHCGroupSelectionChanged]]
____________________________________________________________________________________________
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{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