From a5c6f4f75399965ba209b082630ce88006ef1407 Mon Sep 17 00:00:00 2001 From: Ambroise Garel <47314805+akaAgar@users.noreply.github.com> Date: Wed, 23 Jul 2025 12:01:14 +0200 Subject: [PATCH] Added wingman spawning logic --- .../The Universal Mission/SupportWingmen.lua | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Script/The Universal Mission/SupportWingmen.lua b/Script/The Universal Mission/SupportWingmen.lua index 3ccc488..b8f3770 100644 --- a/Script/The Universal Mission/SupportWingmen.lua +++ b/Script/The Universal Mission/SupportWingmen.lua @@ -12,6 +12,31 @@ do if TUM.settings.getValue(TUM.settings.id.MULTIPLAYER) then return end -- No wingmen in multiplayer TUM.supportWingmen.removeAll() -- Destroy all pre-existing wingmen TUM.log("Creating wingmen...") + + local player = world:getPlayer() + if not player then return end + + local count = 1 -- TODO + + local groupInfo = DCSEx.unitGroupMaker.create( + TUM.settings.getPlayerCoalition(), + Group.Category.AIRPLANE, -- TODO: or helicopter! + DCSEx.math.randomPointInCircle(DCSEx.math.vec3ToVec2(player:getPoint()), 500, 250), + { player:getTypeName() }, + { + silenced = true, + taskFollow = DCSEx.dcs.getObjectIDAsNumber(player:getGroup()), + unlimitedFuel = true + } + ) + + if not groupInfo then + TUM.log("Failed to spawn AI wingmen", TUM.logLevel.WARNING) + return + end + + TUM.log("Spawned AI wingmen") + wingmenGroupID = groupInfo.groupID end function TUM.supportWingmen.removeAll()