Module Controllable

Wrapper -- CONTROLLABLE is an intermediate class wrapping Group and Unit classes "controllers".


Author: Sven Van de Velde (FlightControl)

Contributions:


Global(s)

CONTROLLABLE

CONTROLLABLE class, extends Positionable#POSITIONABLE

CONTROLLABLE is a wrapper class to handle the "DCS Controllable objects", which are Groups and Units:

  • Support all DCS Controllable APIs.

Type CONTROLLABLE

CONTROLLABLE:ClearTasks()

Clear all tasks from the controllable.

CONTROLLABLE:CommandDoScript(DoScript)

Do Script command

CONTROLLABLE:CommandStopRoute(StopRoute)

Create a stop route command, which returns a string containing the 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 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:EnRouteTaskEngageTargetsInZone(Vec2, Radius, TargetTypes, Priority)

(AIR) Engaging a targets of defined types at circle-shaped zone.

CONTROLLABLE:EnRouteTaskEngageUnit(EngageUnit, Priority, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, Visible, ControllableAttack)

(AIR) Search and 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:GetFuel()

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

CONTROLLABLE:GetLife()

Returns the health.

CONTROLLABLE:GetLife0()

Returns the initial health.

CONTROLLABLE:GetSize()
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:HasTask()

Checking the Task Queue of the controllable.

CONTROLLABLE:IsAirPlane()

Returns if the Controllable contains AirPlanes.

CONTROLLABLE:IsTargetDetected(DCSObject, DetectVisual, DetectOptical, DetectRadar, DetectIRST, DetectRWR, DetectDLINK)
CONTROLLABLE:New(ControllableName)

Create a new CONTROLLABLE from a DCSControllable

CONTROLLABLE:OptionAlarmStateAuto()

Alarm state to Auto: AI will automatically switch alarm states based on the presence of threats.

CONTROLLABLE:OptionAlarmStateGreen()

Alarm state to Green: Group is not combat ready.

CONTROLLABLE:OptionAlarmStateRed()

Alarm state to Red: Group is combat ready and actively searching for targets.

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:OptionRTBAmmo(WeaponsFlag)

Set RTB on ammo.

CONTROLLABLE:OptionRTBBingoFuel(RTB)

Set RTB on bingo fuel.

CONTROLLABLE:PatrolRoute()

(GROUND) Patrol iteratively using the waypoints the for the (parent) group.

CONTROLLABLE:PatrolRouteRandom(Speed, Formation, ToWaypoint)

(GROUND) Patrol randomly to the waypoints the for the (parent) group.

CONTROLLABLE:PatrolZones(ZoneList, Speed, Formation)

(GROUND) Patrol randomly to the waypoints the for the (parent) group.

CONTROLLABLE:PopCurrentTask()

Popping current Task from the controllable.

CONTROLLABLE:PushTask(DCSTask, WaitTime)

Pushing Task on the queue from the controllable.

CONTROLLABLE:Route(Route, DelaySeconds)

Make the controllable to follow a given route.

CONTROLLABLE:RouteAirTo(ToCoordinate, AltType, Type, Action, Speed, DelaySeconds)

Make the AIR Controllable fly towards a specific point.

CONTROLLABLE:RouteGroundTo(ToCoordinate, Speed, Formation, DelaySeconds)

Make the GROUND Controllable to drive towards a specific point.

CONTROLLABLE:RouteToVec2(Point, Speed)

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

CONTROLLABLE:RouteToVec3(Point, Speed)

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

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:SetTaskWaypoint(Waypoint, Task)

Set a Task at a Waypoint using a Route list.

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

(AIR) Attack a Controllable.

CONTROLLABLE:TaskAttackMapObject(Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, WeaponType)

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

CONTROLLABLE:TaskAttackUnit(AttackUnit, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, Visible, WeaponType)

(AIR) Attack the Unit.

CONTROLLABLE:TaskBombing(Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, WeaponType)

