Your first mod
This walks through one complete mod: insert one line of narration into the opening scene, check that it links, run
it in the port, and export it for the original engine. The steps are the same for every game. The values that
differ per game (options, the page, the site, the fingerprint) are in your game’s guide, under “First mod values”
(games/README.md). Each game also ships the finished result in oms/examples/mods/.
Commands run from age-reimpl/ unless a step says otherwise. Ome.Cli is the command-line tool:
dotnet run --project engine/Ome.Cli -- <command> [options]The examples below shorten that to Ome.Cli <command>, and write <game options> for the options your game guide
lists (empty for the default game).
0. Prerequisites
Section titled “0. Prerequisites”- The .NET 10 SDK that
global.jsonnames, Python 3.11 and Godot 4.7 .NET, as for the port itself (../../README.md). - The game install in its expected place (your game guide says where), or
--game-root DIR. - One build:
dotnet build engine/OmeEngine.sln. - The generated registries, which fragments that
use <game>.globalsneed. Runpy -3.11 -X utf8 tools/globals_build.py --game <game> --build, andpy -3.11 -X utf8 tools/patch_points_build.py --game <game> --buildif the game has patch points. A game whose guide says it has no registry yet has no<game>.globalsmodule: skip the first command, and leave theuse <game>.globalsline out of the fragment below.
Every Ome.Cli command selects the game with its game options: --game, --game-root, and --overlay-root
for an install with a translation layer. A translation that replaces scripts changes the base your fragment edits,
so use the same options for every step.
1. Find the place to edit
Section titled “1. Find the place to edit”Run the game in the port (.\run-godot.cmd, plus the switches in your game guide) and stop on the page you want to
change. Press F2 to show the page locator and F3 to copy it. A locator reads like
SC0000 P003 · wait SC0000@0x8a6 · text SC0000@0x89e. Then resolve it to bytecode:
py -3.11 -X utf8 tools/locate_page.py SC0000 3 --context 12The output lists the page’s text, its show-text and wait-for-input offsets, and the disassembly around them.
Offsets are dword offsets into the script; those are the sites a fragment names.
To insert a new page before an existing one, attach it to the instruction that starts the page, which is the
reset-adv-text-layout right after the previous page’s wait-for-input and end-text-line:
0x00871: wait-for-input 0x0 ; end of the previous page 0x00874: end-text-line 0x0 0x00877: reset-adv-text-layout 0x1 ; start of the next page: insert before thispatching.md covers choosing sites in more detail.
2. Get the base fingerprint
Section titled “2. Get the base fingerprint”A fragment names the exact bytes it edits. Print the header line for the script:
Ome.Cli oms-patch --fingerprint SC0000.BIN <game options>It prints a line such as patch "SC0000.BIN" fingerprint "sha256:…" to paste into the fragment. Use the full file
name, including .BIN.
3. Write the mod
Section titled “3. Write the mod”Create a folder; its name is up to you. Give the mod a lowercase dotted id, ideally one that starts with a name you own:
my.first-line/├── manifest.toml└── patches/ └── opening.omsmanifest.toml:
omp = 1id = "my.first-line"name = "My first line"version = "1.0.0"description = "Adds a line of narration to the opening."
[game]profile = "<game>"target = "native"patches/opening.oms (your game guide has the complete file with its fingerprint and site):
oms 1patch "SC0000.BIN" fingerprint "sha256:<the fingerprint from step 2>"use <game>.globalsuse <game>.adv
before site <the site from step 1> { "[MOD] Hello from my first mod."}The quoted line is a dialogue statement from the game’s ADV prelude (oms/<game>/adv.oms). It expands to the
same instructions as the game’s own narration pages: show the text, wait for a click, reset the text layout. Add a
speaker and voice the same way the decompiled scenes do (oms-language.md, “Dialogue lines”).
4. Check that it links
Section titled “4. Check that it links”Ome.Cli omp check --mod my.first-line <game options>A good result ends with omp check: links: 1 mods; 0 errors, …. The note “compiled … at load time (no stored
plan)” is expected while you develop. omp build removes it (step 7).
A wrong fingerprint, a site that is not an instruction start, or a syntax error stops here with the file, line and
column (troubleshooting.md).
5. Run it in the port
Section titled “5. Run it in the port”.\run-godot.cmd <game switches> -Mod my.first-lineStart a new game. Your line appears as its own page at the place you chose. The console prints [mods] lines with
the load order and every file the mod supplied. The full link report is written to diagnostics/mod-link.txt in
the profile’s data folder (cli.md).
To keep a mod installed rather than passing -Mod each time, copy its folder (or its .omp) into the profile’s
mods/ folder (cli.md, “Installing mods in the port”).
6. Run it in native AGE
Section titled “6. Run it in native AGE”Native AGE cannot read mods, so export the linked result as game files:
Ome.Cli omp export --output-dir build/my-export --mod my.first-line <game options>For this mod that writes one file, the patched SC0000.BIN. Native AGE reads loose .BIN files beside AGE.EXE
before its archives, so the file overrides the original. Install it into a copy of the game, never the original:
py -3.11 -X utf8 tools/native_scratch.py --game <game> --replace --overlay build/my-export/SC0000.BINThat builds build/games/<game>/native-scratch/ with your files added. Run its AGE.EXE, or drive it with
tools/drive.py native (../tools-reference.md, “Game driver”).
7. Package it
Section titled “7. Package it”Ome.Cli omp build my.first-line <game options>omp build compiles every fragment against the base and writes my.first-line-1.0.0.omp beside the folder. The
package is a ZIP file with fixed timestamps, so the same sources always produce the same bytes. Inside it, each
fragment’s compiled transform plan sits beside its source (patches/opening.omspatch.json). Your folder is not
changed. Players load the stored plan instead of compiling your source on their machine. The source stays in the
package so anyone can read and rebuild it.
Where next
Section titled “Where next”- More operations (
after,replace, operand edits) and how mods combine: patching.md. - A scene of your own, or a data edit at boot: new-scenes.md.
- Every manifest field: packages.md.