Controller

Home > Support > Technical questions > DCS: World Scripting Engine > Part 2 > Classes > Controller

Controller

Controller

Controller is an object that performs A.I.-routines. Other words controller is an instance of A.I.. Controller stores current main task, active enroute tasks and behavior options. Controller performs commands.

Please, read DCS A-10C GUI Manual EN.pdf chapter "Task Planning for Unit Groups", page 91 to understand A.I. system of DCS:A-10C.

 function Controller.setOnOff(Controller self, boolean value) 

enables and disables the controller.

Note: Now it works only for ground / naval groups!

value

  • Enable / disable.

Tasks

 function Controller.setTask(Controller self, Task task) 

resets current task and then sets the task to the controller. Task is a table that contains task identifier and task parameters.

 function Controller.resetTask(Controller self) 

resets current task of the controller

Common task format is:

Task = {
  id = string, 
  params = { 
  } 
} 
  • id

String task identifier.

 function Controller.pushTask(Controller self, Task task) 

pushes the task to the front of the queue and makes the task active. Further call of function Controller.setTask() function will stop current task, clear the queue and set the new task active. If the task queue is empty the function will work like function Controller.setTask() function.

 function Controller.popTask(Controller self) 

pops current (front) task from the queue and makes active next task in the queue (if exists). If no more tasks in the queue the function works like function Controller.resetTask() function. Does nothing if the queue is empty.

 boolean function Controller.hasTask(Controller self) 

returns true if the controller has a task.

Main Tasks

Tasks for airborne units/groups

1. NoTask

An empty task. It finished just being started.

 NoTask = { 
   id = 'NoTask', 
   params = { 
   } 
 } 

2. AttackGroup

Attacking the target group (airborne, ground or naval).

 AttackGroup = { 
   id = 'AttackGroup', 
   params = { 
     groupId = Group.ID,
     weaponType = number,
     expend = enum AI.Task.WeaponExpend,
     attackQty = number,
     directionEnabled = boolean,
     direction = Azimuth,
     altitudeEnabled = boolean,
     altitude = Distance,
     attackQtyLimit = boolean,
   } 
 }

groupId

  • Inner unique identifier of the group to attack.

weaponType (optional)

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

Weapon flags are enlisted in Weapon.flag table.

  • expend (optional)

Determines how much weapon will be released at each attack. If parameter is not defined the unit / group will choose expend on its own discretion.

  • attackQty (optional)

This parameter limits maximal quantity of attack. The aicraft/group will not make more attack than allowed even if the target group not destroyed and the aicraft/group still have ammo. If not defined the aircraft/group will attack target until it will be destroyed or until the aircraft/group will run out of ammo.

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

Note: this looks like not a good solution. It would be better to have two number parameters: required parameter attackQty for "Bombing" and "BombingRunway" tasks and attackQtyLimit for "AttackGroup" and "AttackUnit" tasks.

  • directionEnabled

Indicates ingress direction is defined.

  • direction (optional)

Desired ingress direction from the target to the attacking aircraft. Group/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain group/aircraft will choose another direction.

  • altitudeEnabled

Indicates attack start altitude is defined.

  • direction (optional)

Desired attack start altitude. Group/aircraft will make its attacks from the altitude. If the altitude is too low or too high to use weapon aircraft/group will choose closest altitude to the desired attack start altitude. If the desired altitude is defined group/aircraft will not attack from safe altitude.

3. AttackUnit

Attacking the target (airborne, ground or naval).

AttackUnit = { 
  id = 'AttackUnit', 
  params = { 
    unitId = Unit.ID, 
    weaponType = number, 
    expend = enum AI.Task.WeaponExpend
    attackQty = number, 
    direction = Azimuth, 
    attackQtyLimit = boolean, 
    groupAttack = boolean, 
  } 
} 

The task has the same parameters of AttackGroup, but has unitId parameter instead of groupId and additional parameter groupAttack.

  • unitId

