tn_prvteye Posted May 26, 2020 Share Posted May 26, 2020 I can't seem to find the magic to make my Wingmen (and other AI Flights) attack Dynamically added ground targets. I'm using MIST to spawn targets, and sometimes they'll go after them, sometimes they won't. I made a "fake" target group called "Red Group" and also named the Spawned Group this as well...so the original would be replaced when they spawn in. I then added a Waypoint action of Engage Group and then chose "Red Group" Sometimes, they'll make a beeline for this group and hit them, other times they fly their flight path and ignore them. Now granted, all of the code I'm using is essentially stolen (I can't code to save my life), and at this point I'm not even sure whose code I stole. Does anyone know a sure-fire way to get the AI to "see" spawned targets? Nothing fancy. I just want to be able for two things to happen: 1) AI flights I'm escorting will attack the Spawned Ground Targets 2) If I'm flying the CAS mission, I'd like to be able to tell my Wingmen to Execute the mission, and have them attack the Spawned Ground Targets Am I making any sense? Link to comment Share on other sites More sharing options...
Majinbot Posted May 28, 2020 Share Posted May 28, 2020 (edited) I can't try at the moment but after creating the new group, try using a script to get the group attacked by a unit, example: local AttackUnit = Unit.getByName("[color="Red"]wingman unit name[/color]") local TargetGroup = Group.getByName("[color="red"]enemy group name[/color]") local EngageTarget = { id = 'AttackGroup', params = { groupId = TargetGroup:getID(), weaponType = 2956984318, -- Any Ag Weapon expend = "One", attackQtyLimit = true, attackQty = 1, } } AttackUnit:getController():pushTask(EngageTarget) Edited May 28, 2020 by Majinbot PC: i7-13700K - MSI RTX 4080 Gaming X Trio - 32GB DDR5 6200 - VPC MongoosT-50CM3 - VKB GF pro - MFG Crosswind - Msi MPG321UR-QD + Acer XB271HU - TrackIR5 - Rift S Link to comment Share on other sites More sharing options...
tn_prvteye Posted May 29, 2020 Author Share Posted May 29, 2020 Thanks! I'll give it a shot! Link to comment Share on other sites More sharing options...
Recommended Posts