Fix the BLUE comma.

Add ZONE_COLORS/GetZoneColor and replace color usages.
Harden GetZoneForceStrengths and CreateTacticalInfoMarker with nil/pcall guards.
Make tactical text coalition-specific so each side only sees enemy TGTS.
This commit is contained in:
iTracerFacer 2025-10-27 08:13:21 -05:00
parent 6893e5d8bc
commit b17b414484

View File

@ -1,6 +1,53 @@
-- Setup Capture Missions & Zones
-- Refactored version with configurable zone ownership
-- ==========================================
-- ZONE COLOR CONFIGURATION (Centralized)
-- ==========================================
-- Colors are in RGB format: {Red, Green, Blue} where each value is 0.0 to 1.0
local ZONE_COLORS = {
-- Blue coalition zones
BLUE_CAPTURED = {0, 0, 1}, -- Blue (owned by Blue)
BLUE_ATTACKED = {0, 1, 1}, -- Cyan (owned by Blue, under attack)
-- Red coalition zones
RED_CAPTURED = {1, 0, 0}, -- Red (owned by Red)
RED_ATTACKED = {1, 0.5, 0}, -- Orange (owned by Red, under attack)
-- Neutral/Empty zones
EMPTY = {0, 1, 0} -- Green (no owner)
}
-- Helper to get the appropriate color for a zone based on state/ownership
local function GetZoneColor(zoneCapture)
local zoneCoalition = zoneCapture:GetCoalition()
local state = zoneCapture:GetCurrentState()
-- Priority 1: Attacked overrides ownership color
if state == "Attacked" then
if zoneCoalition == coalition.side.BLUE then
return ZONE_COLORS.BLUE_ATTACKED
elseif zoneCoalition == coalition.side.RED then
return ZONE_COLORS.RED_ATTACKED
end
end
-- Priority 2: Empty/neutral
if state == "Empty" then
return ZONE_COLORS.EMPTY
end
-- Priority 3: Ownership color
if zoneCoalition == coalition.side.BLUE then
return ZONE_COLORS.BLUE_CAPTURED
elseif zoneCoalition == coalition.side.RED then
return ZONE_COLORS.RED_CAPTURED
end
-- Fallback
return ZONE_COLORS.EMPTY
end
-- ==========================================
-- ZONE CONFIGURATION
-- ==========================================
@ -25,7 +72,7 @@ local ZONE_CONFIG = {
-- Zones that start under BLUE coalition control
BLUE = {
"Capture Zone-3"
"Capture Zone-3",
"Capture Zone-4"
},