Skip to content

Prerequisites

Required tools#

Courage Reborn#

Mods depend on the Augment symbol map, which is only emitted when the game is built with hooks enabled.

cd pc
cmake -B build -DCR_ENABLE_HOOKS=ON
cmake --build build --target tp_pc

This produces:

  • pc/build/tp_pc (or tp_pc.exe on Windows), the game binary
  • pc/build/augment.bin, packed symbol map your mods resolve against (loaded from the game launch directory at runtime)

Optional: TypeScript support#

If you want to write mods in TypeScript and compile them to Luau, you need Node.js ≥ 18 from nodejs.org, plus two repositories: ts-luau (the compiler) and crxts-types (game API typings).

Clone and build ts-luau first:

git clone https://github.com/aussa/ts-luau.git
cd ts-luau
npm install
npm run build

Clone crxts-types anywhere on disk (it is not vendored in Courage Reborn):

git clone https://github.com/aussa/crxts-types.git

In your mod's package.json, point @courage/types at that clone with a file: path:

{
  "devDependencies": {
    "@courage/types": "file:path-to-crxts-types"
  }
}

From your mod directory, run npm install so the local types package is linked:

npm install

See the TypeScript scripting guide for the full setup.


Optional: CReact UI panels#

Mods with CReact UI compile TSX to creact/panel.bundle.js and/or creact/popup.bundle.js using Bun in pc/ui/. Install Bun from the official installation guide, then run bun install once in pc/ui/.

Walkthrough: Build a CReact mod.


Folder conventions#

Courage Reborn looks for a mods/ folder in this order:

  1. <data_path>/mods when data_path is set in config.ini and that folder exists
  2. <launch_dir>/mods beside the game executable (common for local dev)
  3. <user_data>/mods under Application Support (or the platform equivalent)

During development, keep mods next to your build output:

pc/build/
├── tp_pc
├── augment.bin
└── mods/
    └── my-mod/
        └── mod.json

If that folder exists, the game prefers it over the copy under Application Support. See Folders and paths for platform defaults and config.ini keys.

Scripted mod package#

Petrichor loads every subdirectory that contains a mod.json:

mods/
└── my-mod/
    ├── mod.json          # required
    ├── main.luau         # entry (or path from mod.json)
    ├── assets/           # images, HLSL, data (optional)
    │   └── icons/
    │       └── heart.png
    └── creact/           # CReact bundles (optional)
        ├── panel.bundle.js
        └── popup.bundle.js

TypeScript layout#

If you use TypeScript, source lives in src/ and compiles to out/. Copy or symlink out/ into the mod directory before testing:

my-mod/
├── mod.json
├── package.json
├── tsconfig.json
├── src/
│   └── main.ts
└── out/
    └── main.luau   # compiled Luau, loaded by Petrichor