Module DCSController
Global(s)
| Controller |
Type Controller
| Controller.Detection |
Enum contains identifiers of surface types. |
| Controller:getDetectedTargets(detection) |
Returns list of detected targets. |
| Controller:hasTask() |
Returns true if the controller has a task. |
| Controller:isTargetDetected(target, detection) |
Checks if the target is detected or not. |
| Controller:knowTarget(object, type, distance) |
Know a target. |
| Controller:popTask() |
Pops current (front) task from the queue and makes active next task in the queue (if exists). |
| Controller:pushTask(task) |
Pushes the task to the front of the queue and makes the task active. |
| Controller:resetTask() |
Resets current task of the controller. |
| Controller:setOnOff(value) |
Enables and disables the controller. |
| Controller:setOption(optionId, optionValue) |
Sets the option to the controller. |
| Controller:setTask(task) |
Resets current task and then sets the task to the controller. |
Type Controller.Detection
| Controller.Detection.DLINK | |
| Controller.Detection.IRST | |
| Controller.Detection.OPTIC | |
| Controller.Detection.RADAR | |
| Controller.Detection.RWR | |
| Controller.Detection.VISUAL |
Type DetectedTarget
| DetectedTarget.distance |
Distance to the target is known |
| DetectedTarget.object |
The target |
| DetectedTarget.type |
The target type is known |
| DetectedTarget.visible |
The target is visible |
Global(s)
Type DCSController
Type 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.
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.
- Controller:getDetectedTargets(detection)
-
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 detection: Controller.Detection detection1, Controller.Detection detection2, ... Controller.Detection detectionN
Return value
DetectedTarget> array of DetectedTarget
-
- Controller:hasTask()
-
Returns true if the controller has a task.
Return value
#boolean:
- Controller:isTargetDetected(target, detection)
-
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
-
Wrapper.Object#Object target: Target to check -
#Controller.Detection detection: Controller.Detection detection1, Controller.Detection detection2, ... Controller.Detection detectionN
Return values
-
#boolean: detected True if the target is detected.
-
#boolean: visible Has effect only if detected is true. True if the target is visible now.
-
#ModelTime: lastTime Has effect only if visible is false. Last time when target was seen.
-
#boolean: type Has effect only if detected is true. True if the target type is known.
-
#boolean: distance Has effect only if detected is true. True if the distance to the target is known.
-
#Vec3: lastPos Has effect only if visible is false. Last position of the target when it was seen.
-
#Vec3: lastVel Has effect only if visible is false. Last velocity of the target when it was seen.
-
- Controller:knowTarget(object, type, distance)
-
Know a target.
Parameters
-
Wrapper.Object#Object object: The target. -
#boolean type: Target type is known. -
#boolean distance: Distance to target is known.
-
- Controller:popTask()
-
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.
- Controller:pushTask(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.
Parameter
-
#Task task:
-
- Controller:resetTask()
-
Resets current task of the controller.
- Controller:setOnOff(value)
-
Enables and disables the controller.
Note: Now it works only for ground / naval groups!
Parameter
-
#boolean value: Enable / Disable.
-
- Controller:setOption(optionId, optionValue)
-
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.
-
- Controller:setTask(task)
-
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:
-
Type Controller.Detection
Enum contains identifiers of surface types.
Field(s)
Type DetectedTarget
Detected target.
Field(s)
- #boolean DetectedTarget.distance
-
Distance to the target is known
- Wrapper.Object#Object DetectedTarget.object
-
The target
- #boolean DetectedTarget.type
-
The target type is known
- #boolean DetectedTarget.visible
-
The target is visible