# Groups (scripting commands)

- [allGroups](../../commands/allGroups.md): Return a list of all groups created on the following sides east, west, resistance/independent and civilian only. Does not contain groups of sideLogic.
- [allowFleeing](../../commands/allowFleeing.md): Sets the cowardice level (the lack of courage or bravery) of a group or unit.
- [assignedGroup](../../commands/assignedGroup.md): Returns Group to which the given vehicle was added last with addVehicle. To update assignedGroup to the current group, run addVehicle to the current group again.
- [assignedVehicles](../../commands/assignedVehicles.md): Returns all vehicles added to the given Group with addVehicle.
- [assignTeam](../../commands/assignTeam.md): Assigns the unit (in case of a vehicle, its commander) to the given team. Team is an option in group control (unit management) menu that allows to split player group in teams and then give bulk order to separate teams.
- [attackEnabled](../../commands/attackEnabled.md): Return whether a group's leader can issue attack commands to soldiers under his command.
- [combatBehaviour](../../commands/combatBehaviour.md): Returns combat behaviour of unit or group. To set unit or group behaviour see setCombatBehaviour. The behaviour is one of:
- [combatMode](../../commands/combatMode.md): Returns the combat mode of the given AI group. See setCombatMode for more information about combat modes.
- [commandMove](../../commands/commandMove.md): Order the given unit(s) to move to the given location (via the radio). Exactly the same as doMove, except this command displays a radio message.
- [commandStop](../../commands/commandStop.md): Order the given unit(s) to stop via radio. A stop command will never finish, the unit(s) will never be ready.
- [commandTarget](../../commands/commandTarget.md): Order the given unit(s) to target the given target (via the radio). Command given to the player, puts a red square with words Target and Distance on player's HUD at target location.
- [createGroup](../../commands/createGroup.md): 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.
- [deleteGroup](../../commands/deleteGroup.md): Destroys the given group - the group must be empty and local to the machine executing this command.
- [deleteGroupWhenEmpty](../../commands/deleteGroupWhenEmpty.md): Marks given group for auto-deletion when group is empty. true will mark the group for auto-deletion once empty, false will simply unmark the group that was marked previously.
- [dissolveTeam](../../commands/dissolveTeam.md): Dissolves the given team. All members become members of the main team.
- [enableAttack](../../commands/enableAttack.md): Set if leader can issue attack commands to the soldiers in his group.
- [forgetTarget](../../commands/forgetTarget.md): Resets the info a group has about a target, forcing knowsAbout value to 0.
- [formation](../../commands/formation.md): Returns the current formation of a group.
- [formationDirection](../../commands/formationDirection.md): Return the direction in degrees of the 'unit' watching in formation.
- [formationMembers](../../commands/formationMembers.md): Return list of units (drivers) in the formation.
- [formationTask](../../commands/formationTask.md): Return the current task of the unit in the formation.
- [group](../../commands/group.md): Returns the group a unit is assigned to.
- [groupFromNetId](../../commands/groupFromNetId.md): Get group from the provided unique ID. For objects, use objectFromNetId.
- [groupId](../../commands/groupId.md): Returns a group's name or a unit's group ID number.
- [groups](../../commands/groups.md): Returns an array with all groups of given side.
- [grpNull](../../commands/grpNull.md): A non-existing Group. To compare non-existent groups use isNull or isEqualTo:
- [inAreaArrayIndexes](../../commands/inAreaArrayIndexes.md): Returns indices of positions that are within the provided area.
- [isFormationLeader](../../commands/isFormationLeader.md): Returns true if the specified unit is subgroup leader.
- [isGroupDeletedWhenEmpty](../../commands/isGroupDeletedWhenEmpty.md): Checks if the given group marked for auto-deletion when empty. See deleteGroupWhenEmpty.
- [join](../../commands/join.md): Joins units into a given Group.
- [joinAs](../../commands/joinAs.md): Joins the unit to the given group, if position id is available, this one is used.
- [joinAsSilent](../../commands/joinAsSilent.md): Joins the unit to the given group, if position id is available, this one is used. Avoid any radio communication related to joining.
- [joinSilent](../../commands/joinSilent.md): Join all units in the array to given group silently (without radio message). To have a group member leave a group, join him with the grpNull group (e.g.
- [leader](../../commands/leader.md): Returns the group leader for the given unit or group. For dead units, objNull is returned.
- [leaveVehicle](../../commands/leaveVehicle.md): Ceases the using of the vehicle by a group and unassigns vehicle from the group. If the argument is a single unit, the vehicle will be unassigned from unit's group.
- [onBriefingGroup](../../commands/onBriefingGroup.md): Select a sound declared in the Description.ext of the mission to be played the first time the Group tab is selected in the briefing.
- [resetSubgroupDirection](../../commands/resetSubgroupDirection.md): Sets formation direction of a group relative to current direction of the group leader. The group units will change their positions to form new formation if new formation direction is different (approx +/- 15 degrees).
- [selectLeader](../../commands/selectLeader.md): Select the group's leader. Group locality can be checked with local command and group ownership with groupOwner command.
- [setBehaviour](../../commands/setBehaviour.md): Sets individual unit behaviour on every unit in a group.
- [setBehaviourStrong](../../commands/setBehaviourStrong.md): Sets individual unit behaviour on every unit in a group and additionally tries to force this behaviour to the unit's group. Alternatively see setCombatBehaviour.
- [setCombatBehaviour](../../commands/setCombatBehaviour.md): Sets an individual unit entity behaviour (main syntax) or a group entity behaviour (alternative syntax). The group in this case is a Group entity and not a simple collection of units.
- [setCombatMode](../../commands/setCombatMode.md): Sets AI group combat mode (engagement rules). For individual unit's combat mode see setUnitCombatMode.
- [setFormation](../../commands/setFormation.md): Set group formation.
- [setFormDir](../../commands/setFormDir.md): Sets group formation heading. Accepted heading range is 0 to 360. Formation is facing this direction unless enemy is seen. When group is moving, this value is overridden by movement direction.
- [setGroupId](../../commands/setGroupId.md): Sets the group radio callsign, how it will be displayed in radio chat. Two groups on the same side cannot have the same callsign (possible on different sides) - see #Example 4.
- [setGroupIdGlobal](../../commands/setGroupIdGlobal.md): A global equivalent of setGroupId.
- [setSpeedMode](../../commands/setSpeedMode.md): Sets group speed mode. If unit is passed as param, unit's group is used. Mode may be one of: - "UNCHANGED" (unchanged) - "LIMITED" (half speed) - "NORMAL" (full speed, maintain formation) - "FULL" (do not wait for any…
- [speedMode](../../commands/speedMode.md): Returns speed mode of the group, which can be any of the following: - "LIMITED" - "NORMAL" - "FULL"
- [unassignTeam](../../commands/unassignTeam.md): Unassigns the unit (in the case of a vehicle its commander unit) from his team. This is equal to unit assignTeam "MAIN".
- [units](../../commands/units.md): Returns an array with all the units in the group or unit's group, or all units belonging to a certain side.
