FlightControl Posted May 21, 2014 Posted May 21, 2014 (edited) Hi, Was writing a script to allow a carrier ( transport helicopter ) to be escorted by other helicopters for defense... And found out nothing works... There seems to be no escort function working when it is activated by a script. So i went to look into the editor and guess what: it seems that the escort task has vanished for helicopters :mad: ? BUG ? -> pls check and confirm if i either am not understanding something or it is a mistake to be corrected. Find underlying the first picture, showing an attempt to make a helicopter group escort another helicopter group. The task Escort is not in the list anymore, it seems. Although the type of the main group task is set to Escort. The second picture shows that the Escort task is available for planes: Is this normal mission editor behaviour? Also, it seems that activating an escort AI task through scripting does not work at all. One note, the helicopters are dynamically spawned, although i get for each unit a valid groupId after spawing... EscortCount = 0 function EscortCarrier ( CarrierGroup, EscortPrefix ) env.info(( 'EscortCarrier: ' )) env.info(( 'EscortCarrier: CarrierGroup = ' .. CarrierGroup:getName() )) env.info(( 'EscortCarrier: EscortPrefix = ' .. EscortPrefix )) local EscortGroup = {} local EscortUnits local EscortGroupName --Get the Group Data with Mist EscortGroup = mist.getGroupData( EscortPrefix .. '000' ) if EscortGroup ~= nil then EscortGroup.route = {} EscortGroup.route.points = mist.getGroupRoute(EscortPrefix.."000", true) EscortCount = EscortCount + 1 EscortGroupName = string.format( EscortPrefix .. '%03d', EscortCount ) EscortGroup.name = EscortGroupName EscortGroup.groupName = EscortGroupName local EscortUnits = #EscortGroup.units for u = 1, EscortUnits do EscortGroup.units[u].unitName = string.format( EscortPrefix .. '%03d-%02d', EscortCount, u ) end EscortGroup.groupId = 4500 + EscortCount mist.dynAdd( EscortGroup ) EscortGroup = Group.getByName( EscortGroupName ) env.info(( 'Carrier: Escort ID' .. CarrierGroup:getID() )) local controllerGroup = EscortGroup:getController() local EscortZonePos = {} EscortZonePos.x = 0 EscortZonePos.y = 0 EscortZonePos.z = -40 [color=red] controllerGroup:pushTask( { id = 'Escort', params = { groupId = CarrierGroup:getID(), pos = EscortZonePos, lastWptIndexFlag = false, } } ) [/color] if controllerGroup:hasTask() then env.info('EscortCarrier: hastask on ' ) else env.info('EscortCarrier: hastask off ' ) end end env.info(( 'EscortCarrier: end' )) end Edited May 21, 2014 by FlightControl [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
FlightControl Posted August 17, 2014 Author Posted August 17, 2014 I found a solution [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
Sceptre Posted August 17, 2014 Posted August 17, 2014 Could you share the solution? RTX 2070 8GB | 32GB DDR4 2666 RAM | AMD Ryzen 5 3600 4.2Ghz | Asrock X570 | CH Fighterstick/Pro Throttle | TM MFDs | TrackIR 5
FlightControl Posted August 17, 2014 Author Posted August 17, 2014 Currently on a business travel. When i get home, I'll share. It is a function, a script. [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
Sceptre Posted August 17, 2014 Posted August 17, 2014 all good thanks RTX 2070 8GB | 32GB DDR4 2666 RAM | AMD Ryzen 5 3600 4.2Ghz | Asrock X570 | CH Fighterstick/Pro Throttle | TM MFDs | TrackIR 5
Recommended Posts