Module Controllable

This module contains the CONTROLLABLE class.

1) Wrapper.Controllable#CONTROLLABLE class, extends Wrapper.Positionable#POSITIONABLE

The Wrapper.Controllable#CONTROLLABLE class is a wrapper class to handle the DCS Controllable objects:

  • Support all DCS Controllable APIs.
  • Enhance with Controllable specific APIs not in the DCS Controllable API set.
  • Handle local Controllable Controller.
  • Manage the "state" of the DCS Controllable.

1.1) CONTROLLABLE constructor

The CONTROLLABLE class provides the following functions to construct a CONTROLLABLE instance:

1.2) CONTROLLABLE task methods

Several controllable task methods are available that help you to prepare tasks. These methods return a string consisting of the task description, which can then be given to either a Wrapper.Controllable#CONTROLLABLE.PushTask or Wrapper.Controllable#SetTask method to assign the task to the CONTROLLABLE. Tasks are specific for the category of the CONTROLLABLE, more specific, for AIR, GROUND or AIR and GROUND. Each task description where applicable indicates for which controllable category the task is valid. There are 2 main subdivisions of tasks: Assigned tasks and EnRoute tasks.

1.2.1) Assigned task methods

Assigned task methods make the controllable execute the task where the location of the (possible) targets of the task are known before being detected. This is different from the EnRoute tasks, where the targets of the task need to be detected before the task can be executed.

Find below a list of the assigned task methods:

1.2.2) EnRoute task methods

EnRoute tasks require the targets of the task need to be detected by the controllable (using its sensors) before the task can be executed:

1.2.3) Preparation task methods

There are certain task methods that allow to tailor the task behaviour:

1.2.4) Obtain the mission from controllable templates

Controllable templates contain complete mission descriptions. Sometimes you want to copy a complete mission from a controllable and assign it to another:

1.3) CONTROLLABLE Command methods

Controllable command methods prepare the execution of commands using the CONTROLLABLE.SetCommand method:

1.4) CONTROLLABLE Option methods

Controllable Option methods change the behaviour of the Controllable while being alive.

1.4.1) Rule of Engagement:

To check whether an ROE option is valid for a specific controllable, use:

1.4.2) Rule on thread:

To test whether an ROT option is valid for a specific controllable, use:


Global(s)

CONTROLLABLE

Type CONTROLLABLE

CONTROLLABLE.ClassName
CONTROLLABLE:CommandDoScript(DoScript)

Do Script command

CONTROLLABLE:CommandStopRoute(StopRoute, Index)

Perform stop route command

CONTROLLABLE:CommandSwitchWayPoint(FromWayPoint, ToWayPoint)

Perform a switch waypoint command

CONTROLLABLE.ControllableName

The name of the controllable.

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

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

CONTROLLABLE.DCSControllable

The DCS controllable class.

CONTROLLABLE:EnRouteTaskAWACS()

(AIR) Aircraft will act as an AWACS for friendly units (will provide them with information about contacts).

CONTROLLABLE:EnRouteTaskEWR()

(GROUND) Ground unit (EW-radar) will act as an EWR for friendly units (will provide them with information about contacts).

CONTROLLABLE:EnRouteTaskEngageGroup(AttackGroup, Priority, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit)

(AIR) Engaging a controllable.

CONTROLLABLE:EnRouteTaskEngageTargets(Distance, TargetTypes, Priority)

(AIR) Engaging targets of defined types.

CONTROLLABLE:EnRouteTaskEngageUnit(AttackUnit, Priority, WeaponType, WeaponExpend, AttackQty, Direction, AttackQtyLimit, ControllableAttack)

(AIR) Attack the Unit.

CONTROLLABLE:EnRouteTaskFAC(Radius, Priority)

(AIR + GROUND) The task makes the controllable/unit a FAC and lets the FAC to choose a targets (enemy ground controllable) around as well as other assigned targets.

CONTROLLABLE:EnRouteTaskFAC_EngageGroup(AttackGroup, Priority, WeaponType, Designation, Datalink)

(AIR + GROUND) The task makes the controllable/unit a FAC and lets the FAC to choose the target (enemy ground controllable) as well as other assigned targets.

