inconnudiscret Posted March 22, 2021 Share Posted March 22, 2021 Hello guys, I’ve been reading for hours and I can’t make it work... I have 50 CAS BLUE groups and a RED convoy , spawned dynamically somewhere on the map. I need the BLUE units to engage it, problem I can’t use the attack group in the editor as it’s spawned dynamically. The convoy has group name « Convoy1 », is there a simple way to have the 50 groups detect and engage it ? Also, can you simulate the detection of all the RED units in a zone and show them to all blue units on F10 map ? I want my E3 AWACS to act as a JSTAR. thanks Link to comment Share on other sites More sharing options...
toutenglisse Posted March 22, 2021 Share Posted March 22, 2021 Rename your 50 groups : 'Blue CAS 1' to 'Blue CAS 50' (to match script) and use this "do script" : local target = Group.getByName('Convoy1') local groupId = Group.getID(target) local Task = { ["id"] = "AttackGroup", ["params"] = { ["groupId"] = groupId, }, } for i = 1,50 do local groupName = 'Blue CAS ' .. i if Group.getByName(groupName) and Group.getByName(groupName):isExist() == true and #Group.getByName(groupName):getUnits() > 0 then Group.getByName(groupName):getController():pushTask(Task) end end I don't know for your last question. 1 Link to comment Share on other sites More sharing options...
inconnudiscret Posted March 22, 2021 Author Share Posted March 22, 2021 (edited) Thank you so much, do you know if it would be possible to do the same with a prefix ? Like Cas ? Because I named them casMig23-1...n, casMiG29-1...n and I already have so much lua with these names thanks also they spawn randomly between 0s and 2h, is that an issue ? Edited March 22, 2021 by inconnudiscret Link to comment Share on other sites More sharing options...
toutenglisse Posted March 22, 2021 Share Posted March 22, 2021 You can make a group table including every group with 'cas' prefix and run the "pushtask" through the table in a similar way. Spawning randomly is not an issue - just run the "attackGroup" when new cas group spawns, linked by a function-scheduller (and directly refering to the correct group name). Link to comment Share on other sites More sharing options...
foba75gmail.com Posted March 24, 2021 Share Posted March 24, 2021 Hi, I got it working, but only the first unit of each group is engaging my Convoy. I use this, that I paste in each attack group 1st waypoint, under script Is there a way to have a group attack ? local target = Group.getByName('Convoy') local groupId = Group.getID(target) local Task = { ["id"] = "AttackGroup", ["params"] = { ["groupId"] = groupId, ["altitudeEnabled"] = true, ["altitude"] = 4500, }, } local groupName = 'Mig23-1' if Group.getByName(groupName) and Group.getByName(groupName):isExist() == true and #Group.getByName(groupName):getUnits() > 0 then Group.getByName(groupName):getController():pushTask(Task) end Link to comment Share on other sites More sharing options...
toutenglisse Posted March 24, 2021 Share Posted March 24, 2021 4 hours ago, foba75gmail.com said: Hi, I got it working, but only the first unit of each group is engaging my Convoy... No idea. When I use this task on a multiple units flight (helos or airplanes), all are attacking. Link to comment Share on other sites More sharing options...
toutenglisse Posted March 27, 2021 Share Posted March 27, 2021 On 3/22/2021 at 7:45 PM, inconnudiscret said: ... Also, can you simulate the detection of all the RED units in a zone and show them to all blue units on F10 map ? I want my E3 AWACS to act as a JSTAR... Should be doable with this function : DCS func knowTarget - DCS World Wiki - Hoggitworld.com Link to comment Share on other sites More sharing options...
Grimes Posted March 27, 2021 Share Posted March 27, 2021 Suppose it might be an issue with the weapons the aircraft are armed with and what they are attacking. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum Link to comment Share on other sites More sharing options...
inconnudiscret Posted March 28, 2021 Author Share Posted March 28, 2021 On 3/27/2021 at 2:55 AM, toutenglisse said: Should be doable with this function : DCS func knowTarget - DCS World Wiki - Hoggitworld.com Thanks, I’m trying to do it with this func Link to comment Share on other sites More sharing options...
Recommended Posts