Module DCS.DCSController

Global(s)

Global Controller

Type(s)

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.

This class has 2 types of functions:

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

Field(s)

#Controller.Detection Controller.Detection

Enum contains identifiers of surface types.

Function(s)

Returns list of detected targets.

If one or more detection method is specified the function will return targets which were detected by at least one of these methods. If no detection methods are specified the function will return targets which were detected by any method.

Parameter:

Controller.Detection detection1, Controller.Detection detection2, ... Controller.Detection detectionN

Return value:

list<#DetectedTarget>:

array of DetectedTarget

Returns true if the controller has a task.

Return value:

boolean:

Checks if the target is detected or not.

If one or more detection method is specified the function will return true if the target is detected by at least one of these methods. If no detection methods are specified the function will return true if the target is detected by any method.

Parameters:

Target to check

Controller.Detection detection1, Controller.Detection detection2, ... Controller.Detection detectionN

Return values:
  1. boolean:

    detected True if the target is detected.

  2. boolean:

    visible Has effect only if detected is true. True if the target is visible now.

  3. #ModelTime: lastTime Has effect only if visible is false. Last time when target was seen.

  4. boolean:

    type Has effect only if detected is true. True if the target type is known.

  5. boolean:

    distance Has effect only if detected is true. True if the distance to the target is known.

  6. #Vec3: lastPos Has effect only if visible is false. Last position of the target when it was seen.

  7. #Vec3: lastVel Has effect only if visible is false. Last velocity of the target when it was seen.

Know a target.

Parameters:

The target.

#boolean type

Target type is known.

#boolean distance

Distance to target is known.

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.

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.

Parameter:
#Task task

Resets current task of the controller.

Enables and disables the controller.

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

Parameter:
#boolean value

Enable / Disable.

Sets the option to the controller.

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]

Parameters:
#OptionId optionId

Option identifier.

#OptionValue optionValue

Value of the option.

Resets current task and then sets the task to the controller.

Task is a table that contains task identifier and task parameters.

Parameter:
#Task task

Enum contains identifiers of surface types.

Field(s)

Function(s)

Detected target.

Field(s)

#boolean DetectedTarget.distance

Distance to the target is known

#boolean DetectedTarget.type

The target type is known

#boolean DetectedTarget.visible

The target is visible

Function(s)