CONTROLLABLE:EnRouteTaskTanker()

(AIR) Aircraft will act as a tanker for friendly units.

CONTROLLABLE:GetDetectedTargets(DetectVisual, DetectOptical, DetectRadar, DetectIRST, DetectRWR, DetectDLINK)

Return the detected targets of the controllable.

CONTROLLABLE:GetLife()

Returns the health.

CONTROLLABLE:GetTaskMission()

Return the mission template of the controllable.

CONTROLLABLE:GetTaskRoute()

Return the mission route of the controllable.

CONTROLLABLE:GetUnits()

Returns the UNITs wrappers of the DCS Units of the Controllable (default is a GROUP).

CONTROLLABLE:GetWayPoints()

Get the current WayPoints set with the WayPoint functions( Note that the WayPoints can be nil, although there ARE waypoints).

CONTROLLABLE:IsTargetDetected(DCSObject)
CONTROLLABLE:New(ControllableName)

Create a new CONTROLLABLE from a DCSControllable

CONTROLLABLE:OptionROEHoldFire()

Holding weapons.

CONTROLLABLE:OptionROEHoldFirePossible()

Can the CONTROLLABLE hold their weapons?

CONTROLLABLE:OptionROEOpenFire()

Openfire.

CONTROLLABLE:OptionROEOpenFirePossible()

Can the CONTROLLABLE attack designated targets?

CONTROLLABLE:OptionROEReturnFire()

Return fire.

CONTROLLABLE:OptionROEReturnFirePossible()

Can the CONTROLLABLE attack returning on enemy fire?

CONTROLLABLE:OptionROEWeaponFree()

Weapon free.

CONTROLLABLE:OptionROEWeaponFreePossible()

Can the CONTROLLABLE attack targets of opportunity?

CONTROLLABLE:OptionROTEvadeFire()

Evade on fire.

CONTROLLABLE:OptionROTEvadeFirePossible()

Can the CONTROLLABLE evade on enemy fire?

CONTROLLABLE:OptionROTNoReaction()

No evasion on enemy threats.

CONTROLLABLE:OptionROTNoReactionPossible()

Can the CONTROLLABLE ignore enemy fire?

CONTROLLABLE:OptionROTPassiveDefense()

Evasion passive defense.

CONTROLLABLE:OptionROTPassiveDefensePossible()

Can the CONTROLLABLE evade using passive defenses?

CONTROLLABLE:OptionROTVertical()

Evade on fire using vertical manoeuvres.

CONTROLLABLE:OptionROTVerticalPossible()

Can the CONTROLLABLE evade on fire using vertical manoeuvres?

CONTROLLABLE:PopCurrentTask()

Popping current Task from the controllable.

CONTROLLABLE:PushTask(DCSTask, WaitTime)

Pushing Task on the queue from the controllable.

CONTROLLABLE:Route(GoPoints)

Make the controllable to follow a given route.

CONTROLLABLE:RouteReturnToAirbase(ReturnAirbase, Speed)

(AIR) Return the Controllable to an Wrapper.Airbase#AIRBASE A speed can be given in km/h.

CONTROLLABLE:SetCommand(DCSCommand)

Executes a command action

CONTROLLABLE:SetTask(DCSTask, WaitTime)

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

CONTROLLABLE:TaskAttackGroup(AttackGroup, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit)

(AIR) Attack a Controllable.

CONTROLLABLE:TaskAttackMapObject(Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack)

(AIR) Attacking the map object (building, structure, e.t.c).

CONTROLLABLE:TaskAttackUnit(AttackUnit, WeaponType, WeaponExpend, AttackQty, Direction, AttackQtyLimit, ControllableAttack)

(AIR) Attack the Unit.

CONTROLLABLE:TaskBombing(Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack)

(AIR) Delivering weapon at the point on the ground.

CONTROLLABLE:TaskBombingRunway(Airbase, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack)

(AIR) Delivering weapon on the runway.

CONTROLLABLE:TaskCombo(DCSTasks)

Return a Combo Task taking an array of Tasks.

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

Return a condition section for a controlled task.