Inner unique identifier of the unit to attack.

  • groupAttack (optional)

Flag indicates that the target must be engaged by all aircrafts of the group. Has effect only if the task is assigned to a group, not to a single aircraft.

4. Bombing

Delivering weapon at the point on the ground.

Bombing = { 
  id = 'Bombing', 
  params = { 
    point = Vec2,
    weaponType = number, 
    expend = enum AI.Task.WeaponExpend,
    attackQty = number, 
    direction = Azimuth, 
    groupAttack = boolean, 
  } 
} 

The task has the same parameters of AttackUnit task, but has parameters point instead of unitId, plus attackQty and minus attackQtyLimit parameters.

point

  • 2D-coordinates of the point to deliver weapon at.

attackQty

  • Desired quantity of passes. The parameter is not the same in AttackGroup and AttackUnit tasks.

5. AttackMapObject

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

AttackMapObject = { 
  id = 'AttackMapObject', 
  params = { 
    point = Vec2,
    weaponType = number, 
    expend = enum AI.Task.WeaponExpend,
    attackQty = number, 
    direction = Azimuth, 
    groupAttack = boolean, 
  } 
} 

The task has the same parameters AttackUnit task has, but has parameters point instead of unitId.

point

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

6. BombingRunway

Delivering weapon on the runway.

 BombingRunway = { 
   id = 'BombingRunway', 
   params = { 
     runwayId = AirdromeId, 
     weaponType = number, 
     expend = enum AI.Task.WeaponExpend,
     attackQty = number, 
     direction = Azimuth, 
     groupAttack = boolean, 
   } 
 }

The task has the same parameters Bombing task has, but has parameter runwayId instead of point.

runwayId

  • Numeric identifier of the airdrome.

attackQty

  • Desired quantity of attack of the point. The parameter is not the same in AttackGroup and AttackUnit tasks.

7. Orbit

Flying orbit.

Orbit = { 
  id = 'Orbit', 
  params = { 
    pattern = enum AI.Task.OribtPattern,
    point = Vec2,
    point2 = Vec2,
    speed = Distance,
    altitude = Distance
  } 
}

pattern

  • String identifier of orbit pattern. Pattern constants: "Circle", "Race-Track".

point (optional)

  • 2D-coordinates of the orbit point. If not defined position of the current waypoint will be used.

speed (optional)

  • Desired aircraft(s) speed. If not defined 1.5 * stall velocity will be used.

altitude (optional)

  • Desired orbit altitude. If not defined altitude of the current waypoint will be used.

point2 (optional)

  • Second point for Race-Rrack orbit pattern. If not defined the next waypoint position will be used.

Orbit Patterns.

  • Circle. Aircraft will stay in left turn. The center of circle-shaped trajectory is anchored to point.
  • Race-Track. The trajectory consists of two parallel legs and 180-degrees left turns on each side of the legs. Race-track trajectory is defined by a two 2D-points those form the right leg. The first point is point, the second point is point2.

speed and altitude are an optional parameters. If not defined aircraft will fly orbit at altitude of first waypoint and with speed equal 1.5 of stall airspeed.

8. Refueling

Refueling from the nearest tanker. No parameters.

 Refueling = { 
   id = 'Refueling', 
   params = {} 
 }

9. Land

Landing at the ground. For helicopters only.

 Land = {
   id= 'Land',
   params = {
     point = Vec2,
     durationFlag = boolean,
     duration = Time
   }
 }

point

  • The point to land at.

durationFlag

  • The flag specifies is time on land is limited or not.

duration

  • Time on land. Has effect only if durationFlag is true.

10. Follow

Following another airborne group. The unit / group will follow lead unit of another group, wingmens of both groups will continue following their leaders. If another group is on land the unit / group will orbit around.

 Follow = {
   id = 'Follow',
   params = {
     groupId = Group.ID,
     pos = Vec3,
     lastWptIndexFlag = boolean,
     lastWptIndex = number
   }    
 }

