From f438c73f5a5536bf0e5b6949981c52d9413af167 Mon Sep 17 00:00:00 2001 From: Ambroise Garel <47314805+akaAgar@users.noreply.github.com> Date: Wed, 23 Jul 2025 11:30:30 +0200 Subject: [PATCH] Created TUM.supportWingmen table --- Script/The Universal Mission/Mission.lua | 2 ++ .../The Universal Mission/SupportWingmen.lua | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 Script/The Universal Mission/SupportWingmen.lua diff --git a/Script/The Universal Mission/Mission.lua b/Script/The Universal Mission/Mission.lua index 8ab8294..3d36e63 100644 --- a/Script/The Universal Mission/Mission.lua +++ b/Script/The Universal Mission/Mission.lua @@ -29,6 +29,7 @@ do local function closeMission(removeAllUnits) if removeAllUnits then + TUM.wingmen.removeAll() TUM.airForce.removeAll() TUM.ambientWorld.removeAll() TUM.enemyAirDefense.removeAll() @@ -73,6 +74,7 @@ do TUM.supportAWACS.create() -- Create the AWACS aircraft if it wasn't airborne already + TUM.wingmen.create() TUM.enemyAirDefense.create() -- Must be called once objectives have been created TUM.airForce.create() -- Must be called once objectives have been created TUM.missionMenu.create() -- Must be called once objectives have been created diff --git a/Script/The Universal Mission/SupportWingmen.lua b/Script/The Universal Mission/SupportWingmen.lua new file mode 100644 index 0000000..3ccc488 --- /dev/null +++ b/Script/The Universal Mission/SupportWingmen.lua @@ -0,0 +1,24 @@ +-- ==================================================================================== +-- TUM.SUPPORTWINGMEN - HANDLES THE PLAYER'S WINGMEN +-- ==================================================================================== +-- ==================================================================================== + +TUM.supportWingmen = {} + +do + local wingmenGroupID = nil + + function TUM.supportWingmen.create() + 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...") + end + + function TUM.supportWingmen.removeAll() + if wingmenGroupID then TUM.log("Removing all wingmen...") end + + DCSEx.world.destroyGroupByID(wingmenGroupID) + + wingmenGroupID = nil + end +end