createGroup: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
(Fix description)
Line 1: Line 1:
{{Command|Comments=
{{Command|Comments=
____________________________________________________________________________________________


| arma |Game name=
| arma |Game name=


|1.00|Game version=
|1.00|Game version=
|gr1= Groups |GROUP1=
|gr1= Groups |GROUP1=


Line 10: Line 10:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Creates a new [[Group]] for the given [[Side]]. An HQ (center) for that side must already be in the Mission.sqm or have been initialized with [[createCenter]]. For the available sides see [[Side]].
| Creates a new [[Group]] for the given [[Side]].
<br><br>
'''NOTES'''
* The default limit of groups created per side was 144. Since Arma 3 v1.67 it is increased to 288.
* Since Arma 3 v 1.67 it is possible to mark created group for automatic deletion [[deleteGroupWhenEmpty|when the group becomes empty]] (see Alt Syntax). When group is set to be automatically deleted when empty, when group becomes empty it may take up to a minute for it to get deleted.<br><br>


{{Feature arma3|In Arma 3 when last unit leaves its group, the group usually gets immediately auto deleted, regardless of whether or not if it was set for auto deletion manually}}
{{Important |
{{Informative| When [[true]] `deleteWhenEmpty` param can force a group to get deleted when empty, but cannot prevent a group from getting deleted when empty by other engine processes when [[false]]}}|DESCRIPTION=
* Groups can only be created for the [[west]]/[[blufor]], [[opfor]]/[[east]], [[independent]]/[[resistance]], [[civilian]] and [[sideLogic]] sides.
* The default limit of groups per side is 288 since {{arma3}} v1.67 (144 before and in previous titles).
* Using a wrong side or trying to create a group when the groups limit is reached will fail silently and return [[grpNull]].
* Before {{arma3}} a [[Side]] [[createCenter|center]] must exist before group creation (either by having editor-placed units or [[createCenter]] usage).
}}
 
{{Feature arma3 |
* When the last unit leaves its group, the group usually gets immediately auto-deleted, regardless of its auto-deletion setting.
* Usage of [[createCenter]] in {{arma3}} is not required anymore as all centers are automatically created.
}}
|DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 26: Line 32:
| [[Group]] |RETURNVALUE=
| [[Group]] |RETURNVALUE=


|s2= [[createGroup]] [side, deleteWhenEmpty] &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(''since Arma 3 v1.67'') |SYNTAX2=
|s2= [[createGroup]] [side, deleteWhenEmpty] {{since|arma3|1.67|y}} |SYNTAX2=


|p21=  [side, deleteWhenEmpty]: [[Array]] |PARAMETER21=
|p21=  [side, deleteWhenEmpty]: [[Array]] |PARAMETER21=
Line 32: Line 38:
|p22= side: [[Side]] |PARAMETER22=
|p22= side: [[Side]] |PARAMETER22=


|p23= deleteWhenEmpty: [[Boolean]] - [[true]] if delete this group [[deleteGroupWhenEmpty|when empty]]. Default: [[false]] (Note that it may take up to a minute for the group to get deleted) |PARAMETER23=
|p23= deleteWhenEmpty: [[Boolean]] - (Optional, default [[false]]) [[true]] to delete [[deleteGroupWhenEmpty|delete the group when empty]].
* If set to [[true]], ''deleteWhenEmpty'' forces a group to get deleted when empty - it does '''not''' prevent its deletion by other commands when set to [[false]].
* Deletion may take up to a minute after the last unit is removed. |PARAMETER23=


|r2= [[Group]] |RETURNVALUE2=
|r2= [[Group]] |RETURNVALUE2=
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= <code>_group = [[createGroup]] [[east]]</code> |EXAMPLE1=
|x1= <code>[[private]] _group = [[createGroup]] [[east]];</code> |EXAMPLE1=


|x2= <code>_group = [[createGroup]] [<nowiki/>[[east]], [[true]]];</code> |EXAMPLE2=
|x2= <code>[[private]] _group = [[createGroup]] [<nowiki/>[[east]], [[true]]];</code> |EXAMPLE2=
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 49: Line 57:
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->


<dd class="notedate">Posted on December 15, 2006 - 21:30
<dd class="notedate">Posted on July 10,2007</dd>
<dt class="note">[[User:ColonelSandersLite|ColonelSandersLite]]
<dt class="note">[[User:5133p39|5133p39]]</dt>
<dd class="note">
<br>The group limit is 144 groups groups per side.  If you attempt to create a group, and there is no room for another, it simply doesn't create, and it doesn't error.<br>
 
 
<dd class="notedate">Posted on July 10,2007
<dt class="note">[[User:5133p39|5133p39]]
<dd class="note">
<dd class="note">
In '''{{arma}}''', empty groups are not automatically deleted - if you created 144 groups, you will not be able to create new group even if all units in all those groups died, because all the 144 groups still exists - you will have to delete some groups manually.
In '''{{arma}}''', empty groups are not automatically deleted - if you created 144 groups, you will not be able to create new group even if all units in all those groups died, because all the 144 groups still exists - you will have to delete some groups manually.
</dd>


 
<dd class="notedate">Posted on January 04, 2011</dd>
<dd class="notedate">Posted on January 04, 2011
<dt class="note">[[User:kju|kju]]</dt>
<dt class="note">[[User:kju|kju]]
<dd class="note">
<dd class="note">
A group created with createGroup will get a waypoint at [0,0,0]. When you use [[createUnit]] to fill it with units, it will get an additional waypoint at the position the first unit is created. This new waypoint will also be set as [[currentWaypoint]]. However keep these two waypoints in mind when you do some scripting involving this groups' waypoints.
A group created with [[createGroup]] will get a waypoint at [0,0,0]. When you use [[createUnit]] to fill it with units, it will get an additional waypoint at the position the first unit is created. This new waypoint will also be set as [[currentWaypoint]]. However keep these two waypoints in mind when you do some scripting involving this groups' waypoints.
 
</dd>


<!-- Note Section END -->
<!-- Note Section END -->
Line 72: Line 74:
<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>


[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP Elite|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP Elite|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Armed Assault|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Armed Assault|{{uc:{{PAGENAME}}}}]]
Line 78: Line 79:
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on June 21, 2020 - 00:10 (UTC)</dd>
<dt class="note">[[User:fusselwurm|fusselwurm]]</dt>
<dd class="note">
Groups can only be created for [[east]], [[west]], [[civilian]], [[independent]] and [[sideLogic]] . All other sides will return [[grpNull]]
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 21:23, 20 November 2020

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

Description

Description:
Creates a new Group for the given Side.
  • Groups can only be created for the west/blufor, opfor/east, independent/resistance, civilian and sideLogic sides.
  • The default limit of groups per side is 288 since Arma 3 v1.67 (144 before and in previous titles).
  • Using a wrong side or trying to create a group when the groups limit is reached will fail silently and return grpNull.
  • Before Arma 3 a Side center must exist before group creation (either by having editor-placed units or createCenter usage).
Arma 3
  • When the last unit leaves its group, the group usually gets immediately auto-deleted, regardless of its auto-deletion setting.
  • Usage of createCenter in Arma 3 is not required anymore as all centers are automatically created.
Groups:
Groups

Syntax

Syntax:
createGroup side
Parameters:
side: Side
Return Value:
Group

Alternative Syntax

Syntax:
createGroup [side, deleteWhenEmpty] Template:since
Parameters:
[side, deleteWhenEmpty]: Array
side: Side
deleteWhenEmpty: Boolean - (Optional, default false) true to delete delete the group when empty.
  • If set to true, deleteWhenEmpty forces a group to get deleted when empty - it does not prevent its deletion by other commands when set to false.
  • Deletion may take up to a minute after the last unit is removed.
Return Value:
Group

Examples

Example 1:
private _group = createGroup east;
Example 2:
private _group = createGroup [east, true];

Additional Information

See also:
deleteGroupdeleteGroupWhenEmptyisGroupDeletedWhenEmptygroupsetGroupIdgroupIDunitsgroupFromNetIdnetIdleaderselectLeaderjoincreateCentercreateUnitcreateVehicleSide

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

Notes

Posted on July 10,2007
5133p39
In Arma, empty groups are not automatically deleted - if you created 144 groups, you will not be able to create new group even if all units in all those groups died, because all the 144 groups still exists - you will have to delete some groups manually.
Posted on January 04, 2011
kju
A group created with createGroup will get a waypoint at [0,0,0]. When you use createUnit to fill it with units, it will get an additional waypoint at the position the first unit is created. This new waypoint will also be set as currentWaypoint. However keep these two waypoints in mind when you do some scripting involving this groups' waypoints.

Bottom Section