Skip to content

Console, Testing and Hotkeys

The port's tools for writing and testing a mod: the F12 console, test runs from a working folder, the environment variables and command-line switches, the hotkeys, and the community contract files.

The F12 console

F12 in game opens the mod console, with or without mods. It has:

  • Hot-Reload All Mods, which reloads at the start of the next frame (like obm.reload()), and the number of active mods and the scene.
  • Lua REPL: a line is run as return <line> if that compiles, otherwise as a statement, and the results are printed. The prompt has its own environment (mod id console), separate from every mod's: it sees the obm API but not a mod's globals. The first line of each error, from the console or a mod, is listed here.
  • Aim-to-Inspect & Contracts: casts a ray from the camera and shows the object it hits (name, ref, distance, position), with buttons to teleport 47 there, toggle the enforcer and ally marks of an actor, open a door, disable a camera, and add an actor to a contract draft; the draft can be saved as a contract and made active.

Testing a mod

  • Point the port at your working folder with OPENBLOOD_MODS_DIR=<folder>, so you can edit the mod in place. OPENBLOOD_MODS_DIR=port/mods/examples loads the examples.
  • Enable mods for one run with OPENBLOOD_ENABLE_MOD=id1,id2 and select a gamemode with OPENBLOOD_GAMEMODE=<gamemode id>, without changing obm.config.json. Add OPENBLOOD_ONLY_MODS=1 to turn every other mod off for that run.
  • Check syntax before starting the game. A luac for Lua 5.5 builds from tools/third_party/port/lua-5.5.1/src; luac -p file.lua reports syntax errors.
  • In game, F6 reloads everything after an edit; F12 shows errors and runs Lua against the live scene.
  • The F10 or Shift+F1 debug overlay's Mods tab shows what each mod costs per frame: its Lua time (average, peak and a graph of the last 120 frames, with a breakdown by event and hook), the engine's calls into it, its live Lua memory and its errors (docs/development/port/debug-ui.md).
  • --no-mods starts without any user mod, to tell whether a problem comes from a mod.
  • To change a built-in mod, copy port/builtin_mods and point OPENBLOOD_BUILTIN_MODS_DIR at the copy; F6 reloads it like any mod.
  • obm.log and the errors also go to the SDL log, which the debug overlay's Log tab lists. On Windows the game opens no terminal; start it with --console to have the log in one too.

Environment variables and command line

Variable or argument Effect
--no-mods, OPENBLOOD_NO_MODS=1 Safe mode: no mods folder is scanned, no user mod runs or overrides files; the built-in mods still run
OPENBLOOD_MODS_DIR=<folder> An extra folder searched for mods first
OPENBLOOD_BUILTIN_MODS_DIR=<folder> Loads the built-in mods from this folder instead of the one beside the executable
--user-dir <folder>, OPENBLOOD_USER_DIR=<folder> Uses that folder as the user directory (obm.config.json, *.obmprofile.json, mods/, contracts/, mod_saves/, crash.txt), so a test run leaves the player's own untouched. It is created if missing; falls back to the platform directory if not writable.
--print-user-dir Prints the resolved user directory and exits
OPENBLOOD_ENABLE_MOD=<id>[,<id>...] Enables these mods for this run
OPENBLOOD_ONLY_MODS=1 Turns every mod off for this run before OPENBLOOD_ENABLE_MOD and OPENBLOOD_GAMEMODE apply
OPENBLOOD_GAMEMODE=<gamemode id> Enables the gamemode's mod and selects it for this run
OPENBLOOD_CUSTOM_LEVEL=<level id> Makes that custom level the active one, until a selection in Quick Play replaces it
OPENBLOOD_ALLOW_NET=1 Allows mod networking without the launcher toggle
OPENBLOOD_LAUNCHER_SCREEN=<screen> Opens the launcher on quick_start, contracts, mods, settings or bindings
OPENBLOOD_LAUNCHER_TAB=<tab> With settings, the settings tab to open
OPENBLOOD_LAUNCHER_ROW=<n> With settings or bindings, the row of the tab to choose first (0 is the top), so a capture shows the rows further down, such as the mods' bindings
OPENBLOOD_LAUNCHER_CAPTURE=<png> Draws the launcher into a PNG and quits

