createGroup: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " \|([ps][0-9]+) *= " to " |$1= ") |
Lou Montana (talk | contribs) m (Text replacement - "user= kju" to "user= .kju") |
||
(28 intermediate revisions by 3 users not shown) | |||
Line 23: | Line 23: | ||
|eff= global | |eff= global | ||
|descr= Creates a new [[Group]] for the given [[Side]]. Using this command | |descr= Creates a new [[Group]] for the given [[Side]]. Using this command if the group limit is reached will return [[grpNull]]. The new [[Group]] exists globally, but it's locality is where this command was executed. | ||
{{{!}} class="wikitable" style="text-align: center" | {{{!}} class="wikitable" style="text-align: center" | ||
! Game | ! Game | ||
Line 35: | Line 35: | ||
{{!}} {{GVI|arma3|1.68}} | {{!}} {{GVI|arma3|1.68}} | ||
{{!}}- | {{!}}- | ||
! | ! Group auto-deletion | ||
{{!}} colspan="6" {{!}} {{Icon|unchecked}} | |||
{{!}} colspan="2" {{!}} {{Icon|checked}} | |||
{{!}}- | |||
! Group limit per side | |||
{{!}} 63 | {{!}} 63 | ||
{{!}} colspan="6" {{!}} 144 | {{!}} colspan="6" {{!}} 144 | ||
Line 42: | Line 46: | ||
{{Feature | important | | {{Feature | important | | ||
* Groups can only be created for the [[west]]/[[blufor]], [[opfor]]/[[east]], [[independent]]/[[resistance]], [[civilian]] and [[sideLogic]] sides - any other side will return [[grpNull]] | * Groups can only be created for the [[west]]/[[blufor]], [[opfor]]/[[east]], [[independent]]/[[resistance]], [[civilian]] and [[sideLogic]] sides - any other side will return [[grpNull]] | ||
* Before {{arma3}} a [[Side]] [[createCenter|center]] must exist before group creation (either by having editor-placed units or [[createCenter]] usage) | * Before {{arma3}}, a [[Side]] [[createCenter|center]] must exist before group creation (either by having editor-placed units or [[createCenter]] usage) | ||
}} | }} | ||
Line 63: | Line 67: | ||
|p21= side: [[Side]] | |p21= side: [[Side]] | ||
|p22= deleteWhenEmpty: [[Boolean]] - | |p22= deleteWhenEmpty: [[Boolean]] - [[true]] to [[deleteGroupWhenEmpty|delete the group when empty]]. | ||
* If set to [[true]], forces a group to get deleted when empty - it does '''not''' prevent its deletion by other commands when set to [[false]]. | * If set to [[true]], 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. | * Deletion may take up to a minute after the last unit is removed. | ||
Line 69: | Line 73: | ||
|r2= [[Group]] - [[grpNull]] if the group limit is reached | |r2= [[Group]] - [[grpNull]] if the group limit is reached | ||
|x1= < | |x1= <sqf>private _group = createGroup east;</sqf> | ||
|x2= < | |x2= <sqf>private _group = createGroup [east, true];</sqf> | ||
|seealso= [[deleteGroup]] | |seealso= [[deleteGroup]] [[deleteGroupWhenEmpty]] [[isGroupDeletedWhenEmpty]] [[group]] [[setGroupId]] [[groupID]] [[units]] [[groupFromNetId]] [[netId]] [[leader]] [[selectLeader]] [[join]] [[createCenter]] [[createUnit]] [[createVehicle]] [[Side]] | ||
}} | }} | ||
{{Note | |||
|user= .kju | |||
|timestamp= 20110104101900 | |||
|text= 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. | |||
}} | |||
{{Note | |||
|user= DreadedEntity | |||
|timestamp= 20220504142023 | |||
|text= New group is local to the machine that executed the command ('''A3 2.08.149102'''): | |||
<sqf> | |||
< | player addAction ["Group Test (Dedicated Server)", { | ||
[[], { | |||
_test = createGroup [west, true]; | |||
[str (local _test)] remoteExec ["hint", -2]; //tell all clients group locality; true | |||
missionNamespace setVariable ["Group_Reference", _test, true]; //broadcast group reference to all players | |||
}] remoteExec ["call", 2]; //create group on dedicated server only | |||
sleep 1; | |||
</ | _newGroup = missionNamespace getVariable "Group_Reference"; //receive group reference from server | ||
systemChat format ["Group local to player: %1", local _newGroup]; //false | |||
}]; | |||
</sqf> | |||
}} |
Latest revision as of 20:33, 3 May 2024
Description
- Description:
- Creates a new Group for the given Side. Using this command if the group limit is reached will return grpNull. The new Group exists globally, but it's locality is where this command was executed.
Game 1.00 1.00 1.00 1.00 1.50 1.00 1.00 1.68 Group auto-deletion Group limit per side 63 144 288 - Groups:
- Groups
Syntax
- Syntax:
- createGroup side
- Parameters:
- side: Side
- Return Value:
- Group - grpNull if the group limit is reached
Alternative Syntax
- Syntax:
- createGroup [side, deleteWhenEmpty]
- Parameters:
- side: Side
- deleteWhenEmpty: Boolean - true to delete the group when empty.
- Return Value:
- Group - grpNull if the group limit is reached
Examples
- Example 1:
- Example 2:
Additional Information
- See also:
- deleteGroup deleteGroupWhenEmpty isGroupDeletedWhenEmpty group setGroupId groupID units groupFromNetId netId leader selectLeader join createCenter createUnit createVehicle Side
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
- Posted on Jan 04, 2011 - 10:19 (UTC)
- 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.
- Posted on May 04, 2022 - 14:20 (UTC)
-
New group is local to the machine that executed the command (A3 2.08.149102):
player addAction ["Group Test (Dedicated Server)", { [[], { _test = createGroup [west, true]; [str (local _test)] remoteExec ["hint", -2]; //tell all clients group locality; true missionNamespace setVariable ["Group_Reference", _test, true]; //broadcast group reference to all players }] remoteExec ["call", 2]; //create group on dedicated server only sleep 1; _newGroup = missionNamespace getVariable "Group_Reference"; //receive group reference from server systemChat format ["Group local to player: %1", local _newGroup]; //false }];
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint: Elite version 1.00
- Operation Flashpoint: Elite: New Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Groups
- Scripting Commands: Global Effect