From 0694fc8822555b29816556598677e18c94ae2d99 Mon Sep 17 00:00:00 2001 From: Ambroise Garel <47314805+akaAgar@users.noreply.github.com> Date: Tue, 29 Jul 2025 13:06:59 +0200 Subject: [PATCH] AWACS aircraft now spawned near the centerpoint of all mission player slots --- README.md | 1 + Script/The Universal Mission/SupportAWACS.lua | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c62d6b..ea9a680 100644 --- a/README.md +++ b/README.md @@ -232,6 +232,7 @@ The core script is quite simple and small, I probably won't need too much help w - Added "Using the mission menu" section to this README file, detailing all available commands - Added "weapons introduction date" table for upcoming "time period" setting (datamined from Briefing Room, many thanks to @john681611) - All AI aircraft now despawned on landing to free CPU cycles and allow space for new aircraft + - AWACS aircraft now spawned near the centerpoint of all mission player slots - Changed AWACS aircraft detection logic (a tiny bit less realistic but more efficient) - Changed some UTF-8 symbols in F10 menu, added UTF-8 symbol for "Objectives" submenu - Fixed missing airbase name in "aircraft landed safely" messages diff --git a/Script/The Universal Mission/SupportAWACS.lua b/Script/The Universal Mission/SupportAWACS.lua index 2f5138d..d697ea0 100644 --- a/Script/The Universal Mission/SupportAWACS.lua +++ b/Script/The Universal Mission/SupportAWACS.lua @@ -103,11 +103,18 @@ do local awacsUnits = Library.factions.getUnits(TUM.settings.getPlayerFaction(), DCSEx.enums.unitFamily.PLANE_AWACS, 1) awacsCallsign = "AWACS" + local awacsSpawnPoint = DCSEx.envMission.getPlayerGroupsCenterPoint(TUM.settings.getPlayerCoalition()) + if awacsSpawnPoint then + awacsSpawnPoint = DCSEx.math.randomPointInCircle(awacsSpawnPoint, DCSEx.converter.nmToMeters(10), DCSEx.converter.nmToMeters(5)) + else + awacsSpawnPoint = TUM.territories.getTerritoryCenter(TUM.settings.getPlayerCoalition()) + end + if awacsUnits and #awacsUnits > 0 then local groupInfo = DCSEx.unitGroupMaker.create( TUM.settings.getPlayerCoalition(), Group.Category.AIRPLANE, - TUM.territories.getTerritoryCenter(TUM.settings.getPlayerCoalition()), + awacsSpawnPoint, { DCSEx.table.getRandom(awacsUnits) }, { immortal = true,