(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(FunctionString, ...)

This creates a Task element, with an action to call a function as part of a Wrapped Task.

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 @{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(Vec2, Speed, Formation)

(GROUND) Route the controllable to a given Vec2.

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

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

CONTROLLABLE.TaskScheduler
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: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.

Type Vec2

Vec2.x
Vec2.y

Global(s)

#CONTROLLABLE CONTROLLABLE

CONTROLLABLE class, extends Positionable#POSITIONABLE

CONTROLLABLE is a wrapper class to handle the "DCS Controllable objects", which are Groups and Units:

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

CONTROLLABLE constructor

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

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 Controllable#CONTROLLABLE.PushTask or 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.

Task assignment

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:

EnRoute assignment

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

Task preparation

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

Call a function as a Task

A function can be called which is part of a Task. The method CONTROLLABLE.TaskFunction() prepares a Task that can call a GLOBAL function from within the Controller execution. This method can also be used to embed a function call when a certain waypoint has been reached. See below the Tasks at Waypoints section.

Demonstration Mission: GRP-502 - Route at waypoint to random point

Tasks at Waypoints

Special Task methods are available to set tasks at certain waypoints. The method CONTROLLABLE.SetTaskWaypoint() helps preparing a Route, embedding a Task at the Waypoint of the Route.

This creates a Task element, with an action to call a function as part of a Wrapped Task.

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:

CONTROLLABLE Command methods

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

Routing of Controllables

Different routing methods exist to route GROUPs and UNITs to different locations:

Option methods

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

Rule of Engagement:

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

Rule on thread:

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

Type Controllable

Type CONTROLLABLE

Field(s)

CONTROLLABLE:ClearTasks()

Clear all tasks from the controllable.

Return value

#CONTROLLABLE:

CONTROLLABLE:CommandDoScript(DoScript)

Do Script command

Parameter

  • #string DoScript :

Return value

#DCSCommand:

CONTROLLABLE:CommandStopRoute(StopRoute)

Create a stop route command, which returns a string containing the command.

Use the result in the method CONTROLLABLE.SetCommand(). A value of true will make the ground group stop, a value of false will make it continue. Note that this can only work on GROUP level, although individual UNITs can be commanded, the whole GROUP will react.

Example missions:

  • GRP-310

Parameter

  • #boolean StopRoute : true if the ground unit needs to stop, false if it needs to continue to move.

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 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 "AttackGroup" 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:EnRouteTaskEngageTargetsInZone(Vec2, Radius, TargetTypes, Priority)

(AIR) Engaging a targets of defined types at circle-shaped zone.

Parameters

  • Dcs.DCSTypes#Vec2 Vec2 : 2D-coordinates of the zone.

  • Dcs.DCSTypes#Distance Radius : Radius of the zone.

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

  • #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:EnRouteTaskEngageUnit(EngageUnit, Priority, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, Visible, ControllableAttack)

(AIR) Search and attack the Unit.

Parameters

  • Wrapper.Unit#UNIT EngageUnit : The UNIT.

  • #number Priority : (optional) 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.

  • #boolean GroupAttack : (optional) If true, all units in the group will attack the Unit when found.

  • 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 altitude to perform the unit engagement.

  • #boolean Visible : (optional) Unit must be visible.

  • #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:GetFuel()

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

This method returns nil to ensure polymorphic behaviour! This method needs to be overridden by GROUP or UNIT.

Return value

#nil: The CONTROLLABLE is not existing or alive.

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:GetLife0()

Returns the initial health.

Return values

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

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

CONTROLLABLE:GetSize()
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:HasTask()

Checking the Task Queue of the controllable.

Returns false if no task is on the queue. true if there is a task.

Return value

Wrapper.Controllable#CONTROLLABLE: self

CONTROLLABLE:IsAirPlane()

Returns if the Controllable contains AirPlanes.

Return value

#boolean: true if Controllable contains AirPlanes.

CONTROLLABLE:IsTargetDetected(DCSObject, DetectVisual, DetectOptical, DetectRadar, DetectIRST, DetectRWR, DetectDLINK)

Parameters

  • DCSObject :

  • DetectVisual :

  • DetectOptical :

  • DetectRadar :

  • DetectIRST :

  • DetectRWR :

  • DetectDLINK :

CONTROLLABLE:New(ControllableName)

Create a new CONTROLLABLE from a DCSControllable

Parameter

Return value

#CONTROLLABLE: self

CONTROLLABLE:OptionAlarmStateAuto()

Alarm state to Auto: AI will automatically switch alarm states based on the presence of threats.

The AI kind of cheats in this regard.

Return value

#CONTROLLABLE: self

CONTROLLABLE:OptionAlarmStateGreen()

Alarm state to Green: Group is not combat ready.

Sensors are stowed if possible.

Return value

#CONTROLLABLE: self

CONTROLLABLE:OptionAlarmStateRed()

Alarm state to Red: Group is combat ready and actively searching for targets.

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:OptionRTBAmmo(WeaponsFlag)

Set RTB on ammo.

Parameter

  • #boolean WeaponsFlag : Weapons.flag enumerator.

Return value

#CONTROLLABLE: self

CONTROLLABLE:OptionRTBBingoFuel(RTB)

Set RTB on bingo fuel.

Parameter

  • #boolean RTB : true if RTB on bingo fuel (default), false if no RTB on bingo fuel. Warning! When you switch this option off, the airborne group will continue to fly until all fuel has been consumed, and will crash.

Return value

#CONTROLLABLE: self

CONTROLLABLE:PatrolRoute()

(GROUND) Patrol iteratively using the waypoints the for the (parent) group.

Return value

#CONTROLLABLE:

CONTROLLABLE:PatrolRouteRandom(Speed, Formation, ToWaypoint)

(GROUND) Patrol randomly to the waypoints the for the (parent) group.

A random waypoint will be picked and the group will move towards that point.

Parameters

  • Speed :

  • Formation :

  • ToWaypoint :

Return value

#CONTROLLABLE:

CONTROLLABLE:PatrolZones(ZoneList, Speed, Formation)

(GROUND) Patrol randomly to the waypoints the for the (parent) group.

A random waypoint will be picked and the group will move towards that point.

Parameters

  • ZoneList :

  • Speed :

  • Formation :

Return value

#CONTROLLABLE:

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(Route, DelaySeconds)

Make the controllable to follow a given route.

Parameters

  • #table Route : A table of Route Points.

  • #number DelaySeconds : Wait for the specified seconds before executing the Route.

Return value

#CONTROLLABLE: The CONTROLLABLE.

CONTROLLABLE:RouteAirTo(ToCoordinate, AltType, Type, Action, Speed, DelaySeconds)

Make the AIR Controllable fly towards a specific point.

Parameters

Return value

#CONTROLLABLE: The CONTROLLABLE.

CONTROLLABLE:RouteGroundTo(ToCoordinate, Speed, Formation, DelaySeconds)

Make the GROUND Controllable to drive towards a specific point.

Parameters

  • Core.Point#COORDINATE ToCoordinate : A Coordinate to drive to.

  • #number Speed : (optional) Speed in km/h. The default speed is 999 km/h.

  • #string Formation : (optional) The route point Formation, which is a text string that specifies exactly the Text in the Type of the route point, like "Vee", "Echelon Right".

  • #number DelaySeconds : Wait for the specified seconds before executing the Route.

Return value

#CONTROLLABLE: The CONTROLLABLE.

CONTROLLABLE:RouteToVec2(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:RouteToVec3(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: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:SetTaskWaypoint(Waypoint, Task)

Set a Task at a Waypoint using a Route list.

Parameters

Return value

Dcs.DCSTasking.Task#Task:

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 "AttackGroup" 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, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, WeaponType)

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

Parameters

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

  • #boolean GroupAttack : (optional) If true, all units in the group will attack the Unit when found.

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

  • #number Altitude : (optional) The altitude from where to attack.

  • #number WeaponType : (optional) The WeaponType.

Return value

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

CONTROLLABLE:TaskAttackUnit(AttackUnit, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, Visible, WeaponType)

(AIR) Attack the Unit.

Parameters

  • Wrapper.Unit#UNIT AttackUnit : The UNIT.

  • #boolean GroupAttack : (optional) If true, all units in the group will attack the Unit when found.

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

  • #number Altitude : (optional) The altitude from where to attack.

  • #boolean Visible : (optional) not a clue.

  • #number WeaponType : (optional) The WeaponType.

Return value

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

CONTROLLABLE:TaskBombing(Vec2, GroupAttack, WeaponExpend, AttackQty, Direction, Altitude, WeaponType)

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

Parameters

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

  • #boolean GroupAttack : (optional) If true, all units in the group will attack the Unit when found.

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

  • #number Altitude : (optional) The altitude from where to attack.

  • #number WeaponType : (optional) The WeaponType.

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(FunctionString, ...)

This creates a Task element, with an action to call a function as part of a Wrapped Task.

This Task can then be embedded at a Waypoint by calling the method CONTROLLABLE.SetTaskWaypoint.

Parameters

  • #string FunctionString : The function name embedded as a string that will be called.

  • ... : The variable arguments passed to the function when called! These arguments can be of any type!

Return value

#CONTROLLABLE:

Usage:


 local ZoneList = { 
   ZONE:New( "ZONE1" ), 
   ZONE:New( "ZONE2" ), 
   ZONE:New( "ZONE3" ), 
   ZONE:New( "ZONE4" ), 
   ZONE:New( "ZONE5" ) 
 }
 
 GroundGroup = GROUP:FindByName( "Vehicle" )
 
 --- @param Wrapper.Group#GROUP GroundGroup
 function RouteToZone( Vehicle, ZoneRoute )
 
   local Route = {}
   
   Vehicle:E( { ZoneRoute = ZoneRoute } )
   
   Vehicle:MessageToAll( "Moving to zone " .. ZoneRoute:GetName(), 10 )
 
   -- Get the current coordinate of the Vehicle
   local FromCoord = Vehicle:GetCoordinate()
   
   -- Select a random Zone and get the Coordinate of the new Zone.
   local RandomZone = ZoneList[ math.random( 1, #ZoneList ) ] -- Core.Zone#ZONE
   local ToCoord = RandomZone:GetCoordinate()
   
   -- Create a "ground route point", which is a "point" structure that can be given as a parameter to a Task
   Route[#Route+1] = FromCoord:WaypointGround( 72 )
   Route[#Route+1] = ToCoord:WaypointGround( 60, "Vee" )
   
   local TaskRouteToZone = Vehicle:TaskFunction( "RouteToZone", RandomZone )
   
   Vehicle:SetTaskWaypoint( Route, #Route, TaskRouteToZone ) -- Set for the given Route at Waypoint 2 the TaskRouteToZone.
 
   Vehicle:Route( Route, math.random( 10, 20 ) ) -- Move after a random seconds to the Route. See the Route method for details.
   
 end
   
   RouteToZone( GroundGroup, ZoneList[1] )
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 @{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(Vec2, Speed, Formation)

(GROUND) Route the controllable to a given Vec2.

A speed can be given in km/h. A given formation can be given.

Parameters

  • #Vec2 Vec2 : The Vec2 where to route to.

  • #number Speed : The speed.

  • Base#FORMATION Formation : The formation string.

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.TaskScheduler
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:WayPointInitialize(WayPoints)

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

Use the method 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 Vec2

Field(s)

Vec2.x
Vec2.y

Type list