CONTROLLABLE:TaskControlled(DCSTask, DCSStopCondition)

Return a Controlled Task taking a Task and a TaskCondition.

CONTROLLABLE:TaskEmbarkToTransport(Point, Radius)

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

CONTROLLABLE:TaskEmbarking(Point, Duration, EmbarkingControllable)

(AIR) Move the controllable to a Vec2 Point, wait for a defined duration and embark a controllable.

CONTROLLABLE:TaskEscort(EscortControllable, Vec3, LastWaypointIndex, EngagementDistanceMax, TargetTypes, FollowControllable, EngagementDistance)

(AIR) Escort another airborne controllable.

CONTROLLABLE:TaskFAC_AttackGroup(AttackGroup, WeaponType, Designation, Datalink)

(AIR + GROUND) The task makes the controllable/unit a FAC and orders the FAC to control the target (enemy ground controllable) destruction.

CONTROLLABLE:TaskFireAtPoint(Vec2, Radius, AmmoCount)

(GROUND) Fire at a VEC2 point until ammunition is finished.

CONTROLLABLE:TaskFollow(FollowControllable, Vec3, LastWaypointIndex)

(AIR) Following another airborne controllable.

CONTROLLABLE:TaskFunction(WayPoint, WayPointIndex, FunctionString, FunctionArguments)
CONTROLLABLE:TaskHold()

(GROUND) Hold ground controllable from moving.

CONTROLLABLE:TaskHoldPosition(Duration)

(AIR) Hold position at the current position of the first unit of the controllable.

CONTROLLABLE:TaskLandAtVec2(Point, Duration)

(AIR HELICOPTER) Landing at the ground.

CONTROLLABLE:TaskLandAtZone(Zone, Duration, RandomPoint)

