AWACS aircraft now spawned near the centerpoint of all mission player slots

This commit is contained in:
Ambroise Garel 2025-07-29 13:06:59 +02:00
parent 26cf432bb3
commit 0694fc8822
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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,