✅ Added _untrackTimer() function to immediately remove completed timers ✅ Enhanced periodic GC with timestamp-based cleanup (removes stale timers after 60s) ✅ Added collectgarbage('step') calls to all cleanup functions ✅ Added incremental GC to high-frequency schedulers (hover, ground load) ✅ Added GC to main schedulers (crate cleanup, troop cleanup, state maintenance) ✅ Emergency cleanup if pendingTimers exceeds 300 entries
MOOSE CTLD/FAC and Convoy Scripts
This repository contains MOOSE-based scripts for enhancing DCS World missions with advanced logistics, troop transport, forward air control, and convoy management capabilities. CTLD was orignialy created by Ciribob using the MIST framework. I've converted his work to only use moose and have added many features included integrated MEDEVAC and Salvage system which both can have a direct impact on the state of a mission.
Overview
MOOSE CTLD (Combat Troop Landing and Deployment)
MOOSE CTLD is a comprehensive logistics and troop transport system that transforms helicopters and transport aircraft into force multipliers. Players can:
- Request and transport crates containing vehicles, weapons, and equipment
- Load and deploy troops for defensive or offensive operations
- Build forward operating bases (FOBs) and upgrade them to functional forward arming and refueling points (FARPs)
- Manage MEDEVAC operations with salvage point rewards
- Sling-load salvage from destroyed enemy units
- Receive hover coaching for precise crate pickup
- Access JTAC support for laser designation
The system includes immersive features like:
- Dynamic zone activation/deactivation
- Inventory management per pickup zone
- Salvage-based economy for advanced builds
- Mobile MASH units for casualty evacuation
- Comprehensive F10 menu interface
FAC (Forward Air Controller)
The FAC module provides full FAC/RECCE capabilities including:
- Auto-detection of FAC aircraft by group name or unit type
- Auto-lasing with configurable laser codes and marker types
- Target scanning and prioritization (AA/SAM detection)
- Artillery and naval gunfire support
- Bomber/fighter tasking for strikes
- RECCE sweeps with map marks and target storage
- Carpet bombing and TALD deployment
- Event-driven tasking via map marks
Convoy System
The Convoy script implements a dynamic convoy escort system featuring:
- Player-initiated spawns via F10 map marks near CTLD zones
- Road-based navigation to player-defined destinations
- Threat detection and response with automatic halting
- CAS (Close Air Support) requests when under attack
- Route integrity monitoring to prevent waypoint manipulation
- Coalition-specific operations with configurable templates
Integrated MEDEVAC and Salvage Systems
The CTLD system includes two interconnected economy systems that create dynamic mission progression and resource management.
MEDEVAC (Medical Evacuation) System
The MEDEVAC system simulates casualty evacuation and medical support:
How It Works
- When enemy ground vehicles are destroyed, surviving crew members spawn at the wreck location
- Crews broadcast distress calls with their grid coordinates and request immediate evacuation
- Players must respond quickly - crews have a limited survival window (typically 15-30 minutes)
- Failed evacuations result in crew KIA and permanent vehicle loss
Evacuation Process
- Receive Alert: Coalition receives MEDEVAC request with grid coordinates and crew count
- Locate Crew: Use F10 menu to get vectors to stranded personnel
- Pickup: Land or hover near crew location and hold position to load casualties
- Transport: Fly crew to an active MASH (Mobile Army Surgical Hospital) zone
- Delivery: Land in MASH zone and hold for offloading (typically 25 seconds)
- Reward: Earn salvage points based on crew size and vehicle type
Salvage Points
- Salvage points are earned by successfully delivering MEDEVAC crews to MASH zones
- Points accumulate per coalition and are shared across all players
- Higher-value vehicles (tanks, IFVs) provide more salvage points
- Points can be used to "purchase" out-of-stock items from the crate catalog
Sling-Load Salvage System
The salvage system creates opportunistic resource collection from battlefield wreckage:
How It Works
- When enemy units are destroyed, there's a chance (configurable per coalition) that salvageable wreckage spawns
- Wreckage appears as cargo crates with weight, value, and expiration timers
- Players can sling-load these crates using helicopters and deliver them to salvage collection zones
Salvage Categories
- Light Salvage: 500-1000kg, 1-2 points (50% spawn chance)
- Medium Salvage: 2501-5000kg, 5-10 points (30% spawn chance)
- Heavy Salvage: 5001-8000kg, 15-24 points (15% spawn chance)
- Super Heavy Salvage: 8001-12000kg, 32-48 points (5% spawn chance)
Collection Process
- Locate Wreckage: Receive coalition alert with grid coordinates and estimated value
- Sling Load: Hover over crate and hook it with helicopter sling
- Transport: Fly crate to an active salvage collection zone
- Delivery: Release sling within zone boundaries to complete delivery
- Condition Bonus: Intact deliveries receive full value; damaged crates lose value
Dynamic Features
- Expiration Timers: Crates deteriorate over time (default 1 hour) if not collected
- Weight Simulation: Heavier crates affect helicopter performance
- Zone Restrictions: Must deliver to designated salvage zones for credit
- Condition Multipliers: Undamaged (1.5x), Damaged (1.0x), Heavy Damage (0.5x)
Strategic Impact
These systems create several gameplay dynamics:
Resource Scarcity
- Limited initial salvage points encourage early MEDEVAC operations
- Out-of-stock items can only be unlocked through salvage accumulation
- Players must balance combat operations with logistics support
Mission Progression
- Successful MEDEVAC operations provide resources for advanced builds
- Salvage collection creates incentives for aggressive operations
- Failed evacuations represent permanent losses that affect mission outcome
Coalition Competition
- Salvage points are tracked per coalition
- Both sides can collect salvage from enemy wrecks
- Resource advantages can shift based on operational success
Risk/Reward Balance
- High-value targets provide more salvage but are more dangerous
- Time pressure on MEDEVAC creates urgency without being punitive
- Salvage collection rewards thorough battlefield cleanup
Setup Instructions
Prerequisites
- DCS World with MOOSE framework installed
- Mission Editor access for zone creation and script loading
Script Load Order
Load scripts in the Mission Editor in this exact order:
Moose.lua(MOOSE framework)Moose_CTLD.lua(Core CTLD functionality)catalogs/Moose_CTLD_Catalog.luaorcatalogs/Moose_CTLD_Catalog_LowCounts.lua(Optional but recommended - provides crate recipes)Moose_CTLD_FAC.lua(Optional - adds FAC capabilities)Moose_Convoy.lua(Optional - adds convoy system)- Your initialization script (see examples below)
Mission Editor Setup
Required Zones
Create the following trigger zones in the Mission Editor:
- Pickup Zones: Where players request crates and load troops (e.g.,
PICKUP_BLUE_MAIN) - Drop Zones: Designated areas for crate deployment (e.g.,
DROP_BLUE_1) - FOB Zones: Areas where FOBs can be built (e.g.,
FOB_BLUE_A) - MASH Zones: Medical evacuation zones (e.g.,
MASH_Alpha) - Salvage Zones: Areas for delivering sling-loaded salvage (e.g.,
SALVAGE_1)
Zone Configuration
Each zone can be configured with:
flag: Mission flag number for activation controlactiveWhen: Flag value that activates the zone (0 = always active)smoke: Smoke color for visual markingradius: Zone radius in metersfreq: Radio frequency for beacons (MASH zones)
CTLD Initialization
Create a DO SCRIPT action in your mission with the following structure:
-- Check for required dependencies
if not _MOOSE_CTLD then
env.info("[INIT] MOOSE CTLD not loaded!")
return
end
-- Configuration table
local ctldConfig = {
CoalitionSide = coalition.side.BLUE, -- BLUE or RED
-- Core settings
AllowedAircraft = {
'UH-1H', 'Mi-8MTV2', 'Mi-24P', 'SA342M', 'SA342L',
'SA342Minigun', 'UH-60L', 'CH-47Fbl1', 'CH-47F', 'Mi-17'
},
-- MEDEVAC system
MEDEVAC = {
Enabled = true,
InitialSalvage = 25,
MobileMASH = {
Enabled = true,
ZoneRadius = 300,
BeaconFrequency = '32.0 FM',
AnnouncementInterval = 300
}
},
-- Zone definitions
Zones = {
PickupZones = {
{ name = 'PICKUP_BLUE_MAIN', flag = 9001, activeWhen = 0 }
},
DropZones = {
{ name = 'DROP_BLUE_1', flag = 9002, activeWhen = 0 }
},
FOBZones = {
{ name = 'FOB_BLUE_A', flag = 9003, activeWhen = 0 }
},
MASHZones = {
{ name = 'MASH_Alpha', freq = '251.0 AM', radius = 300, flag = 9010, activeWhen = 0 }
},
SalvageDropZones = {
{ name = 'SALVAGE_1', radius = 300, flag = 9020, activeWhen = 0 }
}
},
-- Additional options
BuildRequiresGroundCrates = true,
LogLevel = 2, -- 0=NONE, 1=ERROR, 2=INFO, 3=VERBOSE, 4=DEBUG
}
-- Create CTLD instance
local ctld = _MOOSE_CTLD:New(ctldConfig)
-- Optional: Load crate catalog
if _CTLD_EXTRACTED_CATALOG then
ctld:MergeCatalog(_CTLD_EXTRACTED_CATALOG)
end
FAC Initialization (Optional)
Add FAC support after CTLD initialization:
if _MOOSE_CTLD_FAC then
local facConfig = {
CoalitionSide = coalition.side.BLUE,
Arty = { Enabled = false }, -- Enable/disable artillery support
}
local fac = _MOOSE_CTLD_FAC:New(ctld, facConfig)
-- Optional: Add reconnaissance zones
-- fac:AddRecceZone({ name = 'RECCE_BLUE_1' })
fac:Run()
end
Convoy System Setup (Optional)
Configure the Convoy script at the top of Moose_Convoy.lua:
-- Template groups (must exist as late-activated in Mission Editor)
CONVOY_TEMPLATE_NAMES = {
"Convoy Template 1",
"Convoy Template 2",
}
-- CTLD integration
CTLD_INSTANCE_NAME_BLUE = "ctldBlue" -- Variable name of your BLUE CTLD instance
CTLD_INSTANCE_NAME_RED = "ctldRed" -- Variable name of your RED CTLD instance
USE_CTLD_ZONES = true
-- Destination control
PLAYER_CONTROLLED_DESTINATIONS = true -- false = use static destinations
-- Keywords for map marks
CONVOY_SPAWN_KEYWORD = "convoy start"
CONVOY_DEST_KEYWORD = "convoy end"
Complete Dual-Coalition Example
See Moose_CTLD_Init_DualCoalitions.lua for a complete example setting up both BLUE and RED coalitions with all systems enabled.
Player Usage
CTLD Operations
- Spawn in a supported helicopter/transport aircraft
- Fly to a Pickup Zone (marked with smoke)
- Access F10 Menu → CTLD
- Request Crates under Logistics → Request Crate
- Load Crates by hovering or landing near them
- Transport and Deploy crates at desired locations
- Build Units using Operations → Build menus
- Load/Deploy Troops for combat operations
MEDEVAC Operations
- Monitor for Alerts when enemy vehicles are destroyed
- Get Vectors using F10 → CTLD → Navigation → MEDEVAC Vectors
- Pickup Crews by landing/hovering at their location and holding position
- Transport to MASH zone (marked with beacons and smoke)
- Deliver by landing in MASH zone and holding for offloading
- Earn Salvage Points for successful deliveries
Salvage Collection
- Receive Alerts when enemy wrecks spawn salvage opportunities
- Locate Crates using F10 → CTLD → Navigation → Salvage Vectors
- Sling Load by hovering over crate and hooking with helicopter
- Transport to Zone fly to active salvage collection zone
- Deliver by releasing sling within zone boundaries
- Check Status using F10 → CTLD → Logistics → Salvage Status
FAC Operations
- Spawn in a FAC-configured aircraft (group name containing "AFAC", "RECON", or "RECCE")
- Access F10 Menu → FAC/RECCE
- Enable Auto-Lase for automatic target designation
- Scan for Targets and select priority threats
- Request Support (artillery, naval gunfire, air strikes)
Convoy Operations
- Place Map Mark with "convoy start" near a CTLD zone to spawn
- Place Destination Mark with "convoy end" to set route
- Monitor Progress via coalition messages
- Provide CAS when convoys request air support
- Redirect active convoys with additional destination marks
Configuration Options
CTLD Core Settings
CoalitionSide: BLUE or RED coalitionLogLevel: Logging verbosity (0-4)MessageDuration: On-screen message display timeBuildRadius: Distance for collecting crates to buildCrateLifetime: Auto-cleanup time for undelivered cratesInventory.Enabled: Per-zone stock tracking
Aircraft Capacities
Configure load limits per aircraft type:
AircraftCapacities = {
['UH-1H'] = { maxCrates = 3, maxTroops = 11, maxWeightKg = 1800 },
['CH-47F'] = { maxCrates = 10, maxTroops = 33, maxWeightKg = 12000 },
}
MEDEVAC System
InitialSalvage: Starting salvage points for the coalitionMobileMASH.Enabled: Enable deployable MASH units via crate buildsMobileMASH.ZoneRadius: Radius of MASH zones in metersMobileMASH.BeaconFrequency: Radio frequency for MASH beaconsMobileMASH.AnnouncementInterval: How often MASH locations are announced (seconds)
Sling-Load Salvage System
SlingLoadSalvage.Enabled: Master switch for salvage systemSlingLoadSalvage.SpawnChance: Probability of salvage spawning when enemy units die (per coalition)SlingLoadSalvage.WeightClasses: Configuration for salvage categories and valuesSlingLoadSalvage.CrateLifetime: Time before salvage crates expire (seconds)SlingLoadSalvage.MaxActiveCrates: Maximum simultaneous salvage crates per coalitionSlingLoadSalvage.ConditionMultipliers: Value modifiers based on delivery condition
Troubleshooting
Common Issues
- No CTLD menu: Check script load order and Moose installation
- Cannot request crates: Ensure within range of active Pickup Zone
- Build fails: Verify sufficient crates and correct zone restrictions
- FAC not working: Check aircraft group naming and FAC script loading
Debug Logging
Set LogLevel = 4 in configuration for detailed debug information in dcs.log.
Zone Validation
Use the included validation tools to ensure zones are properly configured and accessible.
Contributing
This is a pure-MOOSE implementation focused on template-free setup and comprehensive logistics simulation. Contributions should maintain compatibility with the MOOSE framework and follow the established code patterns.
License
See individual script headers for licensing information. This implementation is based on original CTLD work by Ciribob with MOOSE adaptations.