Module Unit

UNIT Classes

Global(s)

UNIT

Type UNIT

UNIT.CategoryName
UNIT.ClassName
UNIT:Flare(FlareColor)

Signal a flare at the position of the UNIT.

UNIT.FlareColor
UNIT:FlareGreen()

Signal a green flare at the position of the UNIT.

UNIT:FlareRed()

Signal a red flare at the position of the UNIT.

UNIT:FlareWhite()

Signal a white flare at the position of the UNIT.

UNIT:FlareYellow()

Signal a yellow flare at the position of the UNIT.

UNIT:GetAmmo()

Returns the Unit's ammunition.

UNIT:GetCallSign()

Returns the unit's callsign - the localized string.

UNIT:GetCategoryName()

Returns the Unit's Category Name as defined within the Unit's Descriptor.

UNIT:GetCoalition()

Returns coalition of the Unit.

UNIT:GetCountry()

Returns country of the Unit.

UNIT:GetDCSUnit()
UNIT:GetDesc()

Returns unit descriptor.

UNIT:GetFuel()

Returns relative amount of fuel (from 0.0 to 1.0) the unit has in its internal tanks.

UNIT:GetGroup()

Returns the unit's group if it exist and nil otherwise.

UNIT:GetID()

Returns the unit's unique identifier.

UNIT:GetLife()

Returns the unit's health.

UNIT:GetLife0()

Returns the Unit's initial health.

UNIT:GetName()

Returns unit object by the name assigned to the unit in Mission Editor.

UNIT:GetNumber()

Returns the unit's number in the group.

UNIT:GetPlayerName()

Returns name of the player that control the unit or nil if the unit is controlled by A.I.

UNIT:GetPointVec2()
UNIT:GetPositionVec3()
UNIT:GetPrefix()
UNIT:GetRadar()

Returns two values:

  • First value indicates if at least one of the unit's radar(s) is on.
UNIT:GetSensors()

Returns the unit sensors.

UNIT:GetTypeName()
UNIT:GetVelocity()

Returns the unit's velocity vector.

UNIT:InAir()

Returns true if the Unit is in air.

UNIT:IsActive()

Returns if the unit is activated.

UNIT:IsAir()

Returns if the unit is of an air category.

UNIT:IsAlive()

Returns if the unit is alive.

UNIT:New(DCSUnit)

Create a new UNIT from DCSUnit.

UNIT:NewFromName(Unit, UnitName)

Create a new UNIT from a Unit Name.

UNIT:OtherUnitInRadius(AwaitUnit, Radius)
UNIT:Smoke(SmokeColor)

Smoke the UNIT.

UNIT:SmokeBlue()

Smoke the UNIT Blue.

UNIT.SmokeColor
UNIT:SmokeGreen()

Smoke the UNIT Green.

UNIT:SmokeOrange()

Smoke the UNIT Orange.

UNIT:SmokeRed()

Smoke the UNIT Red.

UNIT:SmokeWhite()

Smoke the UNIT White.

Type UNIT.FlareColor

UNIT.FlareColor.Green
UNIT.FlareColor.Red
UNIT.FlareColor.White
UNIT.FlareColor.Yellow

Type UNIT.SmokeColor

UNIT.SmokeColor.Blue
UNIT.SmokeColor.Green
UNIT.SmokeColor.Orange
UNIT.SmokeColor.Red
UNIT.SmokeColor.White

Global(s)

#UNIT UNIT

Type Unit

Type UNIT

The UNIT class

Field(s)

UNIT.CategoryName
#string UNIT.ClassName
UNIT:Flare(FlareColor)

Signal a flare at the position of the UNIT.

Parameter

  • FlareColor :

#UNIT.FlareColor UNIT.FlareColor
UNIT:FlareGreen()

Signal a green flare at the position of the UNIT.

UNIT:FlareRed()

Signal a red flare at the position of the UNIT.

UNIT:FlareWhite()

Signal a white flare at the position of the UNIT.

UNIT:FlareYellow()

Signal a yellow flare at the position of the UNIT.

UNIT:GetAmmo()

Returns the Unit's ammunition.

Return value

DCSUnit#Unit.Ammo:

UNIT:GetCallSign()

Returns the unit's callsign - the localized string.

Return value

#string: The Callsign of the Unit.

UNIT:GetCategoryName()

Returns the Unit's Category Name as defined within the Unit's Descriptor.

Return value

