tn_prvteye Posted May 26, 2020 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?
Majinbot Posted May 28, 2020 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 - Gigabyte RTX 5080 GAMING OC - 64GB DDR5 6400 - VPC MongoosT-50CM3 - VKB GF pro - MFG Crosswind - Msi MPG321UR-QD + LG OLED 32GS95UE - TrackIR5 - Quest 3
Recommended Posts