Manual Modding
This guide will assume that you are comfortable using a terminal.
Decompiling
In order to make a mod, you’ll have to reference the original assets. However, some parts of the game are obfuscated or otherwise hidden. These are:
- Images
- Audio
- JSON (used for things like map layouts, events, etc.)
- Main game code
To get usable assets, this guide will walk you through using a tool called Grimoire to decrypt assets and decompile the main game code.1
Alternatively, you may use Tomb’s built-in tool to make a decrypted copy of the game as an RPG Maker MV project. However, this will not extract the main game code; if you want that, you must use Grimoire.
To run Grimoire, you will need to install Deno. Once installed, you can run the following scripts in the terminal (in the game folder):
# Deobfuscate the main game code
deno run --allow-read --allow-write=clean.js --allow-env https://codeberg.org/basil/grimoire/raw/branch/main/deobfuscate/main.ts
# Decrypt the game assets
deno run --allow-read --allow-write=out/ https://codeberg.org/basil/grimoire/raw/branch/main/decrypt/main.ts decrypt
Those commands will produce the following output:
clean.js
- The main, deobfuscated game code. For more information as to how this is obtained, read the Grimoire writeup.out/
- A folder with all of the encrypted assets in decrypted form.
NW.js SDK
If you’re going to write JavaScript, it’s helpful to have the browser developer tools at hand. However, they are not included with the game by default. This is because NW.js has two build flavors: Normal and SDK. The SDK flavor includes the browser dev tools, but they are omitted from the Normal flavor.
The current version of NW.js used in the game is v0.29.0, which you can download on the NW.js website: https://dl.nwjs.io/v0.29.0 While newer versions will also work, you should use v0.29.0 to make sure your mods actually run
Make sure you grab the SDK version, specifically the one for 32-bit Windows: nwjs-sdk-v0.29.0-win-ia32.zip
file; the x64
version will not work, as the game only ships with the Greenworks binary for 32-bit Windows.
Drag the contents of the ZIP file into the game folder (not www/
!), replacing the existing NW.js-related files. If you’ve done it correctly, Windows should inform you that there are existing files. You should select the option to replace the existing files with the files.
Then, delete the Game.exe
file and rename the nw.exe
file to Game.exe
. If all has gone correctly, you should be able to launch the game from Steam.
Making Mods, Manually
You must set up a mod.json
file yourself and create any files you need there. The reference page for the mod.json
format will be your friend here.
Scripts
Tomb exposes a global, $tomb
, which gives you access to Tomb’s internals (specifically, an instance of the Tomb
class), as well as some helpful tools, like the spitroast monkeypatcher library (recommended for modifying functions).
If you don’t have RPG Maker MV, you may also be interested in contributing to my unnamed editor project/experiment. It aims to be an FOSS drop-in replacement for the RPG Maker MV editor, but is currently in a very early state and serves more as a proof-of-concept than something usable.
Footnotes
-
Disclaimer: I also made Grimoire. ↩