Skip to content

HeavenDCS/DCS-MEDEVAC-HeavenDCS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš DCS MEDEVAC Script v6.0.0

DCS Version License MiST Required

Immersive combat search and rescue missions for DCS World
Experience the tension of medevac operations with realistic casualty management, weather effects, and night operations.


๐Ÿ“‹ Table of Contents


โœจ Features

Core Functionality

  • ๐Ÿฅ Automatic Casualty Generation - Spawns wounded crew when ground vehicles are destroyed
  • ๐Ÿช‚ Search & Rescue (SAR) - Rescue downed pilots from ejected aircraft
  • โฑ๏ธ Dynamic Bleed Timer - Wounded personnel have limited time before they succumb to injuries
  • ๐Ÿš Multiple MEDEVAC Units - Support for multiple rescue helicopters per coalition
  • ๐Ÿฅ MASH Support - Multiple Mobile Army Surgical Hospital locations per side

NEW in v6.0.0 ๐ŸŽ‰

๐Ÿ—บ๏ธ F10 Map Integration

  • Active MEDEVAC locations automatically marked on F10 map
  • Color-coded markers by coalition
  • Auto-updating markers that remove when casualties are rescued or KIA

๐ŸŽ† Enhanced Visual Signaling

  • Signal Flares - Wounded fire periodic flares (every 3 minutes) to mark their position
  • Illumination Bombs - Automatic area illumination during night operations
  • Colored Smoke - Coalition-specific smoke markers (Blue/Red)

๐ŸŒก๏ธ Environmental Effects

  • Weather-Based Difficulty - Temperature affects bleed rates
    • Freezing temps (< 0ยฐC): +30% survival time
    • Cold temps (0-10ยฐC): +15% survival time
    • Hot temps (25-35ยฐC): -8% survival time
    • Extreme heat (> 35ยฐC): -15% survival time
  • Time of Day Effects - Night missions provide additional challenges

๐ŸŽฏ Unit Type Triage System

  • Different bleed rates based on vehicle type:
    • Tank Crews: 20% faster bleed (severe injuries from armor penetration)
    • IFV/APC Crews: 10% faster bleed (moderate injuries)
    • Truck/Light Vehicle: 20% slower bleed (minor injuries)

๐Ÿš Helicopter Damage Warnings

  • Real-time aircraft health monitoring
  • Critical/Warning/Caution alerts based on damage level
  • Helps pilots assess mission risk

๐Ÿ“Š Statistics Tracking

  • Lives saved counter
  • Missions completed
  • Pilots rescued vs crew rescued
  • Total casualties
  • Medics KIA
  • Separate stats per coalition
  • Radio menu command to view statistics

๐Ÿ› ๏ธ Technical Improvements

  • Fixed 40+ "Parameter #self missed" errors
  • Enhanced nil safety checks throughout
  • Improved error handling with detailed logging
  • Fixed all static vs instance method calls per DCS ScriptingLib
  • Pre-populated unitโ†’group cache to handle DCS API limitations
  • Comprehensive debug logging system with 5 verbosity levels

๐Ÿ†• What's New in v6.0.0

Enhanced by HeavenDCS (2025-11-07)

This major update brings DCS MEDEVAC into the modern era with enhanced immersion, better visuals, and robust error handling:

Visual Enhancements

  • ๐Ÿ—บ๏ธ Map markers show active casualty locations
  • ๐ŸŽ† Signal flares fired every 3 minutes from casualty positions
  • ๐Ÿ’ก Automatic illumination of pickup zones at night
  • ๐ŸŽจ Coalition-specific smoke colors

Gameplay Depth

  • ๐ŸŒก๏ธ Weather affects survival time (cold preserves, heat accelerates bleeding)
  • ๐ŸŒ™ Night operations are more challenging with extended search times
  • ๐ŸŽฏ Injury severity varies by vehicle type (tanks vs trucks)
  • ๐Ÿš Helicopter damage warnings keep pilots informed

Quality of Life

  • ๐Ÿ“Š Comprehensive statistics tracking
  • ๐Ÿ”ง Eliminated all parameter errors
  • ๐Ÿ“ Enhanced debug logging system
  • โšก Improved performance with better caching

Bug Fixes

  • โœ… Fixed incorrect event ID check (was ENGINE_SHUTDOWN, now PLAYER_ENTER_UNIT)
  • โœ… Fixed all string.format nil argument errors
  • โœ… Fixed all static vs instance method calls
  • โœ… Added comprehensive nil safety checks
  • โœ… Protected all method chaining with proper checks

