Important
The manifest system is auto-detected. If a manifest.json file exists in your script folder, ALE automatically switches to manifest mode. No config option needed.
- Overview
- How It Works
- Root Manifest
- Module Manifest
- Load Order
- Retrocompatibility
- Differences from Legacy Mode
- Examples
ALE supports two script loading modes:
| Mode | Trigger | Behavior |
|---|---|---|
| Manifest mode | manifest.json exists in script folder |
Loads only modules and files specified in manifests, in the defined order |
| Legacy mode | No manifest.json found |
Recursively scans all folders, loads all .lua/.ext/.moon files, sorted alphabetically |
The manifest system is inspired by FiveM's fxmanifest.lua resource system. It gives you explicit control over:
- Which modules to load (not everything in the folder)
- In what order modules are loaded
- Which files within each module to load
- In what order files are loaded
This solves a common problem: in legacy mode, file loading order is determined by alphabetical sorting of file paths, which means a file in handlers/ loads before init.lua (because h < i). With manifests, you control the order explicitly.
lua_scripts/
├── manifest.json ← Root manifest (lists modules to load, in order)
├── my_module/
│ ├── manifest.json ← Module manifest (lists files to load, in order)
│ ├── init.lua
│ ├── utils/
│ │ └── helpers.lua
│ └── handlers/
│ ├── player.lua
│ └── creature.lua
└── another_module/
├── manifest.json
└── main.lua
- ALE checks if
manifest.jsonexists in the script folder (configured viaALE.ScriptPath, default:lua_scripts) - If found, manifest mode is activated
- The root manifest is parsed to get the ordered list of modules
- For each module, its
manifest.jsonis parsed to get the ordered list of files - Files are loaded in the exact order specified
The root manifest (lua_scripts/manifest.json) lists the modules to load, in order.
{
"modules": [
"my_module",
"another_module",
"subfolder/third_module"
]
}| Field | Type | Required | Description |
|---|---|---|---|
modules |
string[] |
Yes | Ordered list of module directory names (relative to the script folder) |
- Module names are relative paths from the script folder
- Nested paths are supported:
"utils/library"refers tolua_scripts/utils/library/ - Order matters: modules are loaded top-to-bottom
Each module can have its own manifest.json listing the files to load, in order.
{
"files": [
"init.lua",
"utils/helpers.lua",
"handlers/player.lua",
"handlers/creature.lua"
]
}| Field | Type | Required | Description |
|---|---|---|---|
files |
string[] |
Yes | Ordered list of file paths (relative to the module directory) |
- File paths are relative to the module directory
- Nested paths are supported:
"handlers/player.lua"refers tomy_module/handlers/player.lua - Only the files listed are loaded - other files in the module directory are ignored
- Order matters: files are loaded top-to-bottom
If a module directory does not contain a manifest.json, ALE falls back to recursive scanning within that module. This means:
- All supported files (
.lua,.moon,.out) in the module and its subdirectories are loaded - Files are NOT sorted (they are loaded in directory iteration order)
- This is useful for simple modules with a single file or when order doesn't matter
Tip
For modules with dependencies between files (e.g., init.lua must load before handlers), always use a module manifest to guarantee load order.
The load order is fully deterministic and controlled by the manifests:
Root manifest modules[0] → module manifest files[0], files[1], ...
Root manifest modules[1] → module manifest files[0], files[1], ...
...
With this root manifest:
{ "modules": ["combat", "quests"] }And combat/manifest.json:
{ "files": ["init.lua", "handlers/player.lua"] }The load order is:
combat/init.luacombat/handlers/player.luaquests/...(first file from quests module)
In legacy mode, files are sorted alphabetically by full path. This means:
| Legacy order | Manifest order |
|---|---|
combat/handlers/player.lua (h) |
combat/init.lua (1st) |
combat/init.lua (i) |
combat/handlers/player.lua (2nd) |
With legacy mode, handlers/player.lua loads before init.lua, which breaks if player.lua depends on variables set up by init.lua. The manifest system solves this.
The manifest system is fully retrocompatible:
- No
manifest.json→ Legacy mode is used (recursive scan, alphabetical sort,.extfiles loaded) manifest.jsonpresent → Manifest mode is used automatically- Module without
manifest.json→ That module falls back to recursive scanning
You can migrate gradually:
- Start with legacy mode (no manifest)
- Create a root
manifest.jsonlisting your existing folders as modules - Add module manifests one by one to control file order within each module
| Feature | Legacy Mode | Manifest Mode |
|---|---|---|
| File discovery | Recursive scan of all folders | Only files listed in manifests |
| Load order | Alphabetical by file path | Order defined in manifests |
.ext files |
Loaded (before .lua files) |
NOT loaded |
.lua files |
Loaded | Loaded |
.moon files |
Loaded | Loaded |
.out files |
Loaded | Loaded |
.dll/.so files |
Loaded | Loaded |
| Hidden files/dirs | Skipped | Skipped |
require() paths |
All subdirectories added | Only module directories and file subdirectories added |
| Auto-reload | Watches .lua/.ext/.moon |
Watches .lua/.ext/.moon/.json |
Warning
If you are using .ext extension files and want to switch to manifest mode, convert them to regular .lua files and list them in your module manifest instead.
lua_scripts/manifest.json:
{
"modules": ["my_scripts"]
}lua_scripts/my_scripts/manifest.json:
{
"files": [
"config.lua",
"main.lua"
]
}lua_scripts/manifest.json:
{
"modules": [
"core_library",
"combat_system",
"quest_system",
"economy"
]
}This ensures core_library loads first, then combat_system, etc.
lua_scripts/combat_system/manifest.json:
{
"files": [
"init.lua",
"utils/damage_calculator.lua",
"handlers/player_handler.lua",
"handlers/creature_handler.lua"
]
}If lua_scripts/simple_scripts/ has no manifest.json, all supported files in that directory and its subdirectories will be loaded automatically.
- Before (legacy mode - everything loads automatically):
lua_scripts/
├── lib/
│ └── utils.lua
├── combat/
│ ├── init.lua
│ └── handlers.lua
└── quests/
└── main.lua
- Step 1 - Add root manifest (modules load in order, but files within each module still scan recursively):
{
"modules": ["lib", "combat", "quests"]
}- Step 2 - Add module manifest to
combat/to control file order:
{
"files": ["init.lua", "handlers.lua"]
}