#string: Unit's Category Name

UNIT:GetCoalition()

Returns coalition of the Unit.

Return value

DCSCoalitionObject#coalition.side:

UNIT:GetCountry()

Returns country of the Unit.

Return value

DCScountry#country.id: The country identifyer.

UNIT:GetDCSUnit()
UNIT:GetDesc()

Returns unit descriptor.

Descriptor type depends on unit category.

Return value

DCSUnit#Unit.Desc: The Unit descriptor.

UNIT:GetFuel()

Returns relative amount of fuel (from 0.0 to 1.0) the unit has in its internal tanks.

If there are additional fuel tanks the value may be greater than 1.0.

Return value

#number: The relative amount of fuel (from 0.0 to 1.0).

UNIT:GetGroup()

Returns the unit's group if it exist and nil otherwise.

Return value

Group#GROUP: The Group of the Unit.

UNIT:GetID()

Returns the unit's unique identifier.

Return value

DCSUnit#Unit.ID: Unit ID

UNIT:GetLife()

Returns the unit's health.

Dead units has health <= 1.0.

Return value

#number: The Unit's health value.

UNIT:GetLife0()

Returns the Unit's initial health.

Return value

#number: The Unit's initial health value.

UNIT:GetName()

Returns unit object by the name assigned to the unit in Mission Editor.

If there is unit with such name or the unit is destroyed the function will return nil. The function provides access to non-activated units too.

UNIT:GetNumber()

Returns the unit's number in the group.

The number is the same number the unit has in ME. It may not be changed during the mission. If any unit in the group is destroyed, the numbers of another units will not be changed.

Return value

#number: The Unit number.

UNIT:GetPlayerName()

Returns name of the player that control the unit or nil if the unit is controlled by A.I.

Return value

#string: Player Name

UNIT:GetPointVec2()
UNIT:GetPositionVec3()
UNIT:GetPrefix()
UNIT:GetRadar()

Returns two values:

  • First value indicates if at least one of the unit's radar(s) is on.
  • Second value is the object of the radar's interest. Not nil only if at least one radar of the unit is tracking a target.

Return values

  1. #boolean: Indicates if at least one of the unit's radar(s) is on.

  2. DCSObject#Object: The object of the radar's interest. Not nil only if at least one radar of the unit is tracking a target.

UNIT:GetSensors()

Returns the unit sensors.

Return value

DCSUnit#Unit.Sensors:

UNIT:GetTypeName()
UNIT:GetVelocity()

Returns the unit's velocity vector.

Return value

DCSTypes#Vec3: Velocity Vector

UNIT:InAir()

Returns true if the Unit is in air.

Return value

#boolean: true if in the air.

UNIT:IsActive()

Returns if the unit is activated.

Return value

#boolean: true if Unit is activated.

UNIT:IsAir()

Returns if the unit is of an air category.

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

Return value

#boolean: Air category evaluation result.

UNIT:IsAlive()

Returns if the unit is alive.

Return value

#boolean: true if Unit is alive.

UNIT:New(DCSUnit)

Create a new UNIT from DCSUnit.

Parameter

Return value

Unit#UNIT:

UNIT:NewFromName(Unit, UnitName)

Create a new UNIT from a Unit Name.

Parameters

  • #string Unit : Name

  • UnitName :

Return value

Unit#UNIT:

UNIT:OtherUnitInRadius(AwaitUnit, Radius)

Parameters

  • AwaitUnit :

  • Radius :

UNIT:Smoke(SmokeColor)

Smoke the UNIT.

Parameter

  • SmokeColor :

UNIT:SmokeBlue()

Smoke the UNIT Blue.

#UNIT.SmokeColor UNIT.SmokeColor
UNIT:SmokeGreen()

Smoke the UNIT Green.

UNIT:SmokeOrange()

Smoke the UNIT Orange.

UNIT:SmokeRed()

Smoke the UNIT Red.

UNIT:SmokeWhite()

Smoke the UNIT White.

Type UNIT.FlareColor

FlareColor

Field(s)

UNIT.FlareColor.Green
UNIT.FlareColor.Red
UNIT.FlareColor.White
UNIT.FlareColor.Yellow

Type UNIT.SmokeColor

SmokeColor

Field(s)

UNIT.SmokeColor.Blue
UNIT.SmokeColor.Green
UNIT.SmokeColor.Orange
UNIT.SmokeColor.Red
UNIT.SmokeColor.White