๐Ÿ“ฆ Installation

Prerequisites

  • DCS World 2.5.6 or newer
  • MiST 3.2+ (Mission Scripting Tools)

Installation Steps

  1. Download MiST (if not already installed)

    https://github.com/mrSkortch/MissionScriptingTools
    
  2. Add to Mission Editor

    • Open your mission in DCS Mission Editor
    • Go to Triggers โ†’ New Trigger
    • Set trigger to: MISSION START / TIME MORE (1) / DO SCRIPT FILE
    • First, load MiST script file
    • Then, load medevac.lua script file
    • โš ๏ธ Important: MiST MUST be loaded before MEDEVAC
  3. Configure MEDEVAC Units

    • Place helicopter units you want as MEDEVAC units
    • Place ground units as MASH (Mobile Army Surgical Hospital)
    • Edit the script configuration (see below)
  4. Save and Test

    • Save your mission
    • Test to ensure script loads without errors

โš™๏ธ Configuration

Open medevac.lua and edit the settings section at the top:

Essential Settings

-- Define your MEDEVAC helicopter units (UNIT NAMES)
medevac.medevacunits = {"MEDEVAC #1", "MEDEVAC #2"}

-- Define your MASH units (UNIT NAMES)
medevac.bluemash = {"BlueMASH #1", "BlueMASH #2"}
medevac.redmash = {"RedMASH #1", "RedMASH #2"}

-- Smoke colors for each coalition
medevac.bluesmokecolor = trigger.smokeColor.Blue
medevac.redsmokecolor = trigger.smokeColor.Red

New Features Configuration (v6.0.0)

-- Enable/Disable new features
medevac.useMapMarkers = true          -- Show MEDEVAC on F10 map
medevac.useSignalFlares = true        -- Fire signal flares from wounded
medevac.useIllumination = true        -- Illuminate pickup zones at night
medevac.weatherEffects = true         -- Weather affects bleed rates
medevac.timeOfDayEffects = true       -- Night missions more challenging
medevac.unitTypeTriage = true         -- Different bleed rates by vehicle
medevac.heliDamageWarnings = true     -- Warn pilot of helicopter damage
medevac.trackStatistics = true        -- Track missions/lives saved

-- Fine-tune feature behavior
medevac.flareInterval = 180           -- Seconds between flares (3 min)
medevac.illuminationPower = 1000000   -- Illumination bomb intensity
medevac.nightTimeStart = 19           -- Night begins at 19:00 (7 PM)
medevac.nightTimeEnd = 6              -- Night ends at 06:00 (6 AM)
medevac.mapMarkersReadOnly = true     -- Can players edit markers?

Gameplay Settings

-- Casualty mechanics
medevac.requestdelay = 15             -- Seconds before casualty calls for help
medevac.bluecrewsurvivepercent = 100  -- % of blue crews that survive (0-100)
medevac.redcrewsurvivepercent = 100   -- % of red crews that survive (0-100)
medevac.showbleedtimer = false        -- Show countdown timer?
medevac.sar_pilots = true             -- Rescue downed pilots?
medevac.immortalcrew = true           -- Wounded can't be killed?
medevac.invisiblecrew = true          -- Wounded invisible to AI?

-- Time calculations
medevac.cruisespeed = 40              -- Cruise speed for time calc (m/s)
medevac.minbleedtime = 30             -- Minimum possible bleed time (sec)
medevac.maxbleedtimemultiplier = 1.2  -- Max bleed time multiplier

Coordinate System

-- Choose coordinate display format
medevac.coordtype = 3  -- Options:
                       -- 0 = Lat/Long DDM
                       -- 1 = Lat/Long DMS
                       -- 2 = MGRS
                       -- 3 = Bullseye Imperial (default)
                       -- 4 = Bullseye Metric

Debug Settings

-- Debug verbosity levels
medevac.debug_verbose = 0  -- 0=off, 1=errors, 2=warnings, 
                           -- 3=info, 4=debug, 5=trace

๐ŸŽฎ Usage

For Mission Designers

  1. Setup MEDEVAC Units

    • Create helicopter groups for rescue missions
    • Add unit names to medevac.medevacunits table
  2. Setup MASH Units

    • Place ground units to serve as field hospitals
    • Add unit names to medevac.bluemash and medevac.redmash tables
  3. Configure Options

    • Set survival percentages
    • Enable/disable new features
    • Adjust timing parameters

