hcSetGroup: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " +" to " ")
m (Text replacement - "{{Feature|Informative|" to "{{Feature|informative|")
 
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma2
|game1= arma2
|1.00
|version1= 1.00


|game2= arma2oa
|game2= arma2oa
Line 15: Line 15:
|gr1= High Command
|gr1= High Command


| Add group to unit's [[High Command|high command]] bar.
|descr= Add group to unit's [[High Command|high command]] bar.


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


| unit '''hcSetGroup''' [group, groupName, team]
|s1= unit [[hcSetGroup]] [group, groupName, team]


|p1= unit: [[Object]] - the leader
|p1= unit: [[Object]] - the leader
Line 36: Line 36:
|r1= [[Nothing]]
|r1= [[Nothing]]


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


|x2= <code>[[player]] [[hcSetGroup]] [group];</code>
|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>
};</sqf>


|seealso= [[High Command]],[[hcAllGroups]],[[hcGroupParams]],[[hcLeader]],[[hcRemoveAllGroups]],[[hcRemoveGroup]],[[hcSelected]],[[hcSelectGroup]],[[hcShowBar]],[[hcShownBar]],[[onHCGroupSelectionChanged]]
|seealso= [[High Command]] [[hcAllGroups]] [[hcGroupParams]] [[hcLeader]] [[hcRemoveAllGroups]] [[hcRemoveGroup]] [[hcSelected]] [[hcSelectGroup]] [[hcShowBar]] [[hcShownBar]] [[onHCGroupSelectionChanged]]
}}
}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}

Latest revision as of 01:26, 2 February 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 - (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