Keep your DCS mission scripts private and organized
Hide your code from mission files • Load scripts dynamically • Keep intellectual property safe
Features • Installation • Configuration • Usage • FAQ
HeavenLoader is a dynamic script loader for DCS World that separates your mission logic from your mission files. Instead of embedding all your code directly into mission triggers (where anyone can see and copy it), HeavenLoader lets you keep your scripts in a separate, protected directory.
- Mission files contain all your scripts in plain text
- Anyone can open the
.mizfile and steal your code - Large scripts make mission files bloated and hard to manage
- Updating scripts requires re-editing the mission file
Your mission file contains just one line:
dofile(lfs.writedir()..'Scripts\\DynamicLoaderHeaven.lua')All your actual code lives in a separate folder that players never see. 🔒
- 🔐 Privacy First - Your scripts stay outside the mission file
- 📁 Organized Structure - Keep all scripts in one dedicated folder
- 🎯 Load Priority - Control exactly which scripts load and in what order
- 🔄 Auto-Update - Optionally reload scripts during runtime
- 📊 Smart Logging - Detailed feedback on script loading
- ⚡ Fast & Lightweight - Minimal performance impact
- 🛡️ Error Handling - Graceful failure with helpful error messages
- 🔤 Flexible Loading - Alphabetic or priority-based loading modes
Copy DynamicLoaderHeaven.lua to your DCS Scripts folder:
C:\Users\[YourName]\Saved Games\DCS\Scripts\DynamicLoaderHeaven.lua
Create a folder for your protected scripts:
C:\Users\[YourName]\Saved Games\DCS\Scripts\ServerSide\
(Or any folder you configure)
In your DCS mission editor, create a MISSION START trigger:
- TYPE:
4 MISSION START - ACTION:
DO SCRIPT - SCRIPT:
dofile(lfs.writedir()..'Scripts\\DynamicLoaderHeaven.lua')
Place your .lua files in the ServerSide folder:
Scripts\ServerSide\
├── Moose.lua
├── SARSystem.lua
└── YourScript.lua
Open DynamicLoaderHeaven.lua and customize the CONFIG table:
local CONFIG = {
-- Directory where your scripts are stored
scriptDirectory = lfs.writedir() .. "Scripts\\ServerSide\\",
-- Enable/disable the loader
enabled = true,
-- Loading mode
alphabeticOrder = false, -- false = use scriptFiles list
-- true = load all .lua files A-Z
-- Scripts to load (in priority order, top loads first)
scriptFiles = {
"Moose.lua",
"SARSystem.lua",
},
-- File pattern to match
filePattern = "%.lua$",
-- Detailed logging
verbose = true,
-- Auto-reload scripts during mission
autoUpdate = false,
-- Seconds between reloads (if autoUpdate = true)
updateInterval = 300,
}| Option | Type | Description |
|---|---|---|
scriptDirectory |
string | Path to your scripts folder |
enabled |
boolean | Master on/off switch |
alphabeticOrder |
boolean | true = load all .lua files alphabeticallyfalse = only load files in scriptFiles list |
scriptFiles |
table | Array of script filenames in load order |
filePattern |
string | Lua pattern for matching files (default: .lua) |
verbose |
boolean | Enable detailed logging |
autoUpdate |
boolean | Reload scripts periodically during mission |
updateInterval |
number | Seconds between auto-reloads |
local CONFIG = {
alphabeticOrder = false,
scriptFiles = {
"init.lua", -- Loads first
"utils.lua", -- Loads second
"mission.lua", -- Loads third
},
}local CONFIG = {
alphabeticOrder = true,
-- scriptFiles is ignored in this mode
}local CONFIG = {
scriptDirectory = "D:\\MyDCSScripts\\Protected\\",
}local CONFIG = {
autoUpdate = true,
updateInterval = 60, -- Reload every 60 seconds
verbose = true, -- See detailed logs
}local CONFIG = {
autoUpdate = false,
verbose = false, -- Minimal logging
}[HeavenLoader] HeavenLoader v1.0 initializing...
[HeavenLoader] ═══════════════════════════════════
[HeavenLoader] HeavenLoader v1.0
[HeavenLoader] Directory: C:\Users\...\Scripts\ServerSide\
[HeavenLoader] ═══════════════════════════════════
[HeavenLoader] Priority 1: Moose.lua
[HeavenLoader] Priority 2: SARSystem.lua
[HeavenLoader] Loading: Moose.lua
[HeavenLoader] ✓ Loaded: Moose.lua
[HeavenLoader] Loading: SARSystem.lua
[HeavenLoader] ✓ Loaded: SARSystem.lua
[HeavenLoader] ═══════════════════════════════════
[HeavenLoader] Loaded: 2 | Failed: 0
[HeavenLoader] ═══════════════════════════════════
[HeavenLoader] Ready!
[HeavenLoader] Script not found: missing.lua
[HeavenLoader] Failed to open: corrupt.lua
[HeavenLoader] Load error in bad.lua: unexpected symbol near '}'
Protect your work - Mission builders invest hours creating scripts. HeavenLoader keeps your intellectual property safe.
Cleaner workflow - Update scripts without touching mission files. Test changes without re-saving missions.
Professional setup - Separate code from data, just like real software development.
Yes! The scripts run server-side only. The loader itself is lightweight and well-tested.
Absolutely! Load any Lua script in any order. Perfect for frameworks, libraries, and custom code.
Not directly, but you can create multiple instances with different configs or use subdirectories.
No. Impact is negligible. Scripts load in milliseconds.
HeavenLoader continues loading remaining scripts and logs the error. Your mission won't crash.
With autoUpdate = true, yes! Changes reload automatically. Great for live testing.
Some scripts depend on others. Put dependencies first:
scriptFiles = {
"Moose.lua", -- Framework first
"MyMooseCode.lua", -- Code using framework second
}Organize with folders:
Scripts\ServerSide\
├── frameworks\
│ └── Moose.lua
└── missions\
└── MyMission.lua
Then reference: "frameworks\\Moose.lua"
Enable verbose mode and check dcs.log:
C:\Users\[YourName]\Saved Games\DCS\Logs\dcs.log
Contributions welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
- Share your use cases
This project is licensed under the MIT License - see below:
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software.
Copyright (c) 2025
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
- Issues: Use GitHub Issues for bug reports
- Discussions: Share tips and ask questions in Discussions
Made with ❤️ for the DCS community
⭐ Star this repo if HeavenLoader helps your missions!