Creating Mods
Estimated reading time: 2 minutesThis chapter explains how to create ModLoader-compatible Mods for SugarCube2-based games.
Quick Start
Three steps to create a Mod:
- Write the
boot.jsonmanifest - Prepare Mod content (twee, JS, CSS, images, etc.)
- Package everything as a
.mod.ziparchive
Mod Package Format
Each Mod is distributed as a .mod.zip archive (or .modpack binary format) containing:
boot.json(must be at zip root) — Mod manifest: name, version, file lists, dependencies- Script files — JS files split by stage: inject_early / earlyload / preload / main scripts
- Style files — CSS
- Twee files — Passage script files
- Image files — Game assets
- Extra files — README, etc.
Minimal Mod Example
A minimal Mod structure:
MyMod
boot.json
readme.txt
Minimal boot.json:
Typical Mod Structure
MyMod
boot.json
readme.txt
MyMod_style.css
MyMod_script.js
MyMod_passage.twee
MyMod_Image
character
avatar.png
Notes
- Paths in
boot.jsonare relative to the zip root - Do not duplicate filenames within a Mod; avoid collisions with the base game and other Mods
- Duplicate Passage names override game content
- Mods load in list order; later Mods override earlier ones for the same Passage
- Identical CSS/JS files are concatenated, not overwritten
- Image paths should not easily collide with other strings in the file
Next Steps
- Example Mod Tutorial — Build a functional Mod from scratch
- boot.json Reference — All available fields
- Script Loading Stages — Differences between the four script stages
- Packaging — Manual and automated packaging
- ModPack Format — The .modpack binary format (optional)
