Example Mod Tutorial
Estimated reading time: 3 minutesThis tutorial walks through building a functional Mod from scratch: boot.json, twee passages, JS, CSS, images, packaging, and testing.
Goal
Create a Mod named HelloMod that:
- Adds a custom Passage showing a welcome message
- Styles it with CSS
- Adds a simple macro or function via JS
- Optionally replaces a game image
Step 1: Project Structure
Create this layout (HelloMod_Image is optional, for images):
Step 2: boot.json
In HelloMod/boot.json:
If you add images, include them in imgFileList, e.g.:
Step 3: Twee Passage
In HelloMod_passage.twee, add a Passage:
To link to it from another Passage:
Step 4: CSS Styles
In HelloMod_style.css:
Step 5: JS Script
In HelloMod_script.js you can add SugarCube macros or global functions. Example: a simple macro that logs the Mod name and outputs text:
In Twee: <<helloMod "custom text">>
Step 6: readme.txt
In readme.txt, add Mod description; the Mod manager shows it:
Step 7: Packaging
Manual
- Select
boot.jsonand all referenced files (HelloMod_style.css, HelloMod_script.js, HelloMod_passage.twee, readme.txt, etc.) - Compress as Zip (e.g. with 7-Zip)
- Ensure
boot.jsonis at zip root and paths match boot.json - Rename to
HelloMod.mod.zip
Automated (Node.js)
From the HelloMod directory:
Output: HelloMod.mod.zip.
Step 8: Testing
- Open a game that includes ModLoader (e.g. DoL)
- Upload or load
HelloMod.mod.zipin the Mod manager - Enable HelloMod and refresh the game
- In-game, follow the link or use the macro to verify
Common Issues
boot.json not at zip root
Make sure you select the files themselves, not the HelloMod folder. Wrong: HelloMod.mod.zip/HelloMod/boot.json; correct: HelloMod.mod.zip/boot.json.
Path mismatch
Paths in boot.json (styleFileList, scriptFileList, etc.) must exactly match the zip layout, including case.
Mod not loading
Check the Mod manager load log to see if the Mod was skipped (e.g. dependency failure). If it depends on other Mods, declare them in boot.json’s dependenceInfo.
