Reference for db/mods/<key>.json, the file that enrolls a mod. Most authors never open it: CDAL Studio writes it (ENROLL.md). This page is for writing it with Python, editing it by hand, enrolling a BSX Lua script, and what each status report shows.
- CDAL & BSX Hub (Enrolled Mods tab) shows opt-in enrolled mods with their declared feature counts, ID counts, and build status.
- mods.md shows the mod's status on every game build CDAL knows, and a coverage table: how many of the mod's addresses are CDAL IDs, how many are in its own site pack, and the share that keeps working after a game update.
- The CDAL Discord server's mod status board in #mod-status shows every enrolled mod with ✅,
⚠️ or ❌ for the current game build, or ❔ while CDAL has no result for that build. On patch day it updates when the new build's data is merged into CDAL, the same moment the data is published for players. - With your Discord user ID in the file, the bot mentions you when your own mod's status changes. Nobody else is pinged, and nothing else mentions you.
- The pull request that adds a new game build lists every enrolled mod that loses a feature, so the maintainer knows which broken IDs matter most.
- With a Nexus Mods page (
nexus), the mod's row in mods.md links its page in Mods on Nexus, checked against CDAL, with the date and build of its last run in the maintainer's in-game lab. If the scan or a run sees your mod use a CDAL ID your enrollment doesn't list, mods.md names it under IDs an enrollment doesn't list, so you know to enroll again.
The board marks a feature off when the build file has no value for one of its IDs. At run time CDAL may still find that ID by scanning, so the board can be more conservative than the running mod. The mod switches the feature off and logs the reason when its actual cdal::require() call fails. The statuses are in ENROLL.md.
The status comes from CDAL's own check of the game's executable, the same one that builds CDAL's data for that build. It counts only CDAL IDs:
- A mod that also uses its own site pack has its pack addresses checked by its author, not here (
"site_pack": trueputs a note next to it). After a patch, follow PACKS.md, step 6. - A mod that embeds its own copy of CDAL's database (see What to ship) uses the newer
CDAL/folder when the player has one, so the status is right for players who install the data update. - Things that aren't addresses, such as a changed game data file or a struct whose layout changed, can still break a mod that shows ✅.
You need the mod's source (or the list of IDs each feature uses), Python 3.10 or later, and this repository or the CDAL SDK.
-
Open a terminal in the repository (or in the SDK's root folder) and run
set PYTHONPATH=python(in PowerShell:$env:PYTHONPATH = "python"). -
Write the file from your source:
python -m cdal_tools enroll --name "My Mod" --author myname --nexus https://www.nexusmods.com/crimsondesert/mods/1234 --source C:\path\to\my-mod\srcEach distinct set of recognized CDAL IDs in a
require({...})call, in acdal_port::require("Feature", {...})call that CDAL Studio's "Set it up for me" adds (the string becomes the feature's name), or in a C array ofCDAL_ID_...constants becomes one feature. It reads the mod's C and C++ files (.c,.cpp,.h,.hpp,.inc,.inl,.ixx,.tppand similar). Files CDAL Studio writes next to a mod, whose names start withcdal-port-orcdal-agent-, are skipped. Calls and arrays with the same ID set are merged, keeping the first feature's name. Arequire()called on acdal::Feature(g_travel.require({...})aftercdal::Feature g_travel{"My Mod", "Fast travel"}, declared in any file of the mod) takes the declaration's name. Otherwise a comment on the line just above the call becomes the feature's name (// Fast travel), or else the feature is named after its file and line.It writes
db/mods/my-mod.json, updates mods.md, and prints the mod's status on each game build. Add--printto print the file instead of writing it.Without source, or to add a feature by hand, name the feature and its IDs (names as in ids.md);
--featurealso lists separately features that use the same IDs:python -m cdal_tools enroll --name "My Mod" --author myname --feature "Fast travel=Travel::QueueCall1,SaveGame::LoadSlot" --feature "Stamina=StatusComponent::ApplyStatDelta" -
Check it with
python -m cdal_tools validate --check-generated. It names any ID that doesn't exist or is retired. -
Send it: add
--codeand paste the code into Enroll my mod in #mod-status on Discord, paste the file into the Enroll a mod issue form, or commitdb/mods/<name>.json,docs/reference/mods.mdanddocs/reference/mods.jsonin your fork and open a pull request (CONTRIBUTING.md).
Running enroll again with --source updates the features from your source and keeps the names and core flags you gave features whose IDs didn't change.
The code is the file on one line, for the Discord Enroll my mod form: CDAL-ENROLL-1: and then the file as minified JSON, with key (the file name) first and each ID as its number, so it fits the form's 4,000 characters:
CDAL-ENROLL-1:{"key":"my-mod","name":"My Mod","author":"myname","features":[{"name":"Fast travel","core":true,"ids":[173,41]}]}
- CDAL Studio's Copy the enrollment code and open Discord puts it on your clipboard. Without Studio:
tools\cdal-studio.exe enroll <source> --name "My Mod" --author myname --code, orpython -m cdal_tools enroll ... --code. Both print the same bytes. - A mod whose code is longer than 4,000 characters gets an error instead; save the file and use the GitHub form.
python -m cdal_tools enroll --from-code <code>reads a code back and writesdb/mods/<key>.json;--from-issue <file>reads an Enroll a mod issue body, with a code or the file as JSON, and takes the Nexus page and Discord user ID from the form's answers. Both check everythingvalidatechecks and say what is wrong in plain words, and--report <file>also writes the result as JSON. The maintainer's intake workflow uses--from-issue(Handling an enrollment).
{
"name": "My Mod",
"author": "myname",
"nexus": "https://www.nexusmods.com/crimsondesert/mods/1234",
"discord": "123456789012345678",
"features": [
{"name": "Fast travel", "core": true, "ids": ["Travel::QueueCall1", "SaveGame::LoadSlot"]},
{"name": "Stamina", "ids": ["StatusComponent::ApplyStatDelta"]}
]
}name: as players know the mod.author: your name or handle, as on Nexus Mods. Neither may contain a backtick or any of* _ ~ | [ ] < > @ # \, because they are shown in Discord.nexus(optional): the mod's page, linked from the board.discord(optional): your Discord user ID, only if you want to be mentioned when your mod's status changes. To get it: Discord, User Settings, Advanced, turn on Developer Mode; then right-click your name and Copy User ID. It is 17 to 20 digits, not your user name.features: what players would notice is missing.nameis shown on the board, so use words players know ("Fast travel", nothook_travel). List every CDAL ID the feature passes torequire(). Add"core": trueto a feature without which the mod is pointless;--core "Fast travel"does the same from the command line.site_pack(optional):truewhen the mod also uses its own site pack.--sourcesets it when it seescdal::Packorcdal_pack_open.public_ids(optional):truewhen the author opts in to show this mod's name next to its declared CDAL IDs on the Hub's Game Builds & IDs explorer (game-builds.html, visible to visitors who enable Show public mod tags). Pass--public-ids/--no-public-idstocdal enroll(or--public-idstocdal-studio enroll), or tick the optional checkbox on the GitHub enrollment form. Defaults to off (false, omitted from the JSON).pack(optional): the numbers for the coverage table,{"sites": 120, "signed": 117}: how many addresses your site pack has, and how many of thempack signgave a pattern. Don't type it: add--pack <your pack folder>to the command above, after signing the pack (PACKS.md, step 3). Run it again after you sign the pack again.script(optional): BSX Lua metadata,{"version": "1.0.0", "needs_plugins": [], "packs": []}.enroll --source <script folder>writes it fromscript.json; the required CDAL IDs still live infeatures, so existing status-board fields stay the same.
The key, the file name without .json, is lowercase letters, digits and -.
Use the folder containing script.json, normally BSX/scripts/<name>/. Enrollment reads the manifest without running Lua or loading any plugins or packs:
python -m cdal_tools enroll --source C:\path\to\BSX\scripts\hello
For example, script.json can contain:
{
"name": "Hello",
"version": "1.0.0",
"author": "Ratty123",
"lua_api": 1,
"needs_ids": ["Game::Update", "ClientEquipment::Equip"],
"needs_plugins": [],
"packs": [],
"native": false
}- Give
name,versionandneeds_idsin the manifest. IDs use their names from ids.md; unknown or retired IDs are rejected. Use"needs_ids": []when the script needs no IDs.needs_pluginsandpacksare lists of names and default to empty lists. The Lua loader owns runtime settings such aslua_apiandnative; enrollment does not validate or execute those settings. - The manifest supplies the name and author;
--nameand--authorcan override them. If the manifest omitsauthor, supply--authoror keep the author from an existing enrollment. You can pass thescript.jsonfile itself instead of its folder, and use--key,--nexus,--discordand--printas for an ASI mod. - All
needs_idsbecome one core feature calledScript, with duplicates removed. Any missing ID marks the script broken. Edit the manifest to change its required IDs;--featurecannot override them in the same command. Re-enrollment preserves a feature's custom name when its ID set is unchanged, and keeps it core. - The enrollment retains version, required plugin names and pack names in the optional
scriptobject. A non-emptypackslist also setssite_pack; use the existing--packoption for a signed pack's coverage counts. Changing the pack list clears old coverage counts, so pass--packagain if needed. Re-enrollment refreshes the version, IDs and dependencies, including removed dependencies. - Check and send the enrollment and
docs/reference/mods.*as in Writing the file with Python, steps 3 and 4. The script appears alongside ASI mods on the existing status board.docs/reference/mods.mdalso lists its version and dependencies. Plugin installation, plugin versions, pack addresses and Lua behavior are not checked by this board. A script with no required IDs has no missing-ID failures; that is not proof it runs in game.