For Players

  1. Start Mission

    • Enter a MEDEVAC helicopter unit
    • Check F10 Radio Menu for "MEDEVAC" submenu
  2. Receive Casualties

    • When ground units are destroyed, crew may survive
    • After ~15 seconds, you'll receive a radio call with coordinates
    • Location appears on F10 map (if enabled)
  3. Locate Casualties

    • Navigate to coordinates
    • Look for:
      • ๐ŸŽ† Signal flares (every 3 minutes)
      • ๐Ÿ’จ Colored smoke (Blue/Red)
      • ๐Ÿ’ก Illumination (at night)
      • ๐Ÿ—บ๏ธ Map marker on F10
  4. Pickup

    • Land within 200m of casualties
    • When speed < 1 m/s, casualties automatically board
    • You'll see "Wounded picked up!" message
    • Status updates on casualty condition during flight
  5. Transport to MASH

    • Fly to nearest friendly MASH
    • Land within 200m with speed < 1 m/s
    • Mission complete!

Radio Menu Commands

Press F10 in a MEDEVAC helicopter:

MEDEVAC
โ”œโ”€โ”€ Active MEDEVAC/SAR - Shows all active casualty locations
โ””โ”€โ”€ View Statistics    - Shows your rescue statistics

๐Ÿ”ง How It Works

Casualty Generation

  1. Script monitors all unit destruction events
  2. When a ground vehicle is destroyed:
    • Checks crew survival percentage
    • Spawns infantry group at destruction location
    • Applies immortal/invisible settings if configured
    • Adds to wounded groups list

Rescue Process

  1. Request Phase (15s delay)

    • Casualty group transmits coordinates
    • Map marker created (if enabled)
    • First signal flare fired (if enabled)
  2. Search Phase (< 3km from casualties)

    • Smoke deployed at casualty location
    • Signal flares fire every 3 minutes
    • Area illuminated if nighttime
  3. Pickup Phase (< 600m)

    • Casualties move toward helicopter
    • Must land within 200m and reduce speed < 1 m/s
    • Casualties automatically board
  4. Transport Phase

    • Bleed timer active
    • Status messages based on severity
    • Helicopter damage warnings (if enabled)
    • Weather affects time available
  5. Delivery Phase (at MASH)

    • Must land within 200m and reduce speed < 1 m/s
    • Mission complete
    • Statistics updated
    • Map marker removed

Bleed Time Calculation

Base time calculated from:

Distance to MASH รท Cruise Speed = Base Time

Then modified by:

  • Weather multiplier (0.85x to 1.3x)
  • Unit type multiplier (0.8x to 1.2x)
  • Random variation (1.0x to 1.2x)
  • Minimum time constraint (30s minimum)

Example: Tank destroyed 40km from MASH in -5ยฐC weather

  • Base: 40000m รท 40 m/s = 1000s
  • Weather: 1000s ร— 1.15 (cold) = 1150s
  • Unit type: 1150s ร— 0.8 (tank) = 920s
  • Random: 920s to 1104s (ร—1.0 to ร—1.2)
  • Result: 15-18 minute time window

๐Ÿ‘ Credits

Original Authors

RagnarDa, DragonShadow & Shagrat (2013-2014)

  • Original MEDEVAC script concept and implementation
  • Core rescue mechanics and gameplay systems

Major Contributors

DragonShadow (v5 Beta)

  • Injection of existing units as MEDEVAC groups
  • Distance-based minimum bleed time calculations
  • Direct flight distance calculations
  • Closest MASH finding algorithm
  • Rescue trigger function system

Shagrat (v5 Beta)

  • Additional gameplay refinements
  • Balancing improvements

alexej21 (v4.1)

  • Immortal wounded crew option
  • RPG soldier spawning option

v6.0.0 Enhancement

HeavenDCS (2025-11-07)

  • Complete code modernization and bug fixes
  • F10 map marker integration
  • Signal flares and illumination system
  • Weather-based difficulty system
  • Time of day effects
  • Unit type triage system
  • Helicopter damage warning system
  • Statistics tracking system
  • Enhanced error handling and logging
  • Fixed 40+ parameter errors
  • DCS ScriptingLib API compliance
  • Comprehensive nil safety checks

๐Ÿ“œ Changelog

v6.0.0 (2025-11-07) - Enhanced by HeavenDCS

