CougarFFW04 Posted January 3, 2019 Posted January 3, 2019 (edited) Hi All, I am interested to set an escort task to an AI via the setTask function. Escort task is described as follow in DCS : Escort = { id = 'Escort', params = { groupId = Group.ID, pos = Vec3, lastWptIndexFlag = boolean, lastWptIndex = number engagementDistMax = Distance, targetTypes = array of AttributeName } } All parameters are clear except the targetTypes... I understand this should be an array but I do not understand what I must put there... In particular how do I specify that I want that the escort engage - only fighter, bombers and helicopter or - only SAM Could someone give me an exemple ? Thanks Edited January 3, 2019 by CougarFFW04
CougarFFW04 Posted January 3, 2019 Author Posted January 3, 2019 (edited) So after digging al lithe bit i tried this code: function setEscort(lead,relativepos,lastwpt,dshoot) local MyEscort = { id = 'Escort', params = { groupId = Group.getByName(lead):getID(), pos = relativepos, lastWptIndexFlag = true, lastWptIndex = lastwpt, engagementDistMax = dshoot, targetTypes = { "Planes", "Battle airplanes", } } } _group = Group.getByName(lead) _controller = _group:getController() _controller:setTask(MyEscort) end The mission consits of a A10 bombing some targets and a F15 to which I have attached the foolowing script at it's wapoint 1 :setEscort('A10',{-100,-100,-100},3,50.0). Unfortunatly the F15 never go to escort the A10 and the A10 rushed vericaly to the gound and crashes while the F15 does RTB :joystick::joystick::joystick::joystick: Edit :I even got much more ugly things : the A10 flying forward in reverse :cry::helpsmilie: What I am doing wrong ? Thanks Edited January 4, 2019 by CougarFFW04
CougarFFW04 Posted January 4, 2019 Author Posted January 4, 2019 Nobody ? I can't find anything on the net for that although I think it is something very simple for DCS Lua Gurrus... I am sticked with that :joystick: Help welcome :helpsmilie: Thanks
CougarFFW04 Posted January 4, 2019 Author Posted January 4, 2019 (edited) OK got it :D The correct seems to be the following (and it make sens) function setEscort(pack,lead,relativepos,lastwpt,dshoot) local MyEscort = { id = 'Escort', params = { groupId = Group.getByName(lead):getID(), pos = relativepos, lastWptIndexFlag = true, lastWptIndex = lastwpt, engagementDistMax = dshoot targetTypes = { "Planes", "Battle airplanes"} } } Group.getByName(pack):getController():setTask(MyEscort) end And the call (for exemple): setEscort('F15','A10',{x=100,y=100,z=100},3,25) The only suspicious thing is that if you mention n as the last waypoint, the escort flight RTB as soon as the flight reach waypoint n-1 :music_whistling: Is this a bug introduced recently or is like that from the begining ? Thanks Edited January 4, 2019 by CougarFFW04
Delta99 Posted January 6, 2019 Posted January 6, 2019 OK got it :D The correct seems to be the following (and it make sens) The only suspicious thing is that if you mention n as the last waypoint, the escort flight RTB as soon as the flight reach waypoint n-1 :music_whistling: Is this a bug introduced recently or is like that from the begining ? Thanks I believe waypoints are numbered starting with 0 so that might be why. I see in your example you are using a distance of 25 for engage. This is in meters so you are pretty much guaranteeing that your escort will never engage any enemies. You should probably bump that up significantly if you want them to actually engage. But maybe you don't and just want them to stay in formation so what you have is probably good. My Missions: Valley Patrol Mission :: Valley Escort Mission :: A2A Engagements
CougarFFW04 Posted January 7, 2019 Author Posted January 7, 2019 Hi Delta99, I believe waypoints are numbered starting with 0 so that might be why. Oh yes I already noticed this... I see in your example you are using a distance of 25 for engage. This is in meters so you are pretty much guaranteeing that your escort will never engage any enemies. hoooo I thought it was in nautic mile... Thanks for letting me know :thumbup:
Recommended Posts