Skip to content

The Manifest (mod.json)

mod.json is one JSON object. Every field the port reads:

Field Type Default Meaning
schema_version integer 1 The manifest format the mod was written for (see API versioning)
id string required 1 to 63 characters of a-z, 0-9, _, . and -, starting with a letter or digit, with no ... The id names the mod's settings and storage files. A package with an invalid id is rejected.
name string required Title on the MODS screen
version string "0.1.0" Shown on the card
author string "Unknown" Shown on the card
description string "" Shown on the card
icon string "" Path of an image in the mod
category string see below gameplay, gamemode, ui, assets, scripts, level, camera or multiplayer. An unknown value becomes gameplay with a warning on the card. Without the field, a mod with a gamemode block is gamemode and any other is gameplay.
entry string or object "scripts/main.lua" if that file exists The Lua file to run: "scripts/main.lua" or { "lua": "scripts/main.lua" }. A mod with no entry runs no script (an asset-only mod).
dependencies array [] Ids of mods this one needs, as strings or { "id": "..." } objects. At most 8.
conflicts array of strings [] Ids of mods this one cannot run with. At most 8.
gamemode object none Makes the mod a gamemode; fields below
settings array [] Settings shown on the mod's card (or on a Settings tab) and read with obm.config.get; at most 12
bindings array [] The mod's input actions, each with default keys the player can rebind on the Buttons tab; at most 8 (see Bindings)
toggle string or array of strings "" For a built-in mod: the key of a bool or choice setting that turns the whole mod on and off (for a choice, index 0 is off and any other choice runs the mod), or up to 4 keys of which any one active runs the mod
levels array [] Custom levels added to the launcher's Quick Play list; at most 8

gamemode fields:

Field Default Meaning
id the mod id What obm.gamemode.active() returns while it is selected
title the mod name Name in ACTIVE GAMEMODE
subtitle "" Line under the title
start_scene "" Scene the gamemode is meant to start in, such as "Hideout/Hideout_Main"
separate_save false When true and this gamemode is active, the game's profile saves (*.obmprofile.json) go to mod_saves/<gamemode id>/ in the user directory instead, so the gamemode does not touch the campaign's saves

settings entries:

Field Meaning
key Name passed to obm.config.get. Entries without a key are skipped.
label Text on the card (default: the key)
help Help line on the card
type "bool" (the default), "int", "float", "choice" or "string"
default Initial value. Defaults: false for bool, 0 for int, 1.0 for float, the first choice, and "" for string.
min, max, step For int (defaults 0, 100, 1) and float (0, 10, 0.1). Values are clamped to min..max.
choices For choice: up to 8 strings. obm.config.get returns the chosen string.
max_length For string: the longest value in bytes, 1 to 63 (default 63)
tab Puts the setting on one of the launcher's Settings tabs instead of the mod's card: display, graphics, gameplay, controls or files. An unknown tab leaves it on the card, with a warning. The setting is shown while the mod is active (always, for a built-in mod).
group With tab: the heading it appears under. A group the tab already has ("CHARACTERS" on Graphics) puts it there; another name makes a new heading after the tab's own. The default is the mod's name (no heading for a built-in mod).
requires Either the key of a bool setting of the same mod (this setting is greyed out while that one is off) or "key=Value" matching a choice, string or bool setting (such as "preset=Custom", which hides this setting in the launcher until the value matches)

The values the player picks are kept under mods.configs.<mod id> in obm.config.json, and the bindings under its _bindings key.

Bindings

A mod that reacts to a key or button declares it as a binding instead of reading a fixed key with obm.input.is_down. The player sees every binding on the launcher's Buttons tab under the mod's name, can give it two keys and a gamepad button, and RESET CONTROLS restores the defaults. Binding a key that another binding or one of the game's actions uses clears it there, as for the game's own actions.

Field Meaning
id What obm.input.binding_down and the others take; the same rules as a mod id
label Name on the Buttons tab (default: the id)
help Help line on the Buttons tab
key, key2 Default keys, as SDL scancode names ("F8", "Left Alt"); "" or absent for none
pad Default gamepad button, as an SDL gamepad button name ("touchpad", "leftshoulder", "y") or "lefttrigger" / "righttrigger"; "none" by default
"bindings": [
  { "id": "toggle", "label": "PHOTO MODE", "help": "Enter and leave photo mode.", "key": "F8" },
  { "id": "boost", "label": "BOOST (HOLD)", "key": "Left Shift", "pad": "leftshoulder" }
]
obm.on("frame", function()
  if obm.input.binding_pressed("toggle") then toggle() end
end)

levels entries (id, title and base_scene are required, or the entry is skipped):

Field Meaning
id What obm.level.active() returns while this level is being played
title Name in Quick Play
base_scene Scene to load, such as "M05/M05_Main". Its mission folder picks the campaign slot (and so the loadout) from the game's level table, so M02/... uses the slot of You Better Watch Out...; a scene outside the campaign's folders uses the M05 slot.
briefing Text in Quick Play and in obm.level.info()
mission A Lua file in the mod, such as "levels/my_level/mission.lua": the level's mission, which runs only while the level's scene is loaded (see Level missions)

A complete manifest:

{
  "schema_version": 1,
  "id": "author.night_shift",
  "name": "Night Shift",
  "version": "1.2.0",
  "author": "Author",
  "category": "gamemode",
  "description": "Short summary for the card.",
  "entry": { "lua": "scripts/main.lua" },
  "icon": "assets/icon.png",
  "dependencies": ["author.shared_hud"],
  "conflicts": ["someone.other_gamemode"],
  "gamemode": {
    "id": "night_shift",
    "title": "NIGHT SHIFT",
    "subtitle": "Every mission after dark",
    "start_scene": "M05/M05_Main",
    "separate_save": true
  },
  "settings": [
    { "key": "darkness", "label": "Darkness", "type": "float", "default": 0.6, "min": 0.2, "max": 1.0, "step": 0.05 },
    { "key": "preset", "label": "Preset", "type": "choice", "choices": ["Calm", "Alert"], "default": "Calm" },
    { "key": "lasers", "label": "Laser tripwires", "type": "bool", "default": true },
    { "key": "callsign", "label": "Callsign", "type": "string", "default": "47", "max_length": 16 }
  ],
  "levels": [
    { "id": "night_shift_m05", "title": "A New Life - Night Shift", "base_scene": "M05/M05_Main", "briefing": "The party, after midnight." }
  ]
}

Set "contracts": true to enable the Contracts menu while the mod is active. In a level entry, scene_code identifies the scene folder and mission_slot selects the campaign slot for loadout, statistics and progress.