Group#

Group represents a group of units sharing a common Mission Editor route/tasking. Unlike most other DCS classes, Group does not extend or inherit from any other class.

class Group#

Static functions#

static getByName(name)#

Returns the Group with the given Mission Editor name, or nil if it does not exist.

Parameters:

name (string) – Group name.

Returns:

The matching group, or nil.

Return type:

Group

Member functions#

isExist()#

Returns whether the group still exists (has not been destroyed and has at least one living unit, depending on version/context).

Returns:

Whether the group exists.

Return type:

boolean

activate()#

Activates a late-activated group.

See also

trigger.action.activateGroup(), a convenience wrapper around this method.

destroy()#

Destroys the group and all its remaining units.

See also

trigger.action.deactivateGroup(), a convenience wrapper around this method.

getCategory()#

Returns the group’s category (see Group.Category).

Returns:

Group category.

Return type:

number

getCoalition()#

Returns the coalition the group belongs to.

Returns:

Coalition ID (see coalition.side).

Return type:

number

getName()#

Returns the group’s Mission Editor name.

Returns:

Group name.

Return type:

string

getID()#

Returns the group’s numeric ID.

Returns:

Group ID.

Return type:

number

getUnit(unitNumber)#

Returns the unit within the group at the given unit number (as set in the Mission Editor), or nil if that unit is dead/nonexistent.

Parameters:

unitNumber (number) – 1-based unit number within the group.

Returns:

The matching unit, or nil.

Return type:

Unit

getUnits()#

Returns a table of all currently-existing units in the group.

Returns:

The group’s units.

Return type:

table

getSize()#

Returns the number of units currently alive in the group.

Returns:

Current group size.

Return type:

number

getInitialSize()#

Returns the number of units the group started the mission with.

Returns:

Initial group size.

Return type:

number

getController()#

Returns the group’s Controller, used to issue AI tasking, options, and commands to the entire group.

Returns:

The group’s controller.

Return type:

Controller

enableEmission(enabled)#

Enables or disables radar/sensor/radio emissions for every unit in the group.

Parameters:

enabled (boolean) – Whether emissions should be enabled.

Enumerators#

Group.Category identifies the group’s category, returned by Group.getCategory():

Value

Meaning

Group.Category.AIRPLANE

Airplane (0)

Group.Category.HELICOPTER

Helicopter (1)

Group.Category.GROUND

Ground vehicle/infantry (2)

Group.Category.SHIP

Ship (3)

Group.Category.TRAIN

Train (4)

Footnotes#

  • A Group object can also be obtained from a member Unit via Unit.getGroup().