Difference between revisions of "setGroupId"

From Bohemia Interactive Community
Jump to navigation Jump to search
 
m (Text replacement - "Category:Scripting Commands ArmA2" to "Category:Scripting Commands Arma 2")
(51 intermediate revisions by 17 users not shown)
Line 1: Line 1:
back to [[Scripting_Reference#S|COMREF]]
+
{{Command|Comments=
 +
____________________________________________________________________________________________
  
<h2 style="color:#000066">'''''group'' setGroupId ''id'''''</h2>
+
| ofp |Game name=
  
 +
|1.00|Game version=
  
'''Operand types:'''
+
|arg= global |Multiplayer Arguments=
  
'''group:''' [[Object or Group]]
+
|eff= local |Multiplayer Effects=
 +
____________________________________________________________________________________________
  
'''id:''' [[Array]]
+
| Sets the group radio callsign, how it will be displayed in radio chat. Two groups on the same side '''cannot''' have the same callsign (different side is possible). When trying to apply the same callsign to two groups of the same side, the callsigns will simply be swapped, e.g:
 +
<code>group1 [[setGroupId]] ["Active Group"];
 +
group2 [[setGroupId]] ["Inactive Group"];
  
'''Type of returned value:'''
+
group2 [[setGroupId]] ["Active Group"]; {{cc|group1 is "Inactive Group" now}}</code>
  
'''Nothing'''
+
The identity setup can also consist of format keywords (marked with %) and param keywords taken from '''CfgWorlds''' config.
 +
Basically it is like [[format]] command but with some special group keywords (See Example 2).
  
'''Description:'''
+
{{Feature arma3 | Possible {{arma3}} values: <spoiler>
 +
'''%GroupSquad''':
 +
* "Squad1" → 1
 +
* "Squad2" → 2
 +
* "Squad3" → 3
 +
* "Squad4" → 4
  
Set '''group identity'''.
+
'''%GroupPlatoon''':
 +
* "Platoon1" → 1
 +
* "Platoon2" → 2
 +
* "Platoon3" → 3
 +
* "Platoon4" → 4
  
'''Id''' format is '''''[letter, color, picture]''''' or '''''[letter, color]'''''.<br>
+
'''%GroupCompany''':
'''Letter''' is one of:
+
* "CompanyAlpha" → Alpha
 +
* "CompanyBravo" → Bravo
 +
* "CompanyCharlie" → Charlie
 +
* "CompanyDelta" → Delta
 +
* "CompanyEcho" → Echo
 +
* "CompanyFoxtrot" → Foxtrot
 +
* "CompanyGolf" → Golf
 +
* "CompanyHotel" → Hotel
 +
* "CompanyIndia" → India
 +
* "CompanyKilo" → Kilo
 +
* "CompanyLima" → Lima
 +
* "CompanyMike" → Mike
 +
* "CompanyNovember" → November
 +
* "CompanyOscar" → Oscar
 +
* "CompanyPapa" → Papa
 +
* "CompanyQuebec" → Quebec
 +
* "CompanyRomeo" → Romeo
 +
* "CompanySierra" → Sierra
 +
* "CompanyTango" → Tango
 +
* "CompanyUniform" → Uniform
 +
* "CompanyVictor" → Victor
 +
* "CompanyWhiskey" → Whiskey
 +
* "CompanyXray" → X-Ray
 +
* "CompanyYankee" → Yankee
 +
* "CompanyZulu" → Zulu
  
* '''"Alpha"'''
+
'''%GroupNames''':
* '''"Bravo"'''
+
* "Alpha" → Alpha
* '''"Charlie"'''
+
* "Bravo" → Bravo
* '''"Delta"'''
+
* "Charlie" → Charlie
* '''"Echo"'''
+
* "Delta" → Delta
* '''"Foxtrot"'''
+
* "Echo" → Echo
* '''"Golf"'''
+
* "Foxtrot" → Foxtrot
* '''"Hotel"'''
+
* "Golf" → Golf
* '''"Kilo"'''
+
* "Hotel" → Hotel
 +
* "November" → November
 +
* "Kilo" → Kilo
 +
* "Yankee" → Yankee
 +
* "Zulu" → Zulu
 +
* "Two" → Two
 +
* "Three" → Three
 +
* "Buffalo" → Buffalo
 +
* "Guardian" → Guardian
 +
* "Convoy" → Convoy
 +
* "Fox" → Fox
  
'''Colour''' can be one of "GroupColor0" to "GroupColor7".
+
'''%GroupColors''':
 +
* "GroupColor0" → (nothing)
 +
* "GroupColor1" → Black
 +
* "GroupColor2" → Red
 +
* "GroupColor3" → Green
 +
* "GroupColor4" → Blue
 +
* "GroupColor5" → Yellow
 +
* "GroupColor6" → Orange
 +
* "GroupColor7" → Pink
 +
* "Six" → Six
 +
</spoiler>}}
 +
{{Informative | From '''{{arma}}''', you can freely decide the callsign, e.g {{Inline code | [[group]] [[player]] [[setGroupId]] ["First Assault Recon Team"];}}.}}
 +
{{Informative | In '''{{ofp}}''', group ID cannot be freely decided and format must be of [letter, colour, picture] or [letter, colour]. Possible values: <spoiler>
 +
'''Letter:'''
 +
* "Alpha"
 +
* "Bravo"
 +
* "Charlie"
 +
* "Delta"
 +
* "Echo"
 +
* "Foxtrot"
 +
* "Golf"
 +
* "Hotel"
 +
* "Kilo"
 +
* "Yankee"
 +
* "Zulu"
 +
* "Buffalo"
 +
* "Convoy"
 +
* "Guardian"
 +
* "November"
 +
* "Two"
 +
* "Three"
 +
* "Fox"
  
 +
'''Colour:'''
 +
* "GroupColor0" → (nothing)
 +
* "GroupColor1" → Black
 +
* "GroupColor2" → Red
 +
* "GroupColor3" → Green
 +
* "GroupColor4" → Blue
 +
* "GroupColor5" → Yellow
 +
* "GroupColor6" → Orange
 +
* "GroupColor7" → Pink
 +
* "Six" → Six
 +
</spoiler>
 +
The radio callsign strings can be overwritten in a mission by writing [[Stringtable.csv|Stringtable]] entries of the same name. Some entry names: <spoiler>
 +
* STR_CFG_''GRPNAMES''_'''ALPHA'''
 +
* STR_CFG_''GRPNAMES''_'''FOX'''
 +
* STR_CFG_''GRPCOL''_'''BLACK'''
 +
* STR_CFG_''GRPNAMES''_'''SIX''' (unlike its name suggests, this is a "group colour")
 +
* STR_CFG_FIREFLYBASE
 +
* STR_CFG_PAPABEAR
 +
* STR_CFG_HQ_BASE</spoiler>}}
  
'''Example:'''
+
For the global variant of this command see [[setGroupIdGlobal]]. |DESCRIPTION=
 +
____________________________________________________________________________________________
  
group1 '''setGroupId''' ["Delta","GroupColor4"]
+
| group [[setGroupId]] [nameFormat, nameParam1, ..., nameParamN] |SYNTAX=
  
 +
|p1= group: [[Object]] or [[Group]] |PARAMETER1=
  
'''Comments:'''
+
|p2= [nameFormat, nameParam1, ..., nameParamN]: [[Array]] |PARAMETER2=
  
Additional values for '''letter''' are:
+
|p3= nameFormat: [[String]] - format template (%keyword1 - %keyword2...etc) |PARAMETER3=
  
* '''"Yankee"'''
+
|p4= nameParam1: [[String]] - param keyword |PARAMETER4=
* '''"Zulu"'''
 
* '''"Buffalo"'''
 
* '''"Convoy"'''
 
* '''"Guardian"'''
 
* '''"November"'''
 
* '''"Two"'''
 
* '''"Three"'''
 
  
'''Color''' can also be set to '''"Six"'''.
+
| [[Nothing]] |RETURNVALUE=
 +
____________________________________________________________________________________________
  
Following is a list of GroupColors:
+
|x1= '''{{arma3}}''':<code>[[group]] [[player]] [[setGroupId]] ["Some name for the group"];
 +
[[hint]] [[groupId]] [[group]] [[player]]; {{cc|"Some name for the group"}}
 +
[[player]] [[sideChat]] "lalala"; {{cc|Some name for the group (KK): "lalala"}}</code> |EXAMPLE1=
  
* '''0''' - No colour
+
|x2= '''{{arma3}}''':<code>[[group]] [[player]] [[setGroupId]] ["%GroupNames :{{=}}: %GroupColors", "Alpha", "GroupColor2"];
* '''1''' - Black
+
[[hint]] [[groupId]] [[group]] [[player]]; {{cc|"Alpha :{{=}}: Red"}}
* '''2''' - Red
+
[[player]] [[sideChat]] "lalala"; {{cc|Alpha :{{=}}: Red (KK): "lalala"}}</code> |EXAMPLE2=
* '''3''' - Green
 
* '''4''' - Blue
 
* '''5''' - Yellow
 
* '''6''' - Orange
 
* '''7''' - Pink
 
  
Note that this does not name the group.
+
|x3= '''ArmA / {{arma2}} / {{arma3}}''': <code>_group1 [[setGroupId]] ["Assault Squad"];</code> |EXAMPLE3=
  
To call a group "grp1", for example, write this in the init field of the group leader:
+
|x4= '''OFP''': <code>_group1 [[setGroupId]] ["Delta", "GroupColor4"]</code> |EXAMPLE4=
 +
____________________________________________________________________________________________
  
grp1 = [[group]] '''this'''
+
| [[setGroupIdGlobal]], [[groupId]], [[group]] |SEEALSO=
 +
}}
 +
 
 +
<h3 style="display:none">Notes</h3>
 +
<dl class="command_description">
 +
<!-- Note Section BEGIN -->
 +
 
 +
<dd class="notedate">Posted on April 21, 2015 - 23:21 (UTC)</dd>
 +
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
 +
<dd class="note">
 +
List of available keywords from config: <code>"[[if]] (([[configName]] _x) select [0, 5] == 'group') [[then]] {
 +
[[diag_log]] ('%' + [[configName]] _x);
 +
[[for]] '_i' [[from]] 0 [[to]] [[count]] [[_x]] - 1 [[do]] {
 +
[[diag_log]] ('* ""' + [[configName]] (_x [[select]] _i) + '"" → ' + [[getText]] (([[_x]] [[select]] _i) >> 'name'));
 +
};
 +
}; [[false]]" [[configClasses]] ([[configFile]] >> "CfgWorlds");</code>
 +
</dd>
 +
 
 +
<!-- Note Section END -->
 +
</dl>
 +
 
 +
<h3 style="display:none">Bottom Section</h3>
 +
 
 +
 
 +
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands OFP 1.46|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands OFP 1.96|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands ArmA|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Command_Group:_Groups|{{uc:{{PAGENAME}}}}]]
 +
[[Category:Command_Group:_Object_Manipulation|{{uc:{{PAGENAME}}}}]]

Revision as of 15:55, 10 January 2020

Template:Command

Notes

Posted on April 21, 2015 - 23:21 (UTC)
Killzone Kid
List of available keywords from config: "if ((configName _x) select [0, 5] == 'group') then { diag_log ('%' + configName _x); for '_i' from 0 to count _x - 1 do { diag_log ('* ""' + configName (_x select _i) + '"" → ' + getText ((_x select _i) >> 'name')); }; }; false" configClasses (configFile >> "CfgWorlds");

Bottom Section