DCS task carpetBombing

From DCS World Wiki - Hoggitworld.com


Task: CarpetBombing Added with: 2.1
Hierarchy: Scripting Root > Tasks > Main task > CarpetBombing
Tasking Type: Main task
For: Airplanes
Available Under: Ground Attack
Description: Assigns a point on the ground for which the AI will attack. 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.

Format: This task needs to be in the following format.
Bombing = { 
 id = 'CarpetBombing', 
 params = { 
   attackType = string,
   carpetLength = number,
   point = Vec2,
   weaponType = number, 
   expend = enum AI.Task.WeaponExpend,
   attackQty = number, 
   groupAttack = boolean, 
   altitude = number
   altitudeEnabled = boolean,
 } 
}

Required parameters: point: vec2 coordinate of the target. Can also be an x and y values directly in params table.

attackQty: Number of times the group will attack if the target.

carpetLength: Distance in meters the pattern should cover. Depending on the number of bombs available this value will scale the time between each bomb is dropped.

attackType: 'Carpet'

-- Note by Grimes: I don't really know why attackType is a value or even if it is required. As far as I am aware this is the only task that uses the attackType variable.

Optional Parameters: All other variables are optional. Some variables require other entries, for example the boolean values require the corresponding value if the boolean is true.

expend: Enum that defines how much munitions the AI will expend per attack run.

groupAttack: If true then each aircraft in the group will attack the point.

altitude: Number in meters at which you want the aircraft to engage from

altitudeEnabled: Boolean value for whether or not the altitude check applies

Enumerators: weaponType is a number associated with a correspond weapons flags

AI.Task.WeaponExpend

"QUARTER" = "Quarter"
"TWO"     = "Two"
"ONE"     = "One"
"FOUR"    = "Four"
"HALF"    = "Half"
"ALL"     = "All"
Examples: The following will make the group "droneyTheDrone" destroy a bridge with a pair of guided bombs.
 local target = {}
 target.point = {x = trigger.misc.getZone('bridge').point.x, y = trigger.misc.getZone('bridge').point.z}
 target.expend = "Two"
 target.weaponType = 14
 target.attackQty = 1
 local engage = {id = 'CarpetBombing', params = target}
 Group.getByName('droneyTheDrone'):getController():setTask(engage)
Notes: See article Mission Editor: AI Tasking for more information on how AI tasking is handled within DCS.
Task List: Main Tasks: mission, AttackGroup, AttackUnit, Bombing, CarpetBombing, AttackMapObject, BombingRunway, orbit, refueling, land, follow, followBigFormation, escort, Embarking, fireAtPoint, hold, FAC_AttackGroup, EmbarkToTransport, DisembarkFromTransport, CargoTransportation, goToWaypoint

En-route Tasks: engageTargets, engageTargetsInZone, engageGroup, engageUnit, awacs, tanker, ewr, FAC_engageGroup, FAC

Commands: script, setCallsign, setFrequency, switchWaypoint, stopRoute, switchAction, setInvisible, setImmortal, activateBeacon, deactivateBeacon, eplrs, start, transmitMessage, stopTransmission

Options: ROE, Reaction To Threat, Radar Using, Flare Using, Formation, RTB On Bingo, silence, Disperse on Attack, Alarm State, RTB on Out of Ammo, ECM Using, Prohibit AA, Prohibit Jettison, Prohibit Afterburner, Prohibit AG, Missile Attack Range, Prohibit WP Pass Report, Engage Air Weapons