How mods work¶
Data mods and code mods¶
| Data mod | Code mod | |
|---|---|---|
| Files | JSON, art, sound | JSON plus Lua scripts listed in mod.json "scripts" |
| Can do | Add and change rows | Everything a data mod can, plus behaviour: card effects, car perks, enemy AI, weapon patterns, difficulty rules, drawing |
| Loads | When its switch under MODS is on | Also needs Settings > MODS > MOD CODE on (off by default, applies on RELOAD MODS); built-in mods excepted |
Scripts have full access to the game and the computer, like Minecraft Java
mods. That is why MOD CODE is opt-in. TAX_LOVE_MOD_CODE=1 turns it on for
one launch.
Rules for every row¶
- Same id changes a row. Only the fields you give change:
{"id": "van", "hearts": 8}gives the Armored Van eight hearts. - New ids are prefixed. A new row's id starts with your mod id and a dot,
such as
nightmare.nightmare, so two mods never clash. - Load order. Base game first, then the built-in mods, then mods in folder-name order, then Workshop items. A later mod's change wins. New difficulties join the top of the ladder in that order.
- Validation. Every row is checked for unknown fields, out-of-range values, non-ASCII text, missing prefixes and broken references. One bad row skips the whole mod, and the MODS list says why. The game always starts on what is valid.
mod.json¶
{
"id": "arsenal",
"title": "Arsenal",
"version": "1.0",
"api": 1,
"author": "You",
"description": "What the mod does.",
"scripts": ["main.lua"]
}
The reference lists every field. A mod that builds on
another names it in requires (it loads after it, and is skipped without
it) or after (it only loads after it); see
Talking to other mods.
Cosmetic mods¶
A mod with only art, sound, music, paints and announcer lines is cosmetic. Its runs stay comparable with unmodded ones.