SCML Mod Development Skill
Estimated reading time: 3 minutesThis skill helps AI assistants create and debug mods for SugarCube-2 ModLoader (SCML) games. It applies to all SC2-based games, primarily targeting Degrees of Lewdity (DoL).
Trigger Scenarios
This skill activates automatically when you need to:
- Create a new mod and generate
boot.json - Choose the appropriate script loading stage
- Use AddonPlugin to depend on other mods
- Use ModUtils API for inter-mod communication
- Replace Passage or image content
- Package
.mod.zipfiles - Troubleshoot mod loading issues
Quick Start
1. Create Mod Directory Structure
2. Write boot.json
3. Package
Compress all files (without the outer folder) into .mod.zip format. boot.json must be at the zip root.
Tip
See Creating Mods for the full tutorial.
Script Stage Selection
Warning
boot.json Essentials
Required fields (must exist even if empty):
AddonPlugin dependency:
See boot.json Complete Reference.
Bundled Mods & Addons
See Bundled Mods.
API Quick Reference
ModUtils (window.modUtils)
Lifecycle Hooks
See ModUtils Reference, Lifecycle Hooks, AddonPlugin System.
Twee File Format
Same-name Passages override base game content. Multiple mods with the same passage name: later-loaded mod wins.
Common Pitfalls
- boot.json not at zip root — Package files directly, not the folder containing them
- Path case mismatch — Paths in boot.json must exactly match zip layout (case-sensitive)
- Missing IIFE for earlyload/preload — Must use
(async () => { ... })()format - Async operations in inject_early — This stage doesn't support async, operations won't be awaited
- Calling other mod's modRef too early — Use preload or later for inter-mod calls
- Image path collisions — Use unique, namespaced paths
