Supply_Scripts — v1.5

DCS World mission scripts that manage airfield logistics: fuel resupply flights and tracked aircraft deliveries for warehouse restocking in the Normandy theatre.


Overview

These Lua scripts listen for two world events:

v1.5 correction: earlier versions of this README described the second event as "Unit Removed". Event 21 in DCS is S_EVENT_PLAYER_LEAVE_UNIT. The functional behavior (warehouse restock) is the same: a player delivers a tracked aircraft to the airbase, lands, exits, and the configured aircraft_return_multiplier is added to the warehouse item count at the airbase where the aircraft was tracked.

There is no F10 menu in this version; players or mission makers read warehouse state directly in the Mission Editor or via external tools.


Current Mission Scripts

All of these share the same generic engine (supplies_template.lua). Only the CONFIG table at the top differs per mission.

File Notes
supplies_10th June.lua Mosquito delivery at Sainte-Croix-sur-Mer; Bf-109/FW-190 deliveries at Vrigny; 34 neutral bases
supplies_14th August.lua Mosquito delivery at Sainte-Croix-sur-Mer; FW-190 delivery at Broglie
supplies_18th June_partial.lua Neutral bases only (25 airfields forced neutral); no resupply or deliveries
supplies_25th July.lua Allied_Supply1 fuel resupply; Mosquito delivery to Saint Pierre du Mont / Sainte-Croix-sur-Mer; Bf-109/FW-190 deliveries at Argentan; 12 neutral bases
supplies_6th July.lua Blue resupply flights (Sommervieu, Sainte-Laurent-sur-Mer), Mosquito delivery to Saint Pierre du Mont / Sainte-Croix-sur-Mer, 109/190 deliveries to Ronai
supplies_8th August.lua Allied_Supply1 resupply, Mosquito delivery, Bf-109/FW-190 deliveries to Broglie
supplies_24th June.lua Mosquito delivery to Saint Pierre du Mont / Sainte-Croix-sur-Mer, Bf-109/FW-190 deliveries to Vrigny, 19 neutral bases
supplies_template.lua Mission-agnostic template. Copy and edit the CONFIG table for new dates

Legacy originals moved to old/ (archived for reference only).


Generic Template: supplies_template.lua

supplies_template.lua is a mission-agnostic drop-in replacement. You configure a single CONFIG table at the top of the file instead of editing hardcoded logic throughout the script.

Configuration Sections

Section Purpose
resupply_flights When a named group lands at a specific airfield, add fuel to target warehouses
aircraft_deliveries When an aircraft type lands at allowed airfields, track it and restock the warehouse when the player leaves the unit
aircraft_return_multiplier How many aircraft are returned to warehouse stock per delivery (default 1)
neutral_bases Static list of airbase names to force neutral (coalition 0, auto-capture off) at mission start

When an aircraft tracked by aircraft_deliveries is left by its player (event 21 fires), the script adds the configured aircraft_return_multiplier to the warehouse item count. Set this value higher than 1 to reward larger stock returns per delivery (for example, CONFIG.aircraft_return_multiplier = 3).

Example snippet

CONFIG.resupply_flights = {
  {
    group_name = "Blue_Resupply 1-1",
    land_at = "Sainte-Laurent-sur-Mer",
    deliveries = {
      { airbase = "Saint Pierre du Mont", liquid_type = 1, amount = 4000 },
      { airbase = "Cricqueville-en-Bessin", liquid_type = 1, amount = 5000 },
    }
  },
}

CONFIG.aircraft_deliveries = {
  {
    aircraft_type = "MosquitoFBMkVI",
    land_at = { "Saint Pierre du Mont", "Sainte-Croix-sur-Mer" },
    warehouse_item = "MosquitoFBMkVI",
    tracked_table = "mosquitos",
    exclude_pattern = "Player deliverable",
  },
}

Neutral Bases

Instead of auto-scanning all airbases at mission start, each mission file now contains an explicit CONFIG.neutral_bases list. Only the named bases are forced neutral (coalition = 0, autoCapture = false).

This avoids surprises when the map changes or new airbases are added by ED, and makes the mission configuration fully self-documenting.

Migration from v1.2 templates:

Logic Flow Diagrams

Landing Event Flow

World Event id == 4 (Landing)

Unit belongs to a resupply flight group?Add fuel to target warehouse(s)Aircraft type is a tracked delivery type and landed at an allowed airfield?Group name matches exclude pattern?Add entry to tracked deliveries tableNo action YesNoYesNoNoYes

Player Leave / Warehouse Restock Flow

World Event id == 21 (Player Leaves Unit)

Unit type matches any tracked delivery table?Group name found in tracked table?Add item to airbase warehouseRemove entry from tracked tableNo action YesNoYesNo

Neutral Base Setup Flow

Mission StartIterate CONFIG.neutral_basesGet airbase by nameairbase:autoCapture(false)airbase:setCoalition(0)Finished All bases done

Changelog

Version Changes
1.5 Current
1.4 --
1.3 --
1.2 --
1.2.1 --

Dependencies