New Features:

  • โœจ F10 Map Markers for active MEDEVAC locations
  • โœจ Signal Flares fired periodically from wounded positions
  • โœจ Illumination Bombs for night pickup zones
  • โœจ Weather-Based Difficulty (temperature affects bleed rate)
  • โœจ Time of Day Effects (night missions more challenging)
  • โœจ Unit Type Triage (different bleed rates by vehicle type)
  • โœจ Helicopter Damage Warnings for pilots
  • โœจ Statistics Tracking (lives saved, missions completed, etc.)
  • โœจ Enhanced messaging with context-aware information
  • โœจ Auto-refresh markers as situations change
  • โœจ Coalition-specific statistics
  • โœจ Critical wound alerts

Bug Fixes:

  • ๐Ÿ› Fixed all "Parameter #self missed" errors (40+ instances)
  • ๐Ÿ› Fixed string.format nil argument errors with tostring() wrappers
  • ๐Ÿ› Added comprehensive nil safety checks throughout
  • ๐Ÿ› Fixed all static vs instance method calls per DCS ScriptingLib
  • ๐Ÿ› Protected all method chaining with proper nil checks
  • ๐Ÿ› Fixed incorrect event ID 19 check (ENGINE_SHUTDOWN โ†’ PLAYER_ENTER_UNIT)
  • ๐Ÿ› Pre-populated unitโ†’group cache to handle DCS API limitations

Code Quality:

  • ๐Ÿ”ง Replaced hardcoded coalition numbers with enumerations
  • ๐Ÿ”ง Replaced hardcoded smoke colors with enumerations
  • ๐Ÿ”ง Namespaced global utility functions
  • ๐Ÿ”ง Enhanced error handling with detailed messages and stack traces
  • ๐Ÿ”ง Added input validation for all critical functions
  • ๐Ÿ”ง Improved code documentation and comments
  • ๐Ÿ”ง Added debug logging system with 5 verbosity levels
  • ๐Ÿ”ง Modernized code to use current DCS API best practices

v5.1.0 (2025-11-06)

  • Enhanced error handling
  • Improved code documentation
  • MiST 3.2+ compatibility verification

v5.0 (Beta)

  • Merged changes by DragonShadow and Shagrat
  • Distance-based bleed time calculations
  • Closest MASH finding
  • Rescue trigger functions

v4.2

  • MiST 3.2+ compatibility verified

v4.1

  • Re-smoke on medevac crash
  • Bug fixes

v4.0

  • Immortal wounded option (alexej21)
  • RPG soldier spawn option (alexej21)

v3.2

  • Multiple MASH support
  • Hideable bleed timer option

v3.1

  • MASH coalition validation
  • Coalition-specific smoke colors
  • Removed non-functional MiST messaging option

๐Ÿ†˜ Support

Troubleshooting

Script doesn't load:

  • Ensure MiST is loaded BEFORE MEDEVAC script
  • Check DCS.log for error messages
  • Verify unit names match exactly (case-sensitive)

No casualties spawning:

  • Check crew survival percentages (set to 100 for testing)
  • Ensure ground vehicles are being destroyed
  • Check medevac.debug_verbose setting (set to 3 for info logs)

Helicopter can't pick up casualties:

  • Ensure you're within 200m
  • Reduce speed to < 1 m/s
  • Must be on the ground (not in air)
  • Check coalition matches

Map markers not showing:

  • Ensure medevac.useMapMarkers = true
  • Check F10 map (not F11)
  • Verify casualties are same coalition

Statistics not tracking:

  • Ensure medevac.trackStatistics = true
  • Use F10 Radio Menu โ†’ MEDEVAC โ†’ View Statistics

Debug Mode

Enable detailed logging:

medevac.debug_verbose = 5  -- Maximum verbosity

Check DCS.log file in:

C:\Users\[YourName]\Saved Games\DCS\Logs\

Reporting Issues

When reporting issues, please provide:

  1. DCS version
  2. MiST version
  3. Relevant section of DCS.log
  4. Mission file (if possible)
  5. Steps to reproduce

๐Ÿ“„ License

This script is provided as-is for the DCS World community.

Original Authors: RagnarDa, DragonShadow, Shagrat
v6.0.0 Enhancement: HeavenDCS

Feel free to modify and redistribute with proper attribution.


๐ŸŒŸ Show Your Support

If you find this script useful:

  • โญ Star this repository
  • ๐Ÿ› Report bugs and issues
  • ๐Ÿ’ก Suggest new features
  • ๐Ÿค Contribute improvements
  • ๐Ÿ“ข Share with the DCS community

๐Ÿ”— Related Projects


๐Ÿš Fly Safe, Save Lives ๐Ÿš

For realistic combat search and rescue in DCS World

Report Bug ยท Request Feature ยท Documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages