Difference between revisions of "DCS task follow"

From DCS World Wiki - Hoggitworld.com
 
Line 46: Line 46:
 
     groupId = 5,
 
     groupId = 5,
 
     pos = {x = 200, y = 0, z = -100,
 
     pos = {x = 200, y = 0, z = -100,
 +
    lastWptIndexFlag = false,
 
   }     
 
   }     
 
  }
 
  }

Latest revision as of 00:21, 28 September 2021


Task: Follow Added with: 1.2.4
Hierarchy: Scripting Root > Tasks > Main task > Follow
Tasking Type: Main task
For: Airplanes, Helicopters
Available Under: All air tasks
Description: Controlled aircraft will follow the assigned group along their route in formation. 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.
Format: This task needs to be in the following format.
 Follow = {
  id = 'Follow',
  params = {
    groupId = Group.ID,
    pos = Vec3,
    lastWptIndexFlag = boolean,
    lastWptIndex = number
  }    
}

Required parameters:

groupId: unique groupId.

pos: Vec3 point defining the relative position the controlled flight will form up on. For racetrack orbits, it is best to be back and to the right.

--Need to add more details on the xyz coords so people better understand the positioning.

Optional Parameters:

lastWptIndexFlag : (Default: True) if true the AI will follow the group until it reaches a specified waypoint.

lastWptIndex : (Default: -1) Identifies the waypoint at which the following group will stop its task. Must be set if lastWPIndexFlag is not changed to false. Otherwise the AI will immediately abandon the task.

Enumerators: N/A
Examples: This example will have the group named "follower" follow the group with an groupId of 5 offset 200 meters to the right and 100 meters behind.
 local followTask = {
  id = 'Follow',
  params = {
    groupId = 5,
    pos = {x = 200, y = 0, z = -100,
    lastWptIndexFlag = false,
  }    
}
 Group.getByName('follower'):getController():pushTask(followTask)
Notes: See article Mission Editor: AI Tasking for more information on how AI tasking is handled within DCS.
Task List: Task Wrappers: mission, ComboTask, ControlledTask, WrappedAction


Tasks: AttackGroup, AttackUnit, Bombing, Strafing, CarpetBombing, AttackMapObject, BombingRunway, orbit, refueling, land, follow, followBigFormation, escort, Embarking, fireAtPoint, hold, FAC_AttackGroup, EmbarkToTransport, DisembarkFromTransport, CargoTransportation, goToWaypoint, groundEscort, RecoveryTanker

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

Commands: script, setCallsign, setFrequency, setFrequencyForUnit, switchWaypoint, stopRoute, switchAction, setInvisible, setImmortal, setUnlimitedFuel, activateBeacon, deactivateBeacon, activateICLS, deactivateICLS, eplrs, start, transmitMessage, stopTransmission, smoke_on_off, ActivateLink4, deactivateLink4, activateACLS, deactivateACLS, LoadingShip

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, Option Radio Usage Contact, Option Radio Usage Engage, Option Radio Usage Kill, AC Engagement Range Restriction, jett tanks if empty, forced attack, Altitude Restriction for AAA Min, restrict targets, Altitude Restriction for AAA Max, Prefer Vertical