Prism is extended by plain files that the game reads from disk. Delete the file or folder and the extension is gone. There is nothing to compile, no account and no key.
What you can build
| You build | It is | What it does | Start with |
|---|---|---|---|
| A mod | A folder with a main.ts. |
Adds to the game: HUD elements, judgement sets, difficulty ratings, library filters, selection tabs, gameplay modifiers, download sources, native effects. | A first mod |
| A skin | A folder with a skin.ts and images. |
Sets how the playfield looks: lanes, notes, receptors, lights, and where the HUD elements stand. | A first skin |
| A map script | A script.ts next to a chart. |
Animates the playfield of that map while it plays, like an ITG modchart. | A first map script |
| An editor mod | A main.ts in a folder named editor-…. |
Adds panels and tools to the map editor. The game itself never loads it. | Editor mods |
| A theme | A folder with theme.json, tokens.css, and optionally theme.css and theme.ts. |
Changes the look and the layout of the menus. It is data: it never runs code while the game draws. | Themes |
| A client of the online API | Any program that sends HTTP requests. | Reads charts, boards, ratings and the catalogue from prism.am. Reads need no account. | The online API |
A mod, a skin and a map script share one API, one engine and one set of limits. What differs is when each one runs and what it may call: see Concepts.
What you need
- A text editor and the game. Mods, skins and map scripts are TypeScript files that the game runs itself. It transpiles them when it loads them, in an embedded JavaScript engine (QuickJS). You need no Node, no bundler and no build step.
- No manifest file. A mod, a skin or a map script declares itself in code:
defineMod({ … }),defineSkin({ … })ordefineChart({ … }), called once at the top level of the entry file. No JSON describes them. (A theme is the exception: itstheme.jsonnames it.) - The same
apiVersionas the game. Each declaration carriesapiVersion, and it must be equal to the API version of the game, not lower and not higher. A script that is off by one is refused with a clear message. - TypeScript, optionally. The game does not check types. To have your editor and
tsccatch mistakes, give them the SDK. Install TypeScript withnpm install --global typescriptor run it withbunx tsc. See Tooling. - Imports stay inside the folder. A script can import relative modules of its own folder. It never reaches outside it, and
import()written as a call is refused.
Versions
| What | Version now | Where you write it | What happens on a mismatch |
|---|---|---|---|
| Mod, skin and map-script API | 2 | apiVersion: 2 in defineMod, defineSkin, defineChart |
The script does not load: `my-mod` requires modding API version 1; this game provides version 2 |
| Theme contract | 1 | themeApi in theme.json; absent means 1 |
A theme that asks for a newer one is refused with a message |
Package files (.pvmod, skin .zip) |
none | The declaration inside the package carries the API version |
The first line of the SDK file states the version it describes (// Modding API version 2.).
The SDK
The SDK is one TypeScript declaration file, generated from the Rust contracts of the game. It types every global (hud, game, ctx, playfield…), every event payload and every option.
- modding.d.ts is the file to download. It declares 64 functions and 25 events. In the repository it is
content/mods/sdk/modding.d.ts. content/mods/sdk/modding.tsis an optional module of listening shortcuts and typed models. No example needs it.- theme.d.ts types
theme.tsof a theme. - The SDK reference lists every function and event with its signature and a short note, generated from the same file.
A script uses the SDK without importing it: the functions are globals. For tsc and your editor, a one-line comment is enough, and it has no effect at run time:
/// <reference path="./modding.d.ts" />
log.info("typed");
Where your files go
The data folder of the player is %LOCALAPPDATA%\Prism\PrismNG\data (PrismNG-PBE on the PBE channel). The environment variable PRISM_DATA_DIR replaces it as a whole.
| Kind | Folder | Replaced by |
|---|---|---|
| Mods | data\mods\<folder>\main.ts |
PRISM_MODS_DIR |
| Skins | data\skins\<id>\skin.ts |
PRISM_SKINS_DIR |
| Themes | data\themes\<theme>\theme.json |
PRISM_THEMES_DIR |
| Map scripts | next to the chart, in the map folder |
The game ships its own mods, skins and themes in folders next to prism.exe. Yours are read after them, and never replace them. See Tooling for every variable.
Four ways to test
| Way | What it checks | Opens the game | Where |
|---|---|---|---|
Type-check with tsc |
Types, typos, wrong option names. | No | Tooling |
| Reload and play | Everything, with the real game: copy the folder, press Reload on the Mods page, play a map. Messages and errors appear under the mod. | Yes | A first mod |
| A Rust test over the real engine | That the script loads and does what you expect, without a window. It starts the same ModHost as the game and sends it events. |
No | Tooling |
| A diagnostic run of the game | The skin and the map script of one map, as at a real launch: prism.exe --smoke-test prints their problems. |
Yes | Tooling |
Themes have their own check: cargo run -p modding --example check_theme. See Tooling.
I want to…
| I want to… | Read |
|---|---|
| Show a number, a bar or a label during a play | HUD elements |
| Draw effects over the playfield, in the native renderer | Stage drawing |
| Give the player options, keep data between sessions | Elements, settings and storage |
| Change how notes, lanes and lights look | A first skin, then Skins |
| Know every skin field and its bounds | Skin fields |
| Convert an osu! skin | Skin import |
| Move the playfield with the music | A first map script, then Map scripts |
| Add a judgement system (windows, tiers) | Judgement sets |
| Add a difficulty or performance rating | Ratings |
| Add a filter to the song library | Library filters |
| Add a selection tab or read the local leaderboard | Tabs and leaderboard |
| Add a gameplay modifier | Gameplay modifiers |
| Rewrite the notes of a chart before it plays | Chart transform |
| Add a place to download maps from | Download sources |
| Add a tool to the map editor | Editor mods |
| Change the look of the menus | Themes |
| Understand lifecycle, budgets, permissions, errors | Concepts |
| Look up a function, an event or a type | SDK reference |
| Install, export, run, or use a command-line flag | Tooling |
Open or write a game file (.pvmod, .pvreplay, .pvplaylist…) |
.pvmod, skin package, .pvreplay |
| Read charts, scores or the catalogue over HTTP | The online API |
| Publish a mod or a skin to the catalogue | Submit to the catalogue |
| Fix an error message | Troubleshooting, Limits |
| Give all of this to an AI assistant | Feed an AI assistant |