groupId

  • Itendificator of the group to follow to.

pos

  • Position of the unit / lead unit of the group relative lead unit of another group in frame reference oriented by course of lead unit of another group. If another group is on land the unit / group will orbit around.

lastWptIndexFlag

  • The flag indicates the unit / group will follow another group until another group reach specified waypoint.

lastWptIndex

  • Detach waypoint of another group. Once reached the unit / group Follow task is finished.

11. Escort

Escort another airborne group. The unit / group will follow lead unit of another group, wingmens of both groups will continue following their leaders. The unit / group will also protect that group from threats of specified types.

 Escort = {
   id = 'Escort',
   params = {
     groupId = Group.ID,
     pos = Vec3,
     lastWptIndexFlag = boolean,
     lastWptIndex = number,
     engagementDistMax = Distance,
     targetTypes = array of AttributeName
   }
 }

The parameters are the same Follow task has, but plus 2 additional:

engagementDistMax

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

targetTypes

  • Array of AttributeName that is contains threat categories allowed to engage.

12. Mission

Mission is a complex task. Performing the Mission means flying the route and performing tasks at each waypoint of the route.

 Mission = { 
   id = 'Mission', 
   params = { 
     route = { 
       points = { 
         [1] = { 
           type = enum AI.Task.WaypointType, 
           airdromeId = Airbase.ID, 
           helipadId = Airbase.ID, 
           action = enum AI.Task.TurnMethod, 
           x = Distance, 
           y = Distance, 
           alt = Distance, 
           alt_type = enum AI.Task.AltitudeType, 
           speed = Distance, 
           speed_locked = boolean, 
           ETA = Time, 
           ETA_locked = boolean, 
           name = string, 
           task = Task 
         }, 
         [2] = { 
           ... 
         }, 
         ... 
         [N]= { 
           ... 
         } 
       } 
     }, 
   } 
 } 

route

  • Table that stores route data such as waypoints, destination airdrome. To understand route structure please, read DCS A-10C GUI Manual EN.pdf chapter "Group Route Planning", page 94.
points
  • Waypoints of the route.
type
  • Waypoint type.
airdromeId
  • identifier of the airdrome to land. Has effect only if waypoint type is "Land".
helipadId
  • Inner unique identifier of helipad or ship to land. Has effect only if waypoint type is "Land".
action
  • Turn method.
x, y
  • 2D-coordinates of the waypoint.
alt
  • Altitude assigned to the waypoint. The aircraft(s) will climb/descent to reach the waypoint at asigned altitude.
alt_type
  • Type of altitude assigned to the waypoint.
speed
  • True airspeed assigned to the waypoint. Has effect only if speed_locked is true.
speed_locked
  • Flag that means the true airspeed is assigned to the waypoint and the aircraft(s) will keep it on its way to the waypoint.
ETA
  • Time-On-Target of the waypoint. Has effect only if ETA_locked is true.
ETA_locked
  • Flag that means that the Time-On-Target is assigned to the waypoint and the aircraft(s) will adjust its airspeed to reach the waypoint at assigned time.
name
  • Helper in Mission Editor. Has no effect in simulator.
task
  • Task that must be performed when aircraft/air group will passed over the waypoint.

Tasks for ground units

1. FireAtPoint

Firing at point until there is ammo.

 FireAtPoint = { 
   id = 'FireAtPoint', 
   params = { 
     point = Vec2,
     radius = Distance, 
   } 
 }

point

  • 2-D coordinates of the point to fire at.

radius (optional)

  • Radius of the zone to fire at. If the radius is defined the vehicle group will fire at random places within the radius and fire at point otherwise.

2. Hold

Not moving. No parameters.

 Hold = { 
   id = 'Hold', 
   params = { 
   } 
 }

3. Mission

Mission is a complex task. Performing the Mission means following the route and performing tasks at each waypoint of the route.

 Mission = { 
   id = 'Mission', 
   params = { 
     route = { 
       points = { 
         [1] = {
           action = enum AI.Task.VehicleFormation,
           x = Distance, 
           y = Distance, 
           speed = Distance,
           ETA = Time,
           ETA_locked = boolean,
           name = string, 
           task = Task 
         }, 
         [2] = { 
           ... 
         }, 
         ... 
         [N]= { 
           ... 
         } 
       } 
     }, 
   } 
 }

route

  • Table that stores route data such as waypoints, destination airdrome. To understand route structure please read DCS A-10C GUI Manual EN.pdf chapter "Group Route Planning", page 94.

points

  • Waypoints of the route.
Waypoint
action
  • Vehicle formation:
x, y
  • 2D-coordinates of the waypoint.
speed
  • Speed assigned to the waypoint. Has effect only if speed_locked is true.
ETA
  • Required/estimated time of arrival. If ETA_locked is true ETA is required time of arrival and group will adjust its speed to arrive at the waypoint at the given time. Estimated time of arrival has sense only for Mission Editor.
ETA_locked
  • Indicates is ETA required or estimated time of arrival.
name
  • Helper in Mission Editor. Has no effect in simulator.
task
  • Task that must be performed when unit/group will passed the waypoint.

Tasks for airborne and group units/groups

1. FAC_AttackGroup

The task makes the group/unit a FAC and orders the FAC to control the target (enemy ground group) destruction. The killer is player-controlled allied CAS-aircraft that is in contact with the FAC.

If the task is assigned to the group lead unit will be a FAC.

 FAC_AttackGroup = { 
   id = 'FAC_AttackGroup', 
   params = { 
     groupId = Group.ID,
     weaponType = number,
     designation = enum AI.Task.Designation,
     datalink = boolean
   } 
 }
  • groupId
  • Target group identifier.

weaponType (optional)

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

Weapon flags are enlisted in Weapon.flag table.

designation (optional)

  • Designation type.

datalink (optional)

  • Allows to use datalink to send the target information to attack aircraft. Enabled by default.

Enroute tasks

En-route tasks for airborne units/groups

1. EngageTargets

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.

Engaging a targets of defined types.

 EngageTargets ={ 
   id = 'EngageTargets', 
   params = { 
     maxDist = Distance, 
     targetTypes = array of AttributeName, 
     priority = number 
   } 
 }

maxDist

  • Maximal distance from the target to a route leg. If the target is on a greater distance it will be ignored.

targetTypes

  • Array of target categories allowed to engage.

2. EngageTargetsInZone

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

 EngageTargetsInZone = { 
   id = 'EngageTargetsInZone', 
   params = { 
     point = Vec2, 
     zoneRadius = Distance, 
     targetTypes = array of AttributeName,  
     priority = number 
   }
 }

point

  • 2D-coordinates of the zone.

zoneRadius

  • Radius of the zone.

targetTypes

  • Array of target categories allowed to engage.

3. Engage Group

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

 EngageGroup = { 
   id = 'EngageGroup', 
   params = { 
     groupId = Group.ID, 
     weaponType = number, 
     expend = enum AI.Task.WeaponExpend, 
     attackQty = number, 
     direction = Azimuth, 
     attackQtyLimit = boolean, 
     priority = number 
   } 
 } 

The task has same parameters of AttackGroup task, plus priority.

4. EngageUnit

Engaging an unit. By this task you do not assign the target to the unit/group to attack now, you just allow the unit/group to engage the target as well as other assigned targets.

 EngageUnit = { 
   id = 'EngageUnit', 
   params = { 
     unitId = UnitId, 
     weaponType = number, 
     expend = enum AI.Task.WeaponExpend, 
     attackQty = number, 
     direction = Azimuth, 
     attackQtyLimit = boolean, 
     groupAttack = boolean, 
     priority = number 
   } 
 }

The task has same parameters of AttackUnit task, plus priority.

5. AWACS

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

 AWACS = { 
   id = 'AWACS', 
   params = { 
   } 
 }

6. Tanker

Aircraft will act as a tanker for friendly units. No parameters.

 Tanker = { 
   id = 'Tanker', 
   params = { 
   } 
 }

En-route tasks for ground units/groups

1. EWR

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

 EWR = { 
   id = 'EWR', 
   params = { 
   } 
 }

En-route tasks for airborne and ground units/groups

1. FAC_EngageGroup

The task makes the group/unit a FAC and lets the FAC to choose the target (enemy ground group) 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 group lead unit will be a FAC.

 FAC_EngageGroup = { 
   id = 'FAC_AttackGroup', 
   params = { 
     groupId = Group.ID,
     weaponType = number,
     designation = enum AI.Task.Designation,
     datalink = boolean,
     priority = number
   } 
 }

The parameters are the same FAC_AttackGroup task has plus priority.

2. FAC

The task makes the group/unit a FAC andlets the FAC to choose a targets (enemy ground group) 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 group lead unit will be a FAC.

 FAC = { 
   id = 'FAC', 
   params = { 
     radius = Distance,
     priority = number
   } 
 }

radius

  • The maximal distance from the FAC to a target.

Special Tasks

1. Controlled Task

This is a wrapper for a task that makes possible to assign special conditions to stop a task.

 ControlledTask = { 
   id = 'ControlledTask', 
   params = { 
     task = Task, 
     stopCondition = StopCondition, 
   } 
 }

StopCondition consists of several sub-conditions. Each sub-condition is optional. If at least one of the conditions has met, the task will be stopped. All the sub-conditions will being checked periodically.

 StopCondition = { 
   time = Time, 
   userFlag = string, 
   userFlagValue = boolean, 
   condition = string, 
   duration = Time, 
   lastWaypoint = number, 
 }

time (optional)

  • Time of the task finish. If the time is defined, the condition will be met if the current time is greater than the time.

or

User Flag (optional).

userFlag

  • Name of the user flag.

userFlagValue

  • Value of the user flag

The condition will be met only is the userFlag has value that equals to userFlagValue.

or

condition (optional)

  • Lua code that will be wrapped into the function that returns boolean type.
 function [generated name]() 
   return [Lua code] 
 end

The condition will be met when the function will return true.

or

duration (optional)

  • Limit on task duration. The condition will be met when the task duration will become greater than duration.

or

lastWaypoint (optional)

  • Last waypoint where the task will still active. Used for enroute tasks only. The condition will be met if the group/unit switched to the next waypoint after lastWaypoint.

2. Combo Task

Combo Task is a list of actions to run them in the order they are enlisted.

 ComboTask = { 
   id = 'ComboTask', 
   params = { 
     tasks = { 
       [1] = Task, 
       [2] = Task, 
       ... 
       [N] = Task 
     } 
   } 
 } 

The task may be useful if it is necessary to assign list of actions to the group/unit. For example, actions list created for the waypoint in Mission Editor is a Combo Task. It is only possible to fill Combo Task with tasks. To fill the Combo Task with Commands and Behavior Options you should use Wrapped Action task.

3. Wrapped Action

A command wrapped into task. This construction may be useful in ComboTask.

 WrappedAction = { 
   id = 'WrappedAction', 
   params = { 
     action = Command 
   }
 }

Commands

Commands are instant actions those required zero time to perform. Commands may be used both for control unit/group behavior and control game mechanics.

 function Controller.setCommand(Controller self, Command command) 

sets the command to perform by controller.

Command

 Table that contains command identifier and command parameters. 

Commands have following format

 Command = { 
   id = string, 
   params = { 
   } 
 }

id is a string identifier of the command

1. No Action

Empty action. No parameters.

 NoAction = { 
   id = 'NoAction', 
   params = { 
   } 
 }

2. Script

Runs Lua-script.

 Script = { 
   id = 'Script', 
   params = { 
     command = string  
   } 
 }

command

  • String that contains Lua code

3. Set callsign

Sets callsign to the group. It is only valid for western groups those have hierarchic callsigns: [group callname][flight number][aircraft number]. You can change [group callname][flight number] part of callsign for all aircraft in the group of for single aircraft.

 SetCallsign = { 
   id = 'SetCallsign', 
   params = { 
     callname = number, 
     number = number, 
   } 
 }

callname

  • Numeric group callname identifier. Note that the different group callnames can have same identifier, but there are no conflicts because these callnames cannot be used by unit of same type. Callnames are enlisted in ./Scripts/Database/db_callnames.Lua.

Aircrafts

Callname Identifier
Enfield 1
Springfield 2
Uzi 3
Colt 4
Dodge 5
Ford 6
Chevy 7
Pontiac 8
Hawg 9
Boar 10
Pig 11
Tusk 12

AWACS

Callname Identifier
Overlord 1
Magic 2
Wizard 3
Focus 4
Darkstar 5

Tanker

Callname Identifier
Texaco 1
Arco 2
Shell 3

Ground JTAC

Callname Identifier
Axeman 1
Darknight 2
Warrior 3
Pointer 4
Eyeball 5
Moonbeam 6
Whiplash 7
Finger 8
Pinpoint 9
Ferret 10
Shaba 11
Playboy 12
Hammer 13
Jaguar 14
Deathstar 15
Anvil 16
Firefly 17
Mantis 18
Badger 19

number

  • Flight number.

4. Set frequency

Sets frequency and modulation to the unit's radio or to the radio of each unit in the group.

 SetFrequency = { 
   id = 'SetFrequency', 
   params = { 
     frequency = number, 
     modulation = enum radio.modulation, 
   } 
 }

modulation

  • Modulation of the radio.

frequency

  • Frequency of the radio in Hz.

5. Switch waypoint

Switches current leg of the route. Has effect only if the "Mission" task is active.

 SwitchWaypoint = { 
   id = 'SwitchWaypoint', 
   params = { 
     fromWaypointIndex = number,  
     goToWaypointIndex = number, 
   } 
 } 

New leg is defined by a two parameters:

fromWaypointIndex

  • Index of the waypoint "from" of the new route leg.

goToWaypointIndex

  • Index of the waypoint "to" of the new route leg.


6. Stop route

Stops / resumes following the route. Has effect only if the "Mission" task is active.

 StopRoute = { 
   id = 'StopRoute', 
   params = { 
     value = boolean, 
   } 
 }

value

  • Stops (true) or resumes (false) following the route.

7. Switch action

Switches to an another action of the actions list of the waypoint. Has effect only if the "Mission" task is active.

 SwitchAction = { 
   id = 'SwitchAction', 
   params = { 
     actionIndex = number, 
   }   
 }

actionIndex

  • Index of the action to switch to. Actions are enumerated from 1 to N.

8. Invisible

Makes the unit/group invisible for enemy A.I.

 SetInvisible = { 
   id = 'SetInvisible', 
   params = { 
     value = boolean 
   } 
 }

value

  • Invisible status.

9. Immortal

Makes the unit/group immortal.

 SetImmortal = { 
   id = 'SetImmortal', 
   params = { 
     value = boolean 
   } 
 }

value

  • Immortal status

10. Activate beacon

Activates the beacon onboard the aircraft or onboard first aircraft of the group. Note that the only one beacon can be activate at the same time. If you activated new beacon having another beacon active that old beacon will be deactivated.

 ActivateBeacon = { 
   id = 'ActivateBeacon', 
   params = { 
     type = number, 
     system = number, 
     name = string, 
     callsign = string, 
     frequency = number, 
   } 
 }

type

  • Beacon type. The constants are enlisted in ./Scripts/World/Radio/BeaconTypes.Lua
 BEACON_TYPE_NULL = 0 
 BEACON_TYPE_VOR = 1 
 BEACON_TYPE_DME = 2 
 BEACON_TYPE_VOR_DME = 3 
 BEACON_TYPE_TACAN = 4 
 BEACON_TYPE_VORTAC = 5 
 BEACON_TYPE_RSBN = 32 
 BEACON_TYPE_BROADCAST_STATION = 1024 
 BEACON_TYPE_HOMER = 8 
 BEACON_TYPE_AIRPORT_HOMER = 4104 
 BEACON_TYPE_AIRPORT_HOMER_WITH_MARKER = 4136 
 BEACON_TYPE_ILS_FAR_HOMER = 16408 
 BEACON_TYPE_ILS_NEAR_HOMER = 16456 
 BEACON_TYPE_ILS_LOCALIZER = 16640 
 BEACON_TYPE_ILS_GLIDESLOPE = 16896 
 BEACON_TYPE_NAUTICAL_HOMER = 32776

system

  • Determines what device(s) will be used. System constants are enlisted in ./Scripts/World/Radio/BeaconSites.Lua in table SystemName.
 SystemName = { 
   PAR_10 = 1, 
   RSBN_5 = 2, 
   TACAN = 3, 
   TACAN_TANKER = 4, 
   ILS_LOCALIZER = 5, 
   ILS_GLIDESLOPE = 6, 
   BROADCAST_STATION = 7 
 }

name

  • Helper in Mission Editor. Has no effect in simulator.

callsign

  • Beacon identifier that will being broadcasting in Morse code.

frequency

  • Frequency of the beacon's transmitter(s) in Hz.

11. Deactivate beacon

Deactivates beacon onboard the unit. If it is a group the beacon will be activated onboard a first unit of the group. No parameters.

 { 
   id = 'DeactivateBeacon', 
   params = { 
   } 
 }

12. EPLRS

Sets parameters of EPLRS datalink of the unit/group. If EPLRS command called for the airborne group then all aircrafts of the group will be affected. If EPLRS command called for vehicle group then only the first unit of the group will be affected. You can switch EPLRS on/off and change track number of the first unit of the vehicle group.

 { 
   id = 'EPLRS', 
   params = { 
     value = boolean, 
     groupId = number, 
   } 
 }

value

  • EPLRS status.

groupId

  • Track number of the first unit of the vehicle group. Used only for vehicle group.

Behavior options

Option is a pair of identifier and value. Behavior options are global parameters those affect controller behavior in all tasks it performs.

Option identifiers and values are stored in table AI.Option in subtables Air, Ground and Naval.

 OptionId = AI.Option.Air.id or AI.Option.Ground.id or AI.Option.Naval.id
 OptionValue = AI.Option.Air.val[optionName] or AI.Option.Ground.val[optionName] or AI.Option.Naval.val[optionName]
 function Controller.setOption(Controller self, OptionId optionId, OptionValue optionValue) 

sets the option to the controller.

optionId

  • Option identifier.

optionValue

  • Value of the option

Airborne units

Option Values
AI.Option.Air.id.NO_OPTION
AI.Option.Air.id.ROE AI.Option.Air.val.ROE.WEAPON_FREE

AI.Option.Air.val.ROE.OPEN_FIRE_WEAPON_FREE

AI.Option.Air.val.ROE.OPEN_FIRE

AI.Option.Air.val.ROE.RETURN_FIRE

AI.Option.Air.val.ROE.WEAPON_HOLD

AI.Option.Air.id.REACTION_ON_THREAT AI.Option.Air.val.REACTION_ON_THREAT.NO_REACTION

AI.Option.Air.val.REACTION_ON_THREAT.PASSIVE_DEFENCE

AI.Option.Air.val.REACTION_ON_THREAT.EVADE_FIRE

AI.Option.Air.val.REACTION_ON_THREAT.BYPASS_AND_ESCAPE

AI.Option.Air.val.REACTION_ON_THREAT.ALLOW_ABORT_MISSION

AI.Option.Air.id.RADAR_USING AI.Option.Air.val.RADAR_USING.NEVER

AI.Option.Air.val.RADAR_USING.FOR_ATTACK_ONLY

AI.Option.Air.val.RADAR_USING.FOR_SEARCH_IF_REQUIRED

AI.Option.Air.val.RADAR_USING.FOR_CONTINUOUS_SEARCH

AI.Option.Air.id.FLARE_USING AI.Option.Air.val.FLARE_USING.NEVER

AI.Option.Air.val.FLARE_USING.AGAINST_FIRED_MISSILE

AI.Option.Air.val.FLARE_USING.WHEN_FLYING_IN_SAM_WEZ

AI.Option.Air.val.FLARE_USING.WHEN_FLYING_NEAR_ENEMIES

AI.Option.Air.id.FORMATION complex option. See the description below.
AI.Option.Air.id.RTB_ON_BINGO true

false

AI.Option.Air.id.SILENCE true

false

Ground units

Option Values
AI.Option.Ground.id.NO_OPTION
AI.Option.Ground.id.ROE AI.Option.Ground.val.ROE.OPEN_FIRE

AI.Option.Ground.val.ROE.RETURN_FIRE

AI.Option.Ground.val.ROE.WEAPON_HOLD

AI.Option.Ground.id.DISPERSE_ON_ATTACK true

false

AI.Option.Ground.id.ALARM_STATE AI.Option.Ground.val.ALARM_STATE.AUTO,

AI.Option.Ground.val.ALARM_STATE.GREEN

AI.Option.Ground.val.ALARM_STATE.RED

Naval units

Option Values
AI.Option.Naval.id.NO_OPTION
AI.Option.Naval.id.ROE AI.Option.Naval.val.ROE.OPEN_FIRE

AI.Option.Naval.val.ROE.RETURN_FIRE

AI.Option.Naval.val.ROE.WEAPON_HOLD

Formation

Formation is a complex parameter that consists of 3 sub-parameters: formation type, formation variant and formation orientation (left/right). Each sub-parameter is represented by a number. These three numbers are packed into a single number - the formation code.

Note: it is not an elegant solution, but we have a limitation here - option value may be a number or boolean. May be it will be reworked later.

[4 bytes formation code] = [2 bytes - formation type][1 byte - formation orientation][1 byte - formation variant]

Formations are enlisted in ./Scripts/Database/db_formations.Lua.

Formation type identifiers

 local id = { 
   NO_FORMATION    = 0, 
   --airplanes 
   LINE_ABREAST    = 1, 
   TRAIL           = 2, 
   WEDGE           = 3, 
   ECHELON_RIGHT   = 4, 
   ECHELON_LEFT    = 5, 
   FINGER_FOUR     = 6, 
   SPREAD_FOUR     = 7, 
   --helicopters 
   HEL_WEDGE       = 8, 
   HEL_ECHELON     = 9, 
   HEL_FRONT       = 10, 
   HEL_COLUMN      = 11, 
   -- 
   MAX             = 12 
 }

Formation orientation

Default orientation of each formation type determines by a formation geometry given in the script. All existed formation types have right orientation. To inverse orientation (to the left) the value of formation orientation sub-parameter must be 1.

Formation variant

Some formation types have several variants usually different by a density. Variants are enumerated from 1 to N. If the variant is 0 then default variant will be used.

Airplane formations "Trail", "Wedge", "Echelon Right", "Echelon Left", "Finger Four", "Spred Four" have two variants: "Open" and "Close" (default) and have no variable orientation. Helicopter formation "Echelon" has three variants "50x70", "50x300" (default), "50x600" and has variable orientation. Helicopter formation "Front" has three variants: "interval 300" (default), "interval 600" and has variable orientation. All other formations have no variants and no variable orientation.

FOLLOW US