dcsex.ai.tasks
DCS AI tasks.
Contents
- Description
- Functions
- _t.attackGroup(group, optionalparams)
- _t.attackMapObject(point, optionalparams)
- _t.attackUnit(unit, optionalparams)
- _t.awacs()
- _t.bombing(point, optionalparams)
- _t.bombingRunway(airbase, optionalparams)
- _t.cargoTransportation(cargo, zoneid)
- _t.carpetBombing(pt, len, optionalparams)
- _t.combo(orderedlist)
- _t.controlled(task, startcondition, stopcondition)
- _t.disembarkFromTransport(point, radius)
- _t.embarking(point, groups, duration, distribution)
- _t.embarkToTransport(point, radius)
- _t.engageGroup(group, optionalparams)
- _t.engageTargets(tgtlist, maxdist, prio)
- _t.engageTargetsInZone(tgtlist, pt, radius, prio)
- _t.engageUnit(unit, optionalparams)
- _t.follow(group, pos, wptidx)
- _t.escort(group, pos, engagedist, tgtlist, wptidx)
- _t.escortGround(group, pos, orbitdist, tgtlist, wptidx)
- _t.ewr()
- _t.fac(freq, mod, callid, callnum, prio)
- _t.facAttackGroup(group, wpnType, designation, datalink, freq, mod, callid, callnum)
- _t.facEngageGroup(group, wpnType, designation, datalink, freq, mod, callid, callnum, prio)
- _t.fireAtPoint(aimPoint, tgtRad, ctrBtryRad, optionalparams)
- _t.followBig(group, pos, wptidx)
- _t.hold()
- _t.land(point, duration)
- _t.orbit(pat, options)
- _t.recoverytanker(group, speed, alt)
- _t.refueling()
- _t.strafing(point, length, optionalparams)
- _t.tanker()
Description
Provides helper functions to create task tables that can be passed to Controller:setTask().
Functions
_t.attackGroup(group, optionalparams)
Note: The targeted group becomes automatically detected for the controlled group.
Parameters
- group
- the group to target
- optionalparams
- optional parameters
_t.attackMapObject(point, optionalparams)
Parameters
- point
- location on map to bomb
- optionalparams
- optional parameters
_t.attackUnit(unit, optionalparams)
Note: The targeted unit becomes automatically detected for the controlled group.
Parameters
- unit
- the unit to target
- optionalparams
- optional parameters
_t.awacs()
_t.bombing(point, optionalparams)
Best used for discriminant carpet bombing of a target or having a GBU hit a specific point on the map.
Parameters
- point
- location on map to bomb
- optionalparams
- optional parameters
_t.bombingRunway(airbase, optionalparams)
By default the AI will line up along the length of the runway and drop its payload.
Parameters
- airbase
- airbase object to target
- optionalparams
- optional parameters
_t.cargoTransportation(cargo, zoneid)
This in turn allows you to select one of the Cargo containers you have placed in the map. A red smoke marker will be spawned when you have selected one and you can then enable the cargo lifting cues to maneuver you into the correct position for attaching said cargo.
Parameters
- cargo
- cargo object to target
- zoneid
- id of the trigger zone
_t.carpetBombing(pt, len, optionalparams)
Similar to the bombing task, but with more control over target area. Can be combined with follow big formation task for all participating aircraft to simultaneously bomb a target. In the mission editor this task is call “WW2 Carpet Bombing”. This task is not limited to WW2 aircraft. Attack direction is assumed to be from the point where the task is assigned.
Parameters
- pt
- location on map to bomb
- len
- length of the bombing run
- optionalparams
- optional parameters
_t.combo(orderedlist)
This is the task that the DCS mission editor will default to using for groups placed in the editor.
Parameters
- orderedlist
_t.controlled(task, startcondition, stopcondition)
Start conditions are executed only once when the task is reached in the task queue. If the conditions are not met the task will be skipped. Stop Conditions are executed at a high rate. Can be used with any task in DCS. Note that options and commands do NOT have stopConditions. These tasks are executed immediately and take “no time” to run.
Parameters
- task
- startcondition
- stopcondition
_t.disembarkFromTransport(point, radius)
Used in conjunction with the embarking task.
Parameters
- point
- location
- radius
_t.embarking(point, groups, duration, distribution)
Parameters
- point
- groups
- duration
- distribution
_t.embarkToTransport(point, radius)
The Ground units will move to the specified location and wait to be picked up by a helicopter. The helicopter will then fly them to their dropoff point defined by another task for the ground forces; DisembarkFromTransport task.
Parameters
- point
- location where AI is expecting to be picked up
- radius
_t.engageGroup(group, optionalparams)
The target must be detected in order for AI to engage it.
Parameters
- group
- group reference to target
- optionalparams
_t.engageTargets(tgtlist, maxdist, prio)
Group will only engage detected targets. When placing a flight with the role of CAP, CAS, SEAD, Anti-ship, or Fighter Sweep in the mission editor an enroute task of the same name will automatically be generated for said group on their first waypoint. Theses tasks are available as an option in the enroute listing. Within the mission file itself these tasks are actually a engageTargets tasking with pre-defined target attributes. Within the mission editor the task role selection filters the list of valid attributeNames to be relevant to this task. In reality that doesn’t matter and you can assign whatever attribute you want for an aircraft to attack.
Parameters
- tgtlist
- set of attribute names that are valid targets
- maxdist
- maximum distance in meters the group will deviate from their route to engage a target
- prio
- the priority of the tasking, the lower the number the more important. The default value is 0.
_t.engageTargetsInZone(tgtlist, pt, radius, prio)
Group will only engage detected targets.
Parameters
- tgtlist
- set of attribute names that are valid targets
- pt
- center of the zone
- radius
- radius of the zone
- prio
- the priority of the tasking, the lower the number the more important. The default value is 0.
_t.engageUnit(unit, optionalparams)
The target must be detected in order for AI to engage it.
Parameters
- unit
- the unit to target
- optionalparams
- optional parameters
_t.follow(group, pos, wptidx)
If the assigned group is on the ground the AI will orbit overhead. If assigned to a flight lead or group its wingmen will stay in their specified formation.
Parameters
- group
- pos
- wptidx
_t.escort(group, pos, engagedist, tgtlist, wptidx)
If the assigned group is on the ground the AI will orbit overhead. If assigned to a flight lead or group its wingmen will stay in their specified formation.
Parameters
- group
- pos
- engagedist
- tgtlist
- wptidx
_t.escortGround(group, pos, orbitdist, tgtlist, wptidx)
Any valid detected targets will be engaged. If multiple helicopters are in the group then the aircraft will be distributed throughout the orbit. The orbit pattern is roughly just flying back and forth.
Parameters
- group
- pos
- orbitdist
- tgtlist
- wptidx
_t.ewr()
_t.fac(freq, mod, callid, callnum, prio)
Any detected targets will be assigned as targets to the player via the JTAC radio menu. Target designation is set to auto and is dependent on the circumstances.
Parameters
- freq
- mod
- callid
- callnum
- prio
_t.facAttackGroup(group, wpnType, designation, datalink, freq, mod, callid, callnum)
This task adds the group to the JTAC radio menu and interacts with a player to destroy the target.
Parameters
- group
- wpnType
- designation
- datalink
- freq
- mod
- callid
- callnum
_t.facEngageGroup(group, wpnType, designation, datalink, freq, mod, callid, callnum, prio)
This task adds the group to the JTAC radio menu and interacts with a player to destroy the target.
Parameters
- group
- wpnType
- designation
- datalink
- freq
- mod
- callid
- callnum
- prio
_t.fireAtPoint(aimPoint, tgtRad, ctrBtryRad, optionalparams)
Most commonly used with artillery to shell a target. Can also be used to simulate a firefight by making AI shoot in the general direction of other AI but not likely hitting anything. Either way it is the easiest way to make AI use up all of their ammo. It takes approximately 3 minutes for artillery positions to prepare and fire at the specified target.
Parameters
- aimPoint
- tgtRad
- ctrBtryRad
- optionalparams
_t.followBig(group, pos, wptidx)
Primary difference is it can be used with the Carpet Bombing task to allow large bomber formations to simultaneously bomb a given target. Within the mission editor this task also has tools for placing units in historic bomber formations. This task is also labeled as “WW2: Big Formation” in the editor, but it is functional with any aircraft assigned the ground attack task.
Parameters
- group
- pos
- wptidx
_t.hold()
_t.land(point, duration)
Useful for troop transport with helicopters. Currently only applies to Helicopters because I have no clue what at V-22 would be defined as within the sim. For landing at airbases, farps, or ships see the mission task page.
Parameters
- point
- duration
_t.orbit(pat, options)
Parameters
- pat
- options
_t.recoverytanker(group, speed, alt)
Parameters
- group
- speed
- alt
_t.refueling()
Currently helicopters can’t refuel in mid-air, but who knows maybe someday they will.
_t.strafing(point, length, optionalparams)
Parameters
- point
- length
- optionalparams
_t.tanker()
The aircraft must be a certified tanker aircraft, otherwise it would be really awkward trying to hook up with it.