(AIR) Land the controllable at a @{Core.Zone#ZONE_RADIUS).

CONTROLLABLE:TaskMission(TaskMission)

(AIR + GROUND) Return a mission task from a mission template.

CONTROLLABLE:TaskOrbitCircle(Altitude, Speed)

(AIR) Orbit at the current position of the first unit of the controllable at a specified alititude.

CONTROLLABLE:TaskOrbitCircleAtVec2(Point, Altitude, Speed)

(AIR) Orbit at a specified position at a specified alititude during a specified duration with a specified speed.

CONTROLLABLE:TaskRefueling()

(AIR) Refueling from the nearest tanker.

CONTROLLABLE:TaskRoute(Points)

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

CONTROLLABLE:TaskRouteToVec2(Point, Speed)

(AIR + GROUND) Make the Controllable move to fly to a given point.

CONTROLLABLE:TaskRouteToVec3(Point, Speed)

(AIR + GROUND) Make the Controllable move to a given point.

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

(AIR + GROUND) Route the controllable to a given zone.

CONTROLLABLE:TaskWrappedAction(DCSCommand, Index)

Return a WrappedAction Task taking a Command.

CONTROLLABLE:WayPointExecute(WayPoint, WaitTime)

Executes the WayPoint plan.

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

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

CONTROLLABLE.WayPointFunctions
CONTROLLABLE:WayPointInitialize(WayPoints)

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

CONTROLLABLE.WayPoints
CONTROLLABLE:_GetController()

Get the controller for the CONTROLLABLE.

Global(s)

#CONTROLLABLE CONTROLLABLE

Type Controllable

Type CONTROLLABLE

The CONTROLLABLE class

Field(s)

#string CONTROLLABLE.ClassName
CONTROLLABLE:CommandDoScript(DoScript)

Do Script command

Parameter

  • #string DoScript :

Return value

#DCSCommand:

CONTROLLABLE:CommandStopRoute(StopRoute, Index)

Perform stop route command

Parameters

  • #boolean StopRoute :

  • Index :

Return value

Dcs.DCSTasking.Task#Task:

CONTROLLABLE:CommandSwitchWayPoint(FromWayPoint, ToWayPoint)

Perform a switch waypoint command

Parameters

  • #number FromWayPoint :

  • #number ToWayPoint :

Return value

Dcs.DCSTasking.Task#Task:

Usage:

--- This test demonstrates the use(s) of the SwitchWayPoint method of the GROUP class.
HeliGroup = GROUP:FindByName( "Helicopter" )

--- Route the helicopter back to the FARP after 60 seconds.
-- We use the SCHEDULER class to do this.
SCHEDULER:New( nil,
  function( HeliGroup )
   local CommandRTB = HeliGroup:CommandSwitchWayPoint( 2, 8 )
   HeliGroup:SetCommand( CommandRTB )
 end, { HeliGroup }, 90 
)
#string CONTROLLABLE.ControllableName

The name of the controllable.

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

Return the route of a controllable by using the Core.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.

Dcs.DCSWrapper.Controllable#Controllable CONTROLLABLE.DCSControllable

The DCS controllable class.

CONTROLLABLE:EnRouteTaskAWACS()

(AIR) Aircraft will act as an AWACS for friendly units (will provide them with information about contacts).

No parameters.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:EnRouteTaskEWR()

(GROUND) Ground unit (EW-radar) will act as an EWR for friendly units (will provide them with information about contacts).

No parameters.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:EnRouteTaskEngageGroup(AttackGroup, Priority, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit)

(AIR) Engaging a controllable.

The task does not assign the target controllable to the unit/controllable to attack now; it just allows the unit/controllable to engage the target controllable as well as other assigned targets.

Parameters

  • Wrapper.Controllable#CONTROLLABLE AttackGroup : The Controllable to be attacked.

  • #number Priority : All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.

  • #number WeaponType : (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

  • Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend : (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

  • #number AttackQty : (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

  • Dcs.DCSTypes#Azimuth Direction : (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

  • Dcs.DCSTypes#Distance Altitude : (optional) Desired attack start altitude. Controllable/aircraft will make its attacks from the altitude. If the altitude is too low or too high to use weapon aircraft/controllable will choose closest altitude to the desired attack start altitude. If the desired altitude is defined controllable/aircraft will not attack from safe altitude.

  • #boolean AttackQtyLimit : (optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackControllable" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:EnRouteTaskEngageTargets(Distance, TargetTypes, Priority)

(AIR) Engaging targets of defined types.

Parameters

  • Dcs.DCSTypes#Distance Distance : Maximal distance from the target to a route leg. If the target is on a greater distance it will be ignored.

  • Dcs.DCSTypes#AttributeNameArray TargetTypes : Array of target categories allowed to engage.

  • #number Priority : All enroute tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:EnRouteTaskEngageUnit(AttackUnit, Priority, WeaponType, WeaponExpend, AttackQty, Direction, AttackQtyLimit, ControllableAttack)

(AIR) Attack the Unit.

Parameters

  • Wrapper.Unit#UNIT AttackUnit : The UNIT.

  • #number Priority : All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.

  • #number WeaponType : (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

  • Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend : (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

  • #number AttackQty : (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

  • Dcs.DCSTypes#Azimuth Direction : (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

  • #boolean AttackQtyLimit : (optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackControllable" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.

  • #boolean ControllableAttack : (optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:EnRouteTaskFAC(Radius, Priority)

(AIR + GROUND) The task makes the controllable/unit a FAC and lets the FAC to choose a targets (enemy ground controllable) around as well as other assigned targets.

The killer is player-controlled allied CAS-aircraft that is in contact with the FAC. If the task is assigned to the controllable lead unit will be a FAC.

Parameters

  • Dcs.DCSTypes#Distance Radius : The maximal distance from the FAC to a target.

  • #number Priority : All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:EnRouteTaskFAC_EngageGroup(AttackGroup, Priority, WeaponType, Designation, Datalink)

(AIR + GROUND) The task makes the controllable/unit a FAC and lets the FAC to choose the target (enemy ground controllable) as well as other assigned targets.

The killer is player-controlled allied CAS-aircraft that is in contact with the FAC. If the task is assigned to the controllable lead unit will be a FAC.

Parameters

  • Wrapper.Controllable#CONTROLLABLE AttackGroup : Target CONTROLLABLE.

  • #number Priority : All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.

  • #number WeaponType : Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

  • Dcs.DCSTypes#AI.Task.Designation Designation : (optional) Designation type.

  • #boolean Datalink : (optional) Allows to use datalink to send the target information to attack aircraft. Enabled by default.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:EnRouteTaskTanker()

(AIR) Aircraft will act as a tanker for friendly units.

No parameters.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:GetDetectedTargets(DetectVisual, DetectOptical, DetectRadar, DetectIRST, DetectRWR, DetectDLINK)

Return the detected targets of the controllable.

The optional parametes specify the detection methods that can be applied. If no detection method is given, the detection will use all the available methods by default.

Parameters

  • #boolean DetectVisual : (optional)

  • #boolean DetectOptical : (optional)

  • #boolean DetectRadar : (optional)

  • #boolean DetectIRST : (optional)

  • #boolean DetectRWR : (optional)

  • #boolean DetectDLINK : (optional)

Return value

#table: DetectedTargets

CONTROLLABLE:GetLife()

Returns the health.

Dead controllables have health <= 1.0.

Return values

  1. #number: The controllable health value (unit or group average).

  2. #nil: The controllable is not existing or alive.

CONTROLLABLE:GetTaskMission()

Return the mission template of the controllable.

Return value

#table: The MissionTemplate TODO: Rework the method how to retrieve a template ...

CONTROLLABLE:GetTaskRoute()

Return the mission route of the controllable.

Return value

#table: The mission route defined by points.

CONTROLLABLE:GetUnits()

Returns the UNITs wrappers of the DCS Units of the Controllable (default is a GROUP).

Return value

#list: Wrapper.Unit#UNIT> The UNITs wrappers.

CONTROLLABLE:GetWayPoints()

Get the current WayPoints set with the WayPoint functions( Note that the WayPoints can be nil, although there ARE waypoints).

Return value

#table: WayPoints If WayPoints is given, then return the WayPoints structure.

CONTROLLABLE:IsTargetDetected(DCSObject)

Parameter

  • DCSObject :

CONTROLLABLE:New(ControllableName)

Create a new CONTROLLABLE from a DCSControllable

Parameter

Return value

#CONTROLLABLE: self

CONTROLLABLE:OptionROEHoldFire()

Holding weapons.

Return value

Wrapper.Controllable#CONTROLLABLE: self

CONTROLLABLE:OptionROEHoldFirePossible()

Can the CONTROLLABLE hold their weapons?

Return value

#boolean:

CONTROLLABLE:OptionROEOpenFire()

Openfire.

Return value

#CONTROLLABLE: self

CONTROLLABLE:OptionROEOpenFirePossible()

Can the CONTROLLABLE attack designated targets?

Return value

#boolean:

CONTROLLABLE:OptionROEReturnFire()

Return fire.

Return value

#CONTROLLABLE: self

CONTROLLABLE:OptionROEReturnFirePossible()

Can the CONTROLLABLE attack returning on enemy fire?

Return value

#boolean:

CONTROLLABLE:OptionROEWeaponFree()

Weapon free.

Return value

#CONTROLLABLE: self

CONTROLLABLE:OptionROEWeaponFreePossible()

Can the CONTROLLABLE attack targets of opportunity?

Return value

#boolean:

CONTROLLABLE:OptionROTEvadeFire()

Evade on fire.

Return value

#CONTROLLABLE: self

CONTROLLABLE:OptionROTEvadeFirePossible()

Can the CONTROLLABLE evade on enemy fire?

Return value

#boolean:

CONTROLLABLE:OptionROTNoReaction()

No evasion on enemy threats.

Return value

#CONTROLLABLE: self

CONTROLLABLE:OptionROTNoReactionPossible()

Can the CONTROLLABLE ignore enemy fire?

Return value

#boolean:

CONTROLLABLE:OptionROTPassiveDefense()

Evasion passive defense.

Return value

#CONTROLLABLE: self

CONTROLLABLE:OptionROTPassiveDefensePossible()

Can the CONTROLLABLE evade using passive defenses?

Return value

#boolean:

CONTROLLABLE:OptionROTVertical()

Evade on fire using vertical manoeuvres.

Return value

#CONTROLLABLE: self

CONTROLLABLE:OptionROTVerticalPossible()

Can the CONTROLLABLE evade on fire using vertical manoeuvres?

Return value

#boolean:

CONTROLLABLE:PopCurrentTask()

Popping current Task from the controllable.

Return value

Wrapper.Controllable#CONTROLLABLE: self

CONTROLLABLE:PushTask(DCSTask, WaitTime)

Pushing Task on the queue from the controllable.

Parameters

  • DCSTask :

  • WaitTime :

Return value

Wrapper.Controllable#CONTROLLABLE: self

CONTROLLABLE:Route(GoPoints)

Make the controllable to follow a given route.

Parameter

  • #table GoPoints : A table of Route Points.

Return value

#CONTROLLABLE: self

CONTROLLABLE:RouteReturnToAirbase(ReturnAirbase, Speed)

(AIR) Return the Controllable to an Wrapper.Airbase#AIRBASE A speed can be given in km/h.

A given formation can be given.

Parameters

Return value

#string: The route

CONTROLLABLE:SetCommand(DCSCommand)

Executes a command action

Parameter

Return value

#CONTROLLABLE: self

CONTROLLABLE:SetTask(DCSTask, WaitTime)

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

Parameters

  • DCSTask :

  • WaitTime :

Return value

Wrapper.Controllable#CONTROLLABLE: self

CONTROLLABLE:TaskAttackGroup(AttackGroup, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit)

(AIR) Attack a Controllable.

Parameters

  • Wrapper.Controllable#CONTROLLABLE AttackGroup : The Controllable to be attacked.

  • #number WeaponType : (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

  • Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend : (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

  • #number AttackQty : (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

  • Dcs.DCSTypes#Azimuth Direction : (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

  • Dcs.DCSTypes#Distance Altitude : (optional) Desired attack start altitude. Controllable/aircraft will make its attacks from the altitude. If the altitude is too low or too high to use weapon aircraft/controllable will choose closest altitude to the desired attack start altitude. If the desired altitude is defined controllable/aircraft will not attack from safe altitude.

  • #boolean AttackQtyLimit : (optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackControllable" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:TaskAttackMapObject(Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack)

(AIR) Attacking the map object (building, structure, e.t.c).

Parameters

  • Dcs.DCSTypes#Vec2 Vec2 : 2D-coordinates of the point the map object is closest to. The distance between the point and the map object must not be greater than 2000 meters. Object id is not used here because Mission Editor doesn't support map object identificators.

  • #number WeaponType : (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

  • Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend : (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

  • #number AttackQty : (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

  • Dcs.DCSTypes#Azimuth Direction : (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

  • #boolean ControllableAttack : (optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:TaskAttackUnit(AttackUnit, WeaponType, WeaponExpend, AttackQty, Direction, AttackQtyLimit, ControllableAttack)

(AIR) Attack the Unit.

Parameters

  • Wrapper.Unit#UNIT AttackUnit : The unit.

  • #number WeaponType : (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

  • Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend : (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

  • #number AttackQty : (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

  • Dcs.DCSTypes#Azimuth Direction : (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

  • #boolean AttackQtyLimit : (optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackControllable" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.

  • #boolean ControllableAttack : (optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:TaskBombing(Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack)

(AIR) Delivering weapon at the point on the ground.

Parameters

  • Dcs.DCSTypes#Vec2 Vec2 : 2D-coordinates of the point to deliver weapon at.

  • #number WeaponType : (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

  • Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend : (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

  • #number AttackQty : (optional) Desired quantity of passes. The parameter is not the same in AttackControllable and AttackUnit tasks.

  • Dcs.DCSTypes#Azimuth Direction : (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

  • #boolean ControllableAttack : (optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:TaskBombingRunway(Airbase, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack)

(AIR) Delivering weapon on the runway.

Parameters

  • Wrapper.Airbase#AIRBASE Airbase : Airbase to attack.

  • #number WeaponType : (optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

  • Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend : (optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

  • #number AttackQty : (optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

  • Dcs.DCSTypes#Azimuth Direction : (optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

  • #boolean ControllableAttack : (optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:TaskCombo(DCSTasks)

Return a Combo Task taking an array of Tasks.

Parameter

Return value

Dcs.DCSTasking.Task#Task:

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

Return a condition section for a controlled task.

Parameters

  • Dcs.DCSTime#Time time :

  • #string userFlag :

  • #boolean userFlagValue :

  • #string condition :

  • Dcs.DCSTime#Time duration :

  • #number lastWayPoint : return Dcs.DCSTasking.Task#Task

CONTROLLABLE:TaskControlled(DCSTask, DCSStopCondition)

Return a Controlled Task taking a Task and a TaskCondition.

Parameters

Return value

Dcs.DCSTasking.Task#Task:

CONTROLLABLE:TaskEmbarkToTransport(Point, Radius)

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

Parameters

  • Dcs.DCSTypes#Vec2 Point : The point where to wait.

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

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:TaskEmbarking(Point, Duration, EmbarkingControllable)

(AIR) Move the controllable to a Vec2 Point, wait for a defined duration and embark a controllable.

Parameters

  • Dcs.DCSTypes#Vec2 Point : The point where to wait.

  • #number Duration : The duration in seconds to wait.

  • #CONTROLLABLE EmbarkingControllable : The controllable to be embarked.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure

CONTROLLABLE:TaskEscort(EscortControllable, Vec3, LastWaypointIndex, EngagementDistanceMax, TargetTypes, FollowControllable, EngagementDistance)

(AIR) Escort another airborne controllable.

The unit / controllable will follow lead unit of another controllable, wingmens of both controllables will continue following their leaders. The unit / controllable will also protect that controllable from threats of specified types.

Parameters

  • Wrapper.Controllable#CONTROLLABLE EscortControllable : The controllable to be escorted.

  • Dcs.DCSTypes#Vec3 Vec3 : Position of the unit / lead unit of the controllable relative lead unit of another controllable in frame reference oriented by course of lead unit of another controllable. If another controllable is on land the unit / controllable will orbit around.

  • #number LastWaypointIndex : Detach waypoint of another controllable. Once reached the unit / controllable Follow task is finished.

  • #number EngagementDistanceMax : Maximal distance from escorted controllable to threat. If the threat is already engaged by escort escort will disengage if the distance becomes greater than 1.5 * engagementDistMax.

  • Dcs.DCSTypes#AttributeNameArray TargetTypes : Array of AttributeName that is contains threat categories allowed to engage.

  • FollowControllable :

  • EngagementDistance :

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:TaskFAC_AttackGroup(AttackGroup, WeaponType, Designation, Datalink)

(AIR + GROUND) The task makes the controllable/unit a FAC and orders the FAC to control the target (enemy ground controllable) destruction.

The killer is player-controlled allied CAS-aircraft that is in contact with the FAC. If the task is assigned to the controllable lead unit will be a FAC.

Parameters

  • Wrapper.Controllable#CONTROLLABLE AttackGroup : Target CONTROLLABLE.

  • #number WeaponType : Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

  • Dcs.DCSTypes#AI.Task.Designation Designation : (optional) Designation type.

  • #boolean Datalink : (optional) Allows to use datalink to send the target information to attack aircraft. Enabled by default.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:TaskFireAtPoint(Vec2, Radius, AmmoCount)

(GROUND) Fire at a VEC2 point until ammunition is finished.

Parameters

  • Dcs.DCSTypes#Vec2 Vec2 : The point to fire at.

  • Dcs.DCSTypes#Distance Radius : The radius of the zone to deploy the fire at.

  • #number AmmoCount : (optional) Quantity of ammunition to expand (omit to fire until ammunition is depleted).

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:TaskFollow(FollowControllable, Vec3, LastWaypointIndex)

(AIR) Following another airborne controllable.

The unit / controllable will follow lead unit of another controllable, wingmens of both controllables will continue following their leaders. If another controllable is on land the unit / controllable will orbit around.

Parameters

  • Wrapper.Controllable#CONTROLLABLE FollowControllable : The controllable to be followed.

  • Dcs.DCSTypes#Vec3 Vec3 : Position of the unit / lead unit of the controllable relative lead unit of another controllable in frame reference oriented by course of lead unit of another controllable. If another controllable is on land the unit / controllable will orbit around.

  • #number LastWaypointIndex : Detach waypoint of another controllable. Once reached the unit / controllable Follow task is finished.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

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

Parameters

  • WayPoint :

  • WayPointIndex :

  • FunctionString :

  • FunctionArguments :

CONTROLLABLE:TaskHold()

(GROUND) Hold ground controllable from moving.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:TaskHoldPosition(Duration)

(AIR) Hold position at the current position of the first unit of the controllable.

Parameter

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

Return value

#CONTROLLABLE: self

CONTROLLABLE:TaskLandAtVec2(Point, Duration)

(AIR HELICOPTER) Landing at the ground.

For helicopters only.

Parameters

  • Dcs.DCSTypes#Vec2 Point : The point where to land.

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

Return value

#CONTROLLABLE: self

CONTROLLABLE:TaskLandAtZone(Zone, Duration, RandomPoint)

(AIR) Land the controllable at a @{Core.Zone#ZONE_RADIUS).

Parameters

  • Core.Zone#ZONE Zone : The zone where to land.

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

  • RandomPoint :

Return value

#CONTROLLABLE: self

CONTROLLABLE:TaskMission(TaskMission)

(AIR + GROUND) Return a mission task from a mission template.

Parameter

  • #table TaskMission : A table containing the mission task.

Return value

Dcs.DCSTasking.Task#Task:

CONTROLLABLE:TaskOrbitCircle(Altitude, Speed)

(AIR) Orbit at the current position of the first unit of the controllable at a specified alititude.

Parameters

  • #number Altitude : The altitude to hold the position.

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

Return value

#CONTROLLABLE: self

CONTROLLABLE:TaskOrbitCircleAtVec2(Point, Altitude, Speed)

(AIR) Orbit at a specified position at a specified alititude during a specified duration with a specified speed.

Parameters

  • Dcs.DCSTypes#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

#CONTROLLABLE: self

CONTROLLABLE:TaskRefueling()

(AIR) Refueling from the nearest tanker.

No parameters.

Return value

Dcs.DCSTasking.Task#Task: The DCS task structure.

CONTROLLABLE:TaskRoute(Points)

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

Parameter

  • #table Points : A table of route points.

Return value

Dcs.DCSTasking.Task#Task:

CONTROLLABLE:TaskRouteToVec2(Point, Speed)

(AIR + GROUND) Make the Controllable move to fly to a given point.

Parameters

  • Dcs.DCSTypes#Vec3 Point : The destination point in Vec3 format.

  • #number Speed : The speed to travel.

Return value

#CONTROLLABLE: self

CONTROLLABLE:TaskRouteToVec3(Point, Speed)

(AIR + GROUND) Make the Controllable move to a given point.

Parameters

  • Dcs.DCSTypes#Vec3 Point : The destination point in Vec3 format.

  • #number Speed : The speed to travel.

Return value

#CONTROLLABLE: self

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

(AIR + GROUND) Route the controllable to a given zone.

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

Parameters

  • Core.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.

CONTROLLABLE:TaskWrappedAction(DCSCommand, Index)

Return a WrappedAction Task taking a Command.

Parameters

Return value

Dcs.DCSTasking.Task#Task:

CONTROLLABLE:WayPointExecute(WayPoint, 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 controllable will be 1!

Parameters

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

  • #number WaitTime : The amount seconds to wait before initiating the mission.

Return value

#CONTROLLABLE:

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

Registers a waypoint function that will be executed when the controllable 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 controllable moves over the waypoint. The waypoint function takes variable parameters.

  • ... :

Return value

#CONTROLLABLE:

CONTROLLABLE.WayPointFunctions
CONTROLLABLE:WayPointInitialize(WayPoints)

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

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

Parameter

  • #table WayPoints : If WayPoints is given, then use the route.

Return value

#CONTROLLABLE:

CONTROLLABLE.WayPoints
CONTROLLABLE:_GetController()

Get the controller for the CONTROLLABLE.

Return value

Dcs.DCSController#Controller:

Type DCSCommand

Type DCSStopCondition

Type list