Mod manifest (mod.toml)
What mod.toml is, and the four fields every manifest must have.
mod.toml, a TOML file at the root of a mod's folder. It
is optional (rule 31): a folder without one is a TA mod named after its
folder. Add one to give the mod an id, a version and the other fields on
these pages. How AEX lists, registers and switches mods: docs/modding.md.
src/aex/creator/ModManifest.h is the one implementation of these rules,
used by the mod registry and the content pack loader alike.
The worked example
The smallest usable manifest, from examples/public/creator/hello-world-mod/:
id = "hello-world-mod"
name = "Hello World Mod"
version = "0.1.0"
aex_version = "0.2"
A commented copy to start from: ../../templates/mod.toml.
Required fields
| Field | Type | Description |
|---|---|---|
id |
string | Stable unique identifier, Identifier Rules. The mod's namespace: its content is keyed <id>.<content-id>. The menus remember the active mod by it. |
name |
string | What the menus show. |
version |
string | The mod's version, MAJOR.MINOR.PATCH. Two machines must have the same id and version to play together. |
aex_version |
string | The oldest AEX the mod works with, numbers and dots (0.2). |
A missing, empty or non-string required field makes the manifest unusable: the menus list the mod with the reason and it cannot be chosen.
idmust match^[a-z][a-z0-9-]*$. A second registered mod with an id already listed is listed with an error.aex_versionthat is not numbers and dots is an error. An AEX older thanaex_versionlists the mod with the reason and does not load it. The comparison is numeric, missing components count as 0 (1.0=1.0.0), and a-preor+buildtail is ignored.- A
versionthat is not numbers and dots is a warning.
What goes wrong
AEX logs each problem with a mod's manifest to aex.log as
[mods] <mod folder>: <problem>, and Options > Install shows the same
reason on the mod's row. These make the mod unusable:
[mods] <mod folder>: missing required field 'id'
[mods] <mod folder>: field 'name' must be a string
[mods] <mod folder>: field 'version' must be non-empty
[mods] <mod folder>: id='My_Mod' does not match IDENTIFIER_RULES regex ^[a-z][a-z0-9-]*$
[mods] <mod folder>: id 'my-mod' is already used by <other mod folder>
[mods] <mod folder>: aex_version='0.2a' is not a version (expected numbers and dots, e.g. 0.2)
[mods] <mod folder>: needs AEX 0.9 or newer (this is AEX 0.7.5)
[mods] <mod folder>: TOML parse error at line 3:15: <reason>
This one is only a warning; the mod still loads:
[mods] <mod folder>: version='beta' is not SemVer MAJOR.MINOR.PATCH
Next
- Optional fields: name, icon, menu style and the other defaults.
- Identifier Rules.