Hotkey map

Keys the port uses:

Key Use
F10 or Shift+F1 Debug overlay. Bare F1 toggles the PC camera.
(unbound) Quick save, quick load (bind under Settings → Buttons)
F6 Reload mods
F7 Randomiser contract briefing (while Randomiser is active; a binding of the built-in mod)
F8 Photo mode (when enabled in settings; a binding of the built-in mod)
Tab Randomiser dossier toggle (while Randomiser is active; a binding of the built-in mod)
Left Alt Instinct (when enabled in settings; a binding of the built-in mod)
F11 Window or fullscreen
F12 Mod console

Keys the game uses in the default PC layout: W, A, S, D, the arrow keys, Space, Left Ctrl, Left Shift, Left Alt, E, Return, Escape, P, M, R, G, B, C, Q, T, V, X, Z, I, 1 to 8, and the mouse. The original debug bindings also take K (free camera), Shift+F (fail the level) and Pause. Players can rebind the game's keys in the launcher, so a mod's key may still collide on some setups.

Keys free in the default setup: F2, F3, F4, F7, H, J, L, N, O, U, Y, 9, 0, Insert, Delete, Home, End, Page Up, Page Down, [, ] and the keypad.

The example mods use these keys, each once:

Key Example Use
F2 speedrun_hud Reset the timer
F3 roulette Spin again
F4 midnight_remix Next colour grade
F7 ghost_race Save the run as the ghost if it is the fastest
F10 level_editor Open and close the editor. Use Shift+F1 for the debug overlay while testing this binding.
H enforcer_hacker Hack the nearest camera or door
Y enforcer_hacker Recruit the nearest actor as an ally
J blackout_weather Power breaker action
L blackout_weather Flashlight
O cinematic_camera Next camera mode
N tactical_gadgets Drop a banana trap
U tactical_gadgets Throw an EMP orb
9 gadget_arsenal Concussion blast
0 gadget_arsenal Sonic lure
[ superhot_chaos Bullet time
] superhot_chaos Ragdoll the nearest actor
Insert shader_visions Next shader
End tactical_cones_lasers Blink to the aimed point
Home freelancer Contract board (in the Hideout)

Community contracts

Contracts are JSON files in contracts/ of the user directory. Three starter contracts are written when the folder is empty.

{
  "id": "suburban_phantom",
  "title": "The Suburban Phantom",
  "author": "ICA Contracts",
  "scene": "M05/M05_Main",
  "briefing": "Eliminate the jogger and the clown during the party.",
  "kill_method": "Any Method",
  "disguise": "Suit Only",
  "suit_only": true,
  "targets": ["Jogger", "Clown"]
}

When an active mod declares "contracts": true, the launcher's Contracts screen lists them and starts one in its scene with the contract tracker shown: a panel listing the targets, each ticked when an actor whose name contains that text is dead. The tracker does not end the mission. Contracts can also be made in the F12 console or with obm.contracts.save.

Starting from the command line

Run openbloodmoney --help for launch options. Use --mission, --difficulty and --loadout for Quick Play, --scene for a scene, and --mods-dir, --enable-mod or --only-mods to select test mods.

--contract ID starts a contract, and --profile NAME selects a profile. Use --play to launch immediately or --launcher to open the menu. --list-missions, --list-mods and --list-config print available choices. --reset-config uses defaults for a run. --fps and --fov override the frame limit and field of view. --disable-mod ID and --gamemode ID select the mods and game mode for testing. --console shows the log in the terminal the game was started from, or in a new console window (Windows; elsewhere the log always goes to stderr).