Jump to content

Azimuth in pushTask: attackGroup/attackUnit


Go to solution Solved by Grimes,

Recommended Posts

Posted (edited)

I'm making a CA mission w/ both AI and player CAS aircraft. The below script is written to force AI aircraft to attack from 090 (heading 270, coming in from the east) at 6000 ft (1800 m) and drop a single CBU on the lead vehicle of a column heading 090 (coming from the west). This should make for a head-on encounter.

The script works, but only partially. The AI aircraft follow every part of the attack profile *except* for the "Target.direction = 090" part. It doesn't matter what original orientation I put the aircraft in relative to the armor column, it always changes its flight path to make its attack come in from an azimuth of 120 instead of 090, even if I start the plane on a course of 270 (due west). A similar effect happens no matter what compass heading I enter, but it's most obvious when I use the cardinal directions (000, 090, 180, 270)

I tried tweaking the heading  to account for the apparent 30 degree deviation but all that does is force the aircraft to take even weirder approach angles. Basically, nothing so far has made the aircraft attack the column from true 090.

To complicate things, if you set up the attack using the "Attack Group" or "Attack Unit" waypoint actions in the ME it obeys the azimuth command every time. Unfortunately I can't use this method because I need the AI to be able to dynamically select the lead vehicle in the column, which could change based on mission conditions (eg: vehicles start dying 🙂 )

Everything I've read says "Target.direction" should specify the direction the attack comes from, its azimuth, but when used in game via a "Do Script" trigger, it deviates every time for me.

So, do any of you know if there's some aspect of this parameter I'm using wrong? A bug or something maybe? ...I'm baffled at this point, been testing it different ways for days now but keep getting the same result.

Interestingly, if you let the core "CAS" AI just do its thing, the aircraft will eventually decide to drop a CBU on the column from an approach of 090, it misses completely, but hey, at least it's trying 👍

local Target = {}
Target.unitId = Group.getByName('Red Armor Test'):getUnits()[1]:getID()
Target.weaponType = 256
Target.expend = "One"
Target.directionEnabled = true
Target.direction = 090
Target.attackQtyLimit = true
Target.attackQty = 1
Target.altitudeEnabled = true
Target.altitude = 1828

local fire = {id = 'AttackUnit', params = Target}
Group.getByName('Blue CAS Test'):getController():pushTask(fire)

Edited by Terminator357
Posted
14 minutes ago, Grimes said:

Azimuth is in radians, not degrees. 

...once again, Grimes to the rescue. You have no idea how many times it's been one of your posts that provided an 'ah ha' moment for me 👍

Thank you so much, sir. Knew it would come down to me not understanding how to use it.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...