# Module `Group`

A GROUP class abstraction of a DCSGroup class.

The GROUP class will take an abstraction of the DCSGroup class, providing more methods that can be done with a GROUP.

## Global(s)

GROUP |

## Type `DCSGroup`

DCSGroup.id_ | The ID of the group in DCS

## Type `GROUP`

GROUP:Activate() | Activates a GROUP.
GROUP:AllOnGround() | Returns if all units of the group are on the ground or landed.
GROUP.ClassName |
GROUP:CommandDoScript(DoScript) | Do Script command
GROUP.Controller | The controller of the group.
GROUP:CopyRoute(Begin, End, Randomize, Radius) | Return the route of a group by using the Database#DATABASE class.
GROUP.DCSGroup | The DCS group class.
GROUP:Destroy() | Destroy a GROUP Note that this destroy method also raises a destroy event at run-time.
GROUP.FindGroup(Group, DCSGroup) | Find the created GROUP using the DCSGroup ID.
GROUP:GetCallsign() | Gets the callsign of the fist unit of the group.
GROUP:GetCategoryName() | Returns the category name of the group.
GROUP:GetDCSGroup() | Gets the DCSGroup of the GROUP.
GROUP:GetDCSUnit(UnitNumber) | Gets the DCS Unit of the GROUP.
GROUP:GetDCSUnits() | Gets the DCSUnits of the GROUP.
GROUP:GetDetectedTargets() |
GROUP:GetID() | Gets the ID of the GROUP.
GROUP:GetMaxHeight() | Returns the current maximum height of the group.
GROUP:GetMaxVelocity() | Returns the current maximum velocity of the group.
GROUP:GetMinHeight() | Returns the current minimum height of the group.
GROUP:GetName() | Gets the name of the GROUP.
GROUP:GetPointVec2() | Gets the current Point of the GROUP in VEC3 format.
GROUP:GetPositionVec3() | Gets the current Point of the GROUP in VEC3 format.
GROUP:GetTaskMission() | Return the mission template of the group.
GROUP:GetTaskRoute() | Return the mission route of the group.
GROUP:GetTypeName() | Gets the type name of the group.
GROUP:GetUnit(UnitNumber) | Gets the DCS Unit.
GROUP.GroupID | the ID of the group.
GROUP.GroupName | The name of the group.
GROUP:IsAir() | Returns if the group is of an air category.
GROUP:IsAirPlane() | Returns if the GROUP are AirPlanes.
GROUP:IsAlive() | Returns if the group is alive.
GROUP:IsGround() | Returns if the GROUP are Ground troops.
GROUP:IsHelicopter() | Returns if the GROUP is a Helicopter.
GROUP:IsShip() | Returns if the GROUP are Ships.
GROUP:IsTargetDetected(DCSObject) |
GROUP:Message(Message, Duration) | Returns a message for a coalition or a client.
GROUP:MessageToAll(Message, Duration) | Send a message to all coalitions.
GROUP:MessageToBlue(Message, Duration) | Send a message to the blue coalition.
GROUP:MessageToClient(Message, Duration, Client) | Send a message to a client.
GROUP:MessageToRed(Message, Duration) | Send a message to the red coalition.
GROUP:New(DCSGroup) | Create a new GROUP from a DCSGroup
GROUP:NewFromDCSUnit(DCSUnit) | Create a new GROUP from an existing DCSUnit in the mission.
GROUP:NewFromName(GroupName) | Create a new GROUP from an existing group name.
GROUP:OptionROEHoldFire() | Holding weapons.
GROUP:OptionROEHoldFirePossible() | Can the GROUP hold their weapons?
GROUP:OptionROEOpenFire() | Openfire.
GROUP:OptionROEOpenFirePossible() | Can the GROUP attack designated targets?
GROUP:OptionROEReturnFire() | Return fire.
GROUP:OptionROEReturnFirePossible() | Can the GROUP attack returning on enemy fire?
GROUP:OptionROEWeaponFree() | Weapon free.
GROUP:OptionROEWeaponFreePossible() | Can the GROUP attack targets of opportunity?
GROUP:OptionROTEvadeFire() | Evade on fire.
GROUP:OptionROTEvadeFirePossible() | Can the GROUP evade on enemy fire?
GROUP:OptionROTNoReaction() | No evasion on enemy threats.
GROUP:OptionROTNoReactionPossible() | Can the GROUP ignore enemy fire?
GROUP:OptionROTPassiveDefense() | Evasion passive defense.
GROUP:OptionROTPassiveDefensePossible() | Can the GROUP evade using passive defenses?
GROUP:OptionROTVertical() | Evade on fire using vertical manoeuvres.
GROUP:OptionROTVerticalPossible() | Can the GROUP evade on fire using vertical manoeuvres?
GROUP:PopCurrentTask() | Popping current Task from the group.
GROUP:PushTask(DCSTask, WaitTime) | Pushing Task on the queue from the group.
GROUP:Route(GoPoints) | Make the group to follow a given route.
GROUP:SetTask(DCSTask, WaitTime) | Clearing the Task Queue and Setting the Task on the queue from the group.
GROUP:TaskAttackUnit(The, AttackUnit) | Attack the Unit.
GROUP:TaskCombo(<, DCSTasks) | Return a Combo Task taking an array of Tasks
GROUP:TaskCondition(time, userFlag, userFlagValue, condition, duration, lastWayPoint) | Return a condition section for a controlled task
GROUP:TaskControlled(DCSTask, DCSStopCondition) | Return a Controlled Task taking a Task and a TaskCondition
GROUP:TaskEmbarkToTransportAtVec2(Point, Radius) | Move to a defined Vec2 Point, and embark to a group when arrived within a defined Radius.
GROUP:TaskEmbarkingAtVec2(Point, Duration, EmbarkingGroup) | Move the group to a Vec2 Point, wait for a defined duration and embark a group.
GROUP:TaskFireAtPoint(The, Radius, PointVec2) | Fires at a VEC2 point.
GROUP:TaskFunction(WayPoint, WayPointIndex, FunctionString, FunctionArguments) |
GROUP:TaskHoldPosition(Duration) | Hold position at the current position of the first unit of the group.
GROUP:TaskLandAtVec2(Point, Duration) | Land the group at a Vec2Point.
GROUP:TaskLandAtZone(Zone, Duration, RandomPoint) | Land the group at a @{Zone#ZONE).
GROUP:TaskMission(TaskMission) | Return a Misson task from a mission template.
GROUP:TaskOrbitCircle(Altitude, Speed) | Orbit at the current position of the first unit of the group at a specified alititude
GROUP:TaskOrbitCircleAtVec2(Point, Altitude, Speed) | Orbit at a specified position at a specified alititude during a specified duration with a specified speed.
GROUP:TaskRoute(Points) | Return a Misson task to follow a given route defined by Points.
GROUP:TaskRouteToVec3(Point, Speed) | Make the group to fly to a given point and hover.
GROUP:TaskRouteToZone(Zone, Randomize, Speed, Formation) | Route the group to a given zone.
GROUP:TaskWrappedAction(DCSCommand, Index) | Return a WrappedAction Task taking a Command
GROUP:WayPointExecute(WayPoint, The, WaitTime) | Executes the WayPoint plan.
GROUP:WayPointFunction(WayPoint, WayPointIndex, WayPointFunction, ...) | Registers a waypoint function that will be executed when the group moves over the WayPoint.
GROUP.WayPointFunctions |
GROUP:WayPointInitialize(WayPoint) | Retrieve the group mission and allow to place function hooks within the mission waypoint plan.
GROUP.WayPoints |
GROUP:_GetController() | Get the controller for the GROUP.

## Type `Vec3`

Vec3.x |
Vec3.y |

## Global(s)

#GROUP GROUP

## Type `Group`

## Type `DCSCommand`

## Type `DCSGroup`

A DCSGroup

### Field(s)

DCSGroup.id_

  The ID of the group in DCS

## Type `DCSStopCondition`

## Type `Duration`

## Type `GROUP`

The GROUP class

### Field(s)

GROUP:Activate()

  Activates a GROUP.

GROUP:AllOnGround()

  Returns if all units of the group are on the ground or landed.

  If all units of this group are on the ground, this function will return true, otherwise false.

  ### Return value

  #boolean: All units on the ground result.

#string GROUP.ClassName

GROUP:CommandDoScript(DoScript)

  Do Script command

  ### Parameter

  - `#string DoScript` :

  ### Return value

  #DCSCommand:

#table GROUP.Controller

  The controller of the group.

GROUP:CopyRoute(Begin, End, Randomize, Radius)

  Return the route of a group by using the Database#DATABASE class.

  ### Parameters

  - `#number Begin` : The route point from where the copy will start. The base route point is 0.

  - `#number End` : The route point where the copy will end. The End point is the last point - the End point. The last point has base 0.

  - `#boolean Randomize` : Randomization of the route, when true.

  - `#number Radius` : When randomization is on, the randomization is within the radius.

DCSGroup#Group GROUP.DCSGroup

  The DCS group class.

GROUP:Destroy()

  Destroy a GROUP Note that this destroy method also raises a destroy event at run-time.

  So all event listeners will catch the destroy event of this GROUP.

GROUP.FindGroup(Group, DCSGroup)

  Find the created GROUP using the DCSGroup ID.

  If a GROUP was created with the DCSGroupID, the the GROUP instance will be returned. Otherwise nil will be returned.

  ### Parameters

  - `DCSGroup#Group Group` :

  - `DCSGroup` :

  ### Return value

  #GROUP:

GROUP:GetCallsign()

  Gets the callsign of the fist unit of the group.

  ### Return value

  #string: The callsign of the first unit of the group.

GROUP:GetCategoryName()

  Returns the category name of the group.

  ### Return value

  #string: Category name = Helicopter, Airplane, Ground Unit, Ship

GROUP:GetDCSGroup()

  Gets the DCSGroup of the GROUP.

  ### Return value

  DCSGroup#Group: The DCSGroup.

GROUP:GetDCSUnit(UnitNumber)

  Gets the DCS Unit of the GROUP.

  ### Parameter

  - `#number UnitNumber` : The unit index to be returned from the GROUP.

  ### Return value

  #Unit: The DCS Unit.

GROUP:GetDCSUnits()

  Gets the DCSUnits of the GROUP.

  ### Return value

  #table: The DCSUnits.

GROUP:GetDetectedTargets()

GROUP:GetID()

  Gets the ID of the GROUP.

  ### Return value

  #number: The ID of the GROUP.

GROUP:GetMaxHeight()

  Returns the current maximum height of the group.

  Each unit within the group gets evaluated, and the maximum height (= the unit which is the highest elevated) is returned.

  ### Return value

  #number: Maximum height found.

GROUP:GetMaxVelocity()

  Returns the current maximum velocity of the group.

  Each unit within the group gets evaluated, and the maximum velocity (= the unit which is going the fastest) is returned.

  ### Return value

  #number: Maximum velocity found.

GROUP:GetMinHeight()

  Returns the current minimum height of the group.

  Each unit within the group gets evaluated, and the minimum height (= the unit which is the lowest elevated) is returned.

  ### Return value

  #number: Minimum height found.

GROUP:GetName()

  Gets the name of the GROUP.

  ### Return value

  #string: The name of the GROUP.

GROUP:GetPointVec2()

  Gets the current Point of the GROUP in VEC3 format.

  ### Return value

  #Vec3: Current x,y and z position of the group.

GROUP:GetPositionVec3()

  Gets the current Point of the GROUP in VEC3 format.

  ### Return value

  #Vec3: Current Vec3 position of the group.

GROUP:GetTaskMission()

  Return the mission template of the group.

  ### Return value

  #table: The MissionTemplate

GROUP:GetTaskRoute()

  Return the mission route of the group.

  ### Return value

  #table: The mission route defined by points.

GROUP:GetTypeName()

  Gets the type name of the group.

  ### Return value

  #string: The type name of the group.

GROUP:GetUnit(UnitNumber)

  Gets the DCS Unit.

  ### Parameter

  - `#number UnitNumber` : The number of the Unit to be returned.

  ### Return value

  Unit#UNIT: The DCS Unit.

#number GROUP.GroupID

  the ID of the group.

#string GROUP.GroupName

  The name of the group.

GROUP:IsAir()

  Returns if the group is of an air category.

  If the group is a helicopter or a plane, then this method will return true, otherwise false.

  ### Return value

  #boolean: Air category evaluation result.

GROUP:IsAirPlane()

  Returns if the GROUP are AirPlanes.

  ### Return value

  #boolean: true if GROUP are AirPlanes.

GROUP:IsAlive()

  Returns if the group is alive.

  When the group exists at run-time, this method will return true, otherwise false.

  ### Return value

  #boolean: Alive result.

GROUP:IsGround()

  Returns if the GROUP are Ground troops.

  ### Return value

  #boolean: true if GROUP are Ground troops.

GROUP:IsHelicopter()

  Returns if the GROUP is a Helicopter.

  ### Return value

  #boolean: true if GROUP are Helicopters.

GROUP:IsShip()

  Returns if the GROUP are Ships.

  ### Return value

  #boolean: true if GROUP are Ships.

GROUP:IsTargetDetected(DCSObject)

  ### Parameter

  - `DCSObject` :

GROUP:Message(Message, Duration)

  Returns a message for a coalition or a client.

  ### Parameters

  - `#string Message` : The message text

  - `#Duration Duration` : The duration of the message.

  ### Return value

  Message#MESSAGE:

GROUP:MessageToAll(Message, Duration)

  Send a message to all coalitions.

  The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.

  ### Parameters

  - `#string Message` : The message text

  - `#Duration Duration` : The duration of the message.

GROUP:MessageToBlue(Message, Duration)

  Send a message to the blue coalition.

  The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.

  ### Parameters

  - `#string Message` : The message text

  - `#Duration Duration` : The duration of the message.

GROUP:MessageToClient(Message, Duration, Client)

  Send a message to a client.

  The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.

  ### Parameters

  - `#string Message` : The message text

  - `#Duration Duration` : The duration of the message.

  - `Client#CLIENT Client` : The client object receiving the message.

GROUP:MessageToRed(Message, Duration)

  Send a message to the red coalition.

  The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.

  ### Parameters

  - `#string Message` : The message text

  - `#Duration Duration` : The duration of the message.

GROUP:New(DCSGroup)

  Create a new GROUP from a DCSGroup

  ### Parameter

  - `DCSGroup#Group DCSGroup` : The DCS Group

  ### Return value

  #GROUP: self

GROUP:NewFromDCSUnit(DCSUnit)

  Create a new GROUP from an existing DCSUnit in the mission.

  ### Parameter

  - `DCSUnit` : The DCSUnit.

  ### Return value

  #GROUP: self

GROUP:NewFromName(GroupName)

  Create a new GROUP from an existing group name.

  ### Parameter

  - `GroupName` : The name of the DCS Group.

  ### Return value

  #GROUP: self

GROUP:OptionROEHoldFire()

  Holding weapons.

  ### Return value

  Group#GROUP: self

GROUP:OptionROEHoldFirePossible()

  Can the GROUP hold their weapons?

  ### Return value

  #boolean:

GROUP:OptionROEOpenFire()

  Openfire.

  ### Return value

  #GROUP: self

GROUP:OptionROEOpenFirePossible()

  Can the GROUP attack designated targets?

  ### Return value

  #boolean:

GROUP:OptionROEReturnFire()

  Return fire.

  ### Return value

  #GROUP: self

GROUP:OptionROEReturnFirePossible()

  Can the GROUP attack returning on enemy fire?

  ### Return value

  #boolean:

GROUP:OptionROEWeaponFree()

  Weapon free.

  ### Return value

  #GROUP: self

GROUP:OptionROEWeaponFreePossible()

  Can the GROUP attack targets of opportunity?

  ### Return value

  #boolean:

GROUP:OptionROTEvadeFire()

  Evade on fire.

  ### Return value

  #GROUP: self

GROUP:OptionROTEvadeFirePossible()

  Can the GROUP evade on enemy fire?

  ### Return value

  #boolean:

GROUP:OptionROTNoReaction()

  No evasion on enemy threats.

  ### Return value

  #GROUP: self

GROUP:OptionROTNoReactionPossible()

  Can the GROUP ignore enemy fire?

  ### Return value

  #boolean:

GROUP:OptionROTPassiveDefense()

  Evasion passive defense.

  ### Return value

  #GROUP: self

GROUP:OptionROTPassiveDefensePossible()

  Can the GROUP evade using passive defenses?

  ### Return value

  #boolean:

GROUP:OptionROTVertical()

  Evade on fire using vertical manoeuvres.

  ### Return value

  #GROUP: self

GROUP:OptionROTVerticalPossible()

  Can the GROUP evade on fire using vertical manoeuvres?

  ### Return value

  #boolean:

GROUP:PopCurrentTask()

  Popping current Task from the group.

  ### Return value

  Group#GROUP: self

GROUP:PushTask(DCSTask, WaitTime)

  Pushing Task on the queue from the group.

  ### Parameters

  - `DCSTask` :

  - `WaitTime` :

  ### Return value

  Group#GROUP: self

GROUP:Route(GoPoints)

  Make the group to follow a given route.

  ### Parameter

  - `#table GoPoints` : A table of Route Points.

  ### Return value

  #GROUP: self

GROUP:SetTask(DCSTask, WaitTime)

  Clearing the Task Queue and Setting the Task on the queue from the group.

  ### Parameters

  - `DCSTask` :

  - `WaitTime` :

  ### Return value

  Group#GROUP: self

GROUP:TaskAttackUnit(The, AttackUnit)

  Attack the Unit.

  ### Parameters

  - `Unit#UNIT The` : unit.

  - `AttackUnit` :

  ### Return value

  DCSTask#Task: The DCS task structure.

GROUP:TaskCombo(<, DCSTasks)

  Return a Combo Task taking an array of Tasks

  ### Parameters

  - `#list <` : CSTask#Task> DCSTasks

  - `DCSTasks` :

  ### Return value

  DCSTask#Task:

GROUP:TaskCondition(time, userFlag, userFlagValue, condition, duration, lastWayPoint)

  Return a condition section for a controlled task

  ### Parameters

  - `#Time time` :

  - `#string userFlag` :

  - `#boolean userFlagValue` :

  - `#string condition` :

  - `#Time duration` :

  - `#number lastWayPoint` :

    return DCSTask#Task

GROUP:TaskControlled(DCSTask, DCSStopCondition)

  Return a Controlled Task taking a Task and a TaskCondition

  ### Parameters

  - `DCSTask#Task DCSTask` :

  - `#DCSStopCondition DCSStopCondition` :

  ### Return value

  DCSTask#Task:

GROUP:TaskEmbarkToTransportAtVec2(Point, Radius)

  Move to a defined Vec2 Point, and embark to a group when arrived within a defined Radius.

  ### Parameters

  - `#Vec2 Point` : The point where to wait.

  - `#number Radius` : The radius of the embarking zone around the Point.

  ### Return value

  DCSTask#Task: The DCS task structure.

GROUP:TaskEmbarkingAtVec2(Point, Duration, EmbarkingGroup)

  Move the group to a Vec2 Point, wait for a defined duration and embark a group.

  ### Parameters

  - `#Vec2 Point` : The point where to wait.

  - `#number Duration` : The duration in seconds to wait.

  - `#GROUP EmbarkingGroup` : The group to be embarked.

  ### Return value

  DCSTask#Task: The DCS task structure

GROUP:TaskFireAtPoint(The, Radius, PointVec2)

  Fires at a VEC2 point.

  ### Parameters

  - `DCSTypes#Vec2 The` : point to fire at.

  - `DCSTypes#Distance Radius` : The radius of the zone to deploy the fire at.

  - `PointVec2` :

  ### Return value

  DCSTask#Task: The DCS task structure.

GROUP:TaskFunction(WayPoint, WayPointIndex, FunctionString, FunctionArguments)

  ### Parameters

  - `WayPoint` :

  - `WayPointIndex` :

  - `FunctionString` :

  - `FunctionArguments` :

GROUP:TaskHoldPosition(Duration)

  Hold position at the current position of the first unit of the group.

  ### Parameter

  - `#number Duration` : The maximum duration in seconds to hold the position.

  ### Return value

  #GROUP: self

GROUP:TaskLandAtVec2(Point, Duration)

  Land the group at a Vec2Point.

  ### Parameters

  - `#Vec2 Point` : The point where to land.

  - `#number Duration` : The duration in seconds to stay on the ground.

  ### Return value

  #GROUP: self

GROUP:TaskLandAtZone(Zone, Duration, RandomPoint)

  Land the group at a @{Zone#ZONE).

  ### Parameters

  - `Zone#ZONE Zone` : The zone where to land.

  - `#number Duration` : The duration in seconds to stay on the ground.

  - `RandomPoint` :

  ### Return value

  #GROUP: self

GROUP:TaskMission(TaskMission)

  Return a Misson task from a mission template.

  ### Parameter

  - `#table TaskMission` : A table containing the mission task.

  ### Return value

  DCSTask#Task:

GROUP:TaskOrbitCircle(Altitude, Speed)

  Orbit at the current position of the first unit of the group at a specified alititude

  ### Parameters

  - `#number Altitude` : The altitude to hold the position.

  - `#number Speed` : The speed flying when holding the position.

  ### Return value

  #GROUP: self

GROUP:TaskOrbitCircleAtVec2(Point, Altitude, Speed)

  Orbit at a specified position at a specified alititude during a specified duration with a specified speed.

  ### Parameters

  - `#Vec2 Point` : The point to hold the position.

  - `#number Altitude` : The altitude to hold the position.

  - `#number Speed` : The speed flying when holding the position.

  ### Return value

  #GROUP: self

GROUP:TaskRoute(Points)

  Return a Misson task to follow a given route defined by Points.

  ### Parameter

  - `#table Points` : A table of route points.

  ### Return value

  DCSTask#Task:

GROUP:TaskRouteToVec3(Point, Speed)

  Make the group to fly to a given point and hover.

  ### Parameters

  - `#Vec3 Point` : The destination point.

  - `#number Speed` : The speed to travel.

  ### Return value

  #GROUP: self

GROUP:TaskRouteToZone(Zone, Randomize, Speed, Formation)

  Route the group to a given zone.

  The group final destination point can be randomized. A speed can be given in km/h. A given formation can be given.

  ### Parameters

  - `Zone#ZONE Zone` : The zone where to route to.

  - `#boolean Randomize` : Defines whether to target point gets randomized within the Zone.

  - `#number Speed` : The speed.

  - `Base#FORMATION Formation` : The formation string.

GROUP:TaskWrappedAction(DCSCommand, Index)

  Return a WrappedAction Task taking a Command

  ### Parameters

  - `DCSCommand#Command DCSCommand` :

  - `Index` :

  ### Return value

  DCSTask#Task:

GROUP:WayPointExecute(WayPoint, The, WaitTime)

  Executes the WayPoint plan.

  The function gets a WayPoint parameter, that you can use to restart the mission at a specific WayPoint. Note that when the WayPoint parameter is used, the new start mission waypoint of the group will be 1!

  ### Parameters

  - `#number WayPoint` : The WayPoint from where to execute the mission.

  - `#WaitTime The` : amount seconds to wait before initiating the mission.

  - `WaitTime` :

  ### Return value

  #GROUP:

GROUP:WayPointFunction(WayPoint, WayPointIndex, WayPointFunction, ...)

  Registers a waypoint function that will be executed when the group moves over the WayPoint.

  ### Parameters

  - `#number WayPoint` : The waypoint number. Note that the start waypoint on the route is WayPoint 1!

  - `#number WayPointIndex` : When defining multiple WayPoint functions for one WayPoint, use WayPointIndex to set the sequence of actions.

  - `#function WayPointFunction` : The waypoint function to be called when the group moves over the waypoint. The waypoint function takes variable parameters.

  - `...` :

  ### Return value

  #GROUP:

GROUP.WayPointFunctions

GROUP:WayPointInitialize(WayPoint)

  Retrieve the group mission and allow to place function hooks within the mission waypoint plan.

  Use the method Group#GROUP to define the hook functions for specific waypoints. Use the method @{Group@GROUP:WayPointExecute) to start the execution of the new mission plan. Note that when WayPointInitialize is called, the Mission of the group is RESTARTED!

  ### Parameter

  - `#number WayPoint` :

  ### Return value

  #GROUP:

GROUP.WayPoints

GROUP:_GetController()

  Get the controller for the GROUP.

  ### Return value

  Controller#Controller:

## Type `Time`

## Type `Unit`

## Type `Vec2`

## Type `Vec3`

### Field(s)

Vec3.x

Vec3.y

## Type `WaitTime`

## Type `list`