DCS task fireAtPoint

From DCS World Wiki - Hoggitworld.com


Task: FireAtPoint Added with: 1.2.4
Hierarchy: Scripting Root > Tasks > Main task > FireAtPoint
Tasking Type: Main task
For: Ground vehicles, ships
Available Under: Ground Nothing, Ship Nothing (default and unseen tasks for vehicles and ships)
Description: Assigns a point on the ground for which the AI will shoot at. 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.

Format: This task needs to be in the following format.
FireAtPoint = { 
  id = 'FireAtPoint', 
  params = { 
    point = Vec2,
    radius = Distance, 
    expendQty = number,
    expendQtyEnabled = boolean, 
    weaponType = number, 
  }
 } 

Required parameters:

point: vec2 coordinate to define where the AI will aim at. Note this value can also be an x and y coordinate directly in the params table. Example of this is shown below.

Optional Parameters:

radius: Optional radius in meters that defines the area AI will attempt to be hitting.

expendQty: Specifies number of shots to be fired.

expendQtyEnabled: Whether or not expendQty will be used

Enumerators: weaponType: Enum for weapon type ID. This value is only required if you want the group firing to use a specific weapon, for instance using the task on a ship to force it to fire guided missiles at targets within cannon range.
Examples: The following creates a task for a group named 'arty' to fire 20 shells into a zone that is defined in the mission editor named "killzone'.
 local target = {}
 target.x = trigger.misc.getZone('killzone').point.x
 target.y = trigger.misc.getZone('killzone').point.z
 target.radius = trigger.misc.getZone('killzone').radius
 target.expendQty = 20
 target.expendQtyEnabled = true
 local fire = {id = 'FireAtPoint', params = target}
 Group.getByName('arty'):getController():pushTask(fire)
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