Mod authoring reference
Read Authoring mods to decide which parts of your mod belong in cooked data and which need Lua. Use this reference for implementation details.
- Where content definitions go
- Mod layout and manifest
- Authoring with the Python SDK
- Cooked asset recipes
- Lua-scripted mods
- Online play
Where content definitions go
Section titled “Where content definitions go”manifest.toml describes the mod — id, author, licence, multiplayer scope.
It should not grow a table for every item, enemy or structure in it. Content
goes in the file tree instead, one directory per thing:
mods/my-mod/ manifest.toml what the mod is items/ember_charm/ item.toml what the item is enemies/frost_wolf/ enemy.toml pois/runestone_shrine/ poi.toml model.glb your own mesh albedo.png your own maps, matched to mra.png texture slots by filename normal.pngEach folder is one content def. Its id defaults to the folder name, and the
<kind>.toml inside holds the same fields a [[content]] block would. rsmm new <id> --kind <kind> scaffolds this layout.
Directory names are plural, kinds singular: items/ → item, enemies/ →
enemy, bosses/, heroes/, talents/, skills/, modifiers/, rewards/,
melodies/, maps/, pois/. game_mode is deliberately not on the list — a
mod has at most one, so it stays in the manifest.
You can still write [[content]] by hand, and a declared block wins over a
folder with the same id, so dropping to the explicit form for one def does not
mean moving the rest.
POIs get presets and art-by-filename
Section titled “POIs get presets and art-by-filename”poi goes furthest with the convention, because a structure otherwise needs
five engine paths. A poi.toml usually only has to say which chapters it
appears in:
#:schema https://docs.rsmm.me/poi.schema.jsonchapters = ["Dark_Hills", "Avalon", "Storm_Island"]The #:schema line gives Taplo / Even Better TOML completion and flags a
misspelled key before apply does.
Everything else — which tile it stands in, which object it takes the place of,
which prop and material it inherits structure from, its kind and spawn weight —
comes from a preset. Drop model.glb plus albedo.png / mra.png /
normal.png beside it and those become the structure’s own art; omit them and
you get a clone of a shipped structure. See rsmm poi to browse, and
mods/runestone-shrine for a worked example.
Two override strategies
Section titled “Two override strategies”Use these strategies when changing an existing asset. For new content and runtime behavior, see Authoring mods.
1. Drop cooked files (raw)
Section titled “1. Drop cooked files (raw)”Mirror decoded paths under assets/. Full control, byte-for-byte. One mod owns each file.
2. Compose [[patch]] blocks (recommended)
Section titled “2. Compose [[patch]] blocks (recommended)”Write declarative blocks in manifest.toml for numeric values (stat), texture
swaps (texture), and plaintext .ot fields (ot). The applier composes every mod’s patches into a single
cooked file per target. Two mods touching different fields of the same file
both take effect; conflicts on the same field resolve by load_order (lower =
applies first; later wins on overlap). When you apply from the desktop app, the
Library’s load order replaces load_order: the mod lower in the list wins, for
patches and for whole-file overrides alike.
[[patch]]kind = "stat"name = "Bleed_Duration_Value"value = 10
[[patch]]kind = "stat"name = "Easy"min = 5max = 10
[[patch]]kind = "ot"selector = "Merlin DMG Zone"field = "m_eComputerType"value = 0A stat field can take its number from the mod’s config instead:
min = { config = "pack_size", times = 15 } reads the player’s pack_size
setting and multiplies it by 15 (write the shipped value there, so 1.0 leaves the
game as it was). Like every content config, it takes effect on the next launch.
min = { scale = "pack_size" } skips the copied number: apply reads the shipped
min from the game’s own file and writes it times the player’s pack_size, so a
game patch that rebalances the value carries into your mod. scale stands alone,
without config or times, and names a number field.
The same blocks from the optional Python SDK. python mods/build_MyMod.py, run
from the clone with its .venv active, writes mods/MyMod/manifest.toml:
from rsmm import sdk
with sdk.Mod("MyMod", author="me", load_order=50) as m: m.stat("Bleed_Duration_Value", value=10) m.stat("Easy", min=5, max=10) m.ot("Merlin DMG Zone", "m_eComputerType", 0)Editing a plaintext .ot (kind = "ot")
Section titled “Editing a plaintext .ot (kind = "ot")”A few oCTextSaver files ship uncooked beside the executable —
DarkTalesResources/ApplicationSettings.ot is the one worth touching. It holds
the friendly-fire factors, the forced-seed option, and the entity-value modifier
descriptors (see below). It is plain text: no cipher, no cooking.
A mod could ship a whole edited copy under assets/_root/, and before this
patch kind that was the only way. Don’t: that redistributes a game file, and it
reverts every unrelated change the next game patch makes to it. Declare the
field instead — apply reads the install’s own bytes, rewrites just that field,
and installs the result through the same _root/ channel:
[[patch]]kind = "ot"selector = "Merlin DMG Zone" # matches s|m_sLabel in a blockfield = "m_eComputerType" # must already exist in that blockvalue = 0# file = "DarkTalesResources/ApplicationSettings.ot" (the default)# selector_field = "m_sLabel" (the default)Rules, all enforced at merge time with an error rather than a silent no-op:
- the selector must match exactly one block;
- the field must already exist in that block — a patch edits a value, it never invents a field the engine would ignore;
- a nested block’s fields are not its parent’s (
m_oDefaultValue’su16Typeis reached by selecting the nested block, not the descriptor around it); - the value’s type comes from the file’s prefix (
i|int,u|unsigned,f|float,b|bool,s|string) — writing a string intoi|is refused; - if any edit in a file fails, the whole file is refused. Half-applied edits are a configuration nobody wrote.
The base is the install’s pristine copy (<file>.rsmm.bak when an earlier
apply made one), so re-running apply is idempotent and two texture-style
chains cannot compound.
Entity values: m_eComputerType
Section titled “Entity values: m_eComputerType”Each oSModifierValueDesc block in ApplicationSettings.ot describes one
entity value — a label, a default, m_uMaxStackSize, m_eStackMode, and
m_eComputerType. The last one picks which oCEntityValueModifier*Computer
folds concurrent modifiers of that value together. It is not a damage type.
The engine ships seven; three independent orderings in the binary agree on
Add(0) Sub(1) Mult(2) Reduce(3) Oldest(4) Max(5) Min(6), and ct=0 = Add
(contributions sum) anchors it. The shipped file uses 0 forty times, 3 six
times, 6 once — and every 3 is a persistent zone or trail: Merlin DMG Zone,
Dullahan_Trail_DOT, Mordred_Trail_DOT, Fire_Trap_DOT, Poison_Trap_DOT,
Piper Pets Within Special. Players report these do not stack when they overlap,
which is what a non-additive combiner would do.
Mod layout
Section titled “Mod layout”mods/MyMod/ manifest.toml # Required: id, name, version, author assets/ # Mirrors decoded paths from data/asset_map.csv <decoded-path>/<file> _root/ # Optional: files outside _Cooking/, at the DarkTalesResources/# install root. Prefer a `kind = "ot"` patch ApplicationSettings.ot # for plaintext .ot files (below). init.lua # Optional: Lua script run by the loader DLL on_disable.py # Optional: cleanup hook when mod is disabledA Python SDK generator goes beside this folder (mods/build_MyMod.py). Inside
it, rsmm lint fails any .py but on_disable.py.
manifest.toml
Section titled “manifest.toml”#:schema https://docs.rsmm.me/manifest.schema.json
[mod]id = "MyMod"name = "My Mod"version = "1.0.0"author = "you"description = "what it does"enabled = trueEvery key must be one something reads. A misspelled key used to install a mod that did nothing, so now:
rsmm lintfails on an unknown key in[[content]]or[[patch]]and names the closest valid one (unknown key 'valeu' (did you mean 'value'?)). An unknown[mod]key is a warning.- It also fails a patch that would change nothing: a stat name that does not
exist, a field that value does not have (
Easyhasmin/max, notvalue), a non-number, or a texture path the game does not ship. rsmm applyand the Python SDK refuse an unknown content field outright.
The #:schema line (which rsmm new writes for you) lets
Even Better TOML
or any Taplo-based editor autocomplete keys and underline the same mistakes as
you type. The schema is generated from the same list lint uses, so the two
never disagree.
[requires]: the oldest RSMM a mod runs on
Section titled “[requires]: the oldest RSMM a mod runs on”A mod that uses a field added in a newer RSMM fails on an older one with an
error about the field, which reads like a mistake in the mod. Declare the
versions it needs in a top-level [requires] table and rsmm apply skips the
mod with a plain message instead (the other mods still apply). Both keys are
optional positive integers: cli is the CLI version (cli_version in
data/cli_version.json), loader is the loader version. Any other key, or a
non-integer value, is a rsmm lint error. This is separate from [mod] requires, which lists other mods.
[requires]cli = 31loader = 58An older install reports needs RSMM CLI v31 or newer, this is v30 - update RSMM
or needs loader v58 or newer, the installed loader is v57 - run rsmm update-loader.
on_disable.py (optional)
Section titled “on_disable.py (optional)”Place next to manifest.toml. Fires from ./rsmm apply when the mod flips enabled = true → false. Subprocess with 30s timeout; receives RSMM_GAME_DIR, RSMM_COOKING, RSMM_MOD_DIR env vars.
The hook runs as the player, outside the game, with no sandbox, so it never runs unasked: rsmm apply lists the pending hooks and waits for a yes (or --yes), and uninstalling from the desktop app asks whether to run it before removing the mod.
Use for cleanup the loader DLL can’t do at apply time — deleting profile caches, etc.
Game options you pin need no hook. The game saves what R.options.set wrote
to _Save/GameSettings.ini, so a forced seed outlives the mod that set it. List
those options in the manifest instead, and rsmm clears their lines itself when
the mod is disabled or uninstalled (no Python, nothing to approve):
[mod]restore_options = ["Forced seed", "Dev"]rsmm lint checks each name against the options R.options knows.
examples/ExampleSeedPin does exactly this.
ConsoleRuntime / dev_mode
Section titled “ConsoleRuntime / dev_mode”The bundled mods/ConsoleRuntime/ mod ships with a dev_mode flag in its manifest.toml. Off by default. When dev_mode = true, ConsoleRuntime registers /eval, which executes arbitrary Lua inside the game process.
Toggle: edit mods/ConsoleRuntime/manifest.toml, set dev_mode = true, then ./rsmm apply (or relaunch the game). Never ship a release with it on.
Authoring with the Python SDK
Section titled “Authoring with the Python SDK”Optional. The manifest is the main way to write a mod; the Python SDK
generates one. Reach for it when a mod has many similar entries — fifty stat
tweaks, a table of item variants — that are easier to produce in a loop than to
type out. You describe the mod in Python and rsmm.sdk writes the
mods/<id>/ tree atomically. It applies the same checks as rsmm lint: an
unknown field is refused, with the nearest valid name.
Every content kind is reachable with one call, m.content(kind, id=..., **fields),
whose fields are exactly the manifest’s. Five kinds also have a named shortcut
(m.item, m.enemy, m.boss, m.map, m.hero); the rest use m.content.
Design rationale: SDK guide.
First mod
Section titled “First mod”A mod is a with sdk.Mod(...) as m: block — calls accumulate in memory and the
tree is written when the block exits.
Save the generator outside mods/FrostPack/. rsmm lint fails a build.py in
there, and each build replaces the whole folder, keeping only an init.lua you
wrote yourself. The mod is written to mods/<id>/ wherever the script is.
from rsmm import sdk
with sdk.Mod("FrostPack", version="1.0.0", author="you", name="Frost Pack") as m: m.i18n("EN", {"FrostPack_hello": "A chill wind blows."})# in the clone, with its .venv activepython mods/build_FrostPack.py # writes mods/FrostPack/manifest.toml + lang/EN.tomlrsmm list # see it registeredrsmm apply # install into the gameTyped content + handles
Section titled “Typed content + handles”m.content(kind, id=..., **fields) registers any kind; m.item / m.enemy / m.boss / m.map / m.hero are shortcuts for five of them. Each returns a
ContentRef (like Forge’s RegistryObject). Pass a handle anywhere another
content id is expected — it resolves to the raw id automatically. Find valid
bases with rsmm schema [kind] [--grep T].
with sdk.Mod("FrostPack", version="1.0.0", author="you", experimental=True) as m: # required for non-confirmed kinds blade = m.item("FrostBlade", base="Orb_Grants_Strength", name="Frost Blade") m.enemy("FrostGhoul", base="Sling_Ghoul", add_flags=["Elite"]) m.boss("CrabDen", base="Boss_Marsh_Ghoul", becomes="Boss_Crab") # every other kind: the same fields as its [[content]] block m.content("reward", id="MoreChests", base="Camp_Rewards_Dark_Hills_Update5", counts={"2": [3, 3]})Kinds below
confirmedneedexperimental=True. Which ones those are is generated from the code: Content kinds & confidence.
Tags, assets, config
Section titled “Tags, assets, config”m.tag("daggers", [blade, "VanillaKnife"]) # append-across-mods set; R.tags() in Luam.texture("3D/.../T_Melusine_ALB.png", "art/albedo.png") # PNG/DDS/TGA, auto-cookedm.skinpack("Crimson Pack", key=0x900001) # new selectable slot (experimental)m.config({"fields": {"frost_damage": {"type": "float", "default": 1.5}}})m.i18n("FR", {"FrostBlade_desc": "Gèle à l'impact."})print(m.summary()) # dict of everything staged, no disk writeThe same config is editable in the game: Settings > Mods opens a page that
lists every installed mod, each with its Off/On row (applied on the next launch)
and one row per config_schema.toml field, in file order. bool, enum, int
and float fields are choices you change in place; fields the page cannot edit
(string, multiselect, item-grid) are listed with “Edit in the desktop app”.
Config with icons (multiselect)
Section titled “Config with icons (multiselect)”A config field is normally bool/int/float/string/enum. A
multiselect holds a list of ids and, when it names an allowlisted option
provider, the desktop draws it as a searchable list of the game’s own art:
# mods/<id>/config_schema.toml[fields.banned]type = "multiselect"source = "item-catalog" # allowlisted provider; NOT a path or a commandlabel = "Banned items"default = []The CLI resolves source into options — {id, label, group, icon, description} — and sends them with the schema, so the panel renders labels,
grouping, search and art in one round trip. Read the value back with the normal
config API (ConfigStore(mod_dir).get("banned")); the rsmm-item-bans mod’s
[[content]] ban block takes its item list from exactly that.
A bool field can also switch a whole [[content]] block on and off. Write
when = "<field>" on the block, for any kind: while the field is off the block
writes nothing, and the files it wrote on an earlier apply are removed.
A saved config reaches the game on the next launch, never sooner
Section titled “A saved config reaches the game on the next launch, never sooner”Nothing about config is hot-reloaded. The loader hands a mod its values once,
when it loads the mod, and a config that feeds [[content]] (an item ban, say)
only becomes real when rsmm apply rewrites the cooked asset that carries it —
which the desktop runs as part of Play. So an edit made while Ravenswatch is
running changes nothing in that session: quit the game completely, then launch
again. The desktop config panel says so after every save, and marks the
asset-rebuilding case (any provider-backed field) explicitly, because that
launch does real work before the game starts.
Providers are an allowlist: a mod supplies a name, never a path, a URL or a
command. The desktop webview can spawn the CLI, so anything a mod could inject
there would run on the player’s machine — the same reason overlay shape is data
and never markup. The providers today are item-catalog (every magical object
the game can offer), enemy-roster (every creature a camp can roll) and
shop-items (every item the Sandman’s offers can hold, with its price).
A provider-backed field does not reject ids it cannot currently see. The valid set lives in the game install, which may be missing or newly patched, and dropping an unrecognised id would silently delete the player’s selection the first time the CLI ran somewhere the catalog could not be read.
Editors for lists of game items (item-grid)
Section titled “Editors for lists of game items (item-grid)”An item-grid sorts a provider’s options into sections you declare, with an
optional number per item. The whole editor — sections, labels, which items fit
where, counts, and even its look — is your mod’s declaration. The desktop draws
every item-grid with one generic component; it does not know what yours is for.
# mods/<id>/config_schema.toml[fields.loadout]type = "item-grid"label = "Loadout"source = "shop-items" # allowlisted provider, as abovetitle = "Pick what is on offer" # optional, your own copylayout = "columns" # section groups side by side; default "stack"quote = "Every dream has its price." # optionalnumber = { attr = "price", label = "Price", min = 0, max = 99999, editable = "priceEditable" }
[[fields.loadout.sections]]id = "minor" # letters, digits, _ or -label = "Offers"group = "Minor dreams" # consecutive sections sharing a group share a headingaccepts = { role = "offer" } # option attributes that must ALL matchcount = { label = "Offers per visit", min = 1, max = 4, default = 4 }
[fields.loadout.theme] # optional: dress it in the game's own artpanel = "Ui/SandMan/UI_SandManBg.png"portrait = "Ui/NPC/NPC_Sandman_Portrait.png"header = { texture = "Ui/SandMan/UI_SandMan_categoriesBG.png", ink = "dark" }- Options come from
sourceand may carryattrs.acceptsfilters on them; a provider marks where an option sits by default withattrs.defaultIn(a list of section ids);number.attrnames the attribute holding the default number, andnumber.editablethe boolean that says it may change. emptyon a section is your text for when it holds no items — a section the provider starts empty (like a shop’s random-object slot) explains itself instead of looking broken.- The stored value keeps only what differs from those defaults:
{ sections = { minor = { items = [...], count = 2 } }, numbers = { <id> = 10 } }. An untouched editor stores nothing, so “Reset to defaults” really is the unmodded state. A content kind reads it —kind = "shop"takesconfig = "<field>", see Edit the Sandman shop. - Layout:
stackputs section groups one under another;columnsputs them side by side, each in its ownpanelframe with an optionalseparatorbetween, and moves the portrait and quote beside them on a wide screen. A vendor-style grid with a few groups reads far better as columns. - Theme slots:
title,panel(9-sliced frame),header,separator,details,quote,portrait,remove,removeHover,number,numberIcon. Each names a game texture as its decoded path (rsmm assets searchfinds them), either as a plain string or as{ texture = "…", ink = "dark" }.ink(lightby default) is the text colour that reads on that texture — the app cannot tell a parchment scroll from a slate panel, so you say which it is. The CLI accepts onlyUi/…pngpaths the game’s own asset map resolves, decodes them from the player’s install when the editor opens, and caches them under<game>/rsmm/cache/ui/. Nothing is shipped with the mod, and a schema cannot name any other file. Leave the theme out and the grid uses the app’s own style.
Test offline (no game)
Section titled “Test offline (no game)”rsmm.sdk.testkit asserts over staged state without applying:
from rsmm import sdkfrom rsmm.sdk.testkit import expect, assert_no_conflicts
def build(): m = sdk.builder.ModBuilder("FrostPack", version="1.0.0", author="you") blade = m.item("FrostBlade", base="Orb_Grants_Strength", name="Frost Blade") m.tag("daggers", [blade]); m.i18n("EN", {"FrostBlade_desc": "Freezes."}) return m
def test_frostpack(): (expect(build()) .has_item("FrostBlade").has_tag("daggers", "FrostBlade") .i18n_complete().clean()) # every locale key present, no warnings
def test_no_clashes(): assert_no_conflicts(build()) # safe alongside itselfSDK quick reference
Section titled “SDK quick reference”| Goal | Call / command |
|---|---|
| New content (handle), any kind | m.content(kind, id=…, **fields) |
| Shortcut for five kinds | m.item/enemy/boss/map/hero(id, base=…) |
| Find base ids | rsmm schema [kind] [--grep T] |
| Group content | m.tag(id, [refs…]) |
| Override asset | m.texture/model/asset(decoded, src) |
| New skin slot | m.skinpack(name, key=…) |
| Config / strings | m.config({...}) / m.i18n(loc, {...}) |
| Preview staged state | m.summary() |
| Offline assertions | from rsmm.sdk.testkit import expect, assert_no_conflicts |
| Generated API docs | rsmm docs-gen → docs/api/ |
Recipes
Section titled “Recipes”Replace a cooked file (raw)
Section titled “Replace a cooked file (raw)”# Find the decoded path:rg -i "hero.*portrait" data/asset_map.csv
# Copy your file in:cp /path/to/donor.dxt \ mods/MyMod/assets/Ui/BookMenu/Heroes/UI_HeroPortrait_Romeo_Active.png.Texture.dxt
# Apply./rsmm applyTexture swap (donor reference)
Section titled “Texture swap (donor reference)”Point one shipped texture at another shipped texture, with no image file of your own. There is no SDK method for this; declare it in the manifest:
[[patch]]kind = "texture"target = "Ui/BookMenu/Heroes/UI_HeroPortrait_Romeo_Active.png.Texture.dxt"donor = "Ui/BookMenu/Heroes/UI_HeroPortrait_SunWukong_Active.png.Texture.dxt"Both are decoded paths — find them with ./rsmm assets search Heroes Portrait png.
rsmm apply copies the donor’s pristine bytes to the target. To use your own
image instead, call m.texture(path, "art/my.png").
Custom 3D mesh (.glb)
Section titled “Custom 3D mesh (.glb)”mod.model("3D/Characters/Heroes/Juliet/Juliet_GEO.fbx", "assets/my_mesh.glb")mod.model(path, src, rotate_deg=(90, 0, 0), scale=0.8) # orientation / sizemod.model(path, src, skin="gltf") # use YOUR OWN weightsmod.model(path, src, skin="rigid") # bind to ONE bonemod.model(path, src, fit="none") # keep your own sizemod.model(path, src, submeshes="map") # keep the material splitThe cooker replaces the mesh inside the shipped asset and keeps that asset’s existing skeleton. A custom skeleton is never written, so the bones your mesh moves on are always the game’s — but which of them each vertex rides is yours to control.
Weights: skin="gltf" for a character, transfer for a prop
Section titled “Weights: skin="gltf" for a character, transfer for a prop”The default, skin="transfer", copies weights positionally: each of your
vertices takes the weights of the game vertices nearest to it. That is right
for a prop, and for a body only if you authored it in the original’s bind pose
— otherwise an arm vertex nearest a leg bone is weighted to the leg and the
model tears itself apart the moment it animates. rsmm apply warns when your
mesh does not overlap the original’s bind pose.
skin="gltf" is the way to replace a character. Rig your mesh to the
game’s skeleton in Blender, using the original’s bone names, and export with
the armature. The cooker then reads JOINTS_0/WEIGHTS_0 out of your .glb
and binds each vertex to the bone you named, so nothing is guessed and the pose
you modelled in stops mattering. It implies fit="rig" — no scale, no
recentre — because a mesh rigged to the game’s skeleton is already in place.
Two helpers go with it. bones={"MyBone": "DEF.Spine"} renames joints on the
way in, for a rig that came from elsewhere; a name the target’s skeleton does
not have is reported, and a vertex left with no usable bone is an error rather
than a silent pin to bone 0. drop_bones=["DEF.PHY.Grab"] deletes the geometry
a bone drives, for a donor carrying something that has to become a separate
object — a chain, a slung weapon.
Note that an rsmm uncook mesh carries no glTF skin (its weights ride in
extras.rsmm.cooked_b64, which Blender discards on re-export), so skin="gltf"
needs a mesh you actually rigged, not a round-tripped one.
skin="rigid" opts out of weights entirely and binds the whole mesh to a
single bone: it follows the character but never bends. Right for a prop or a
static shape, wrong for a body.
Submeshes carry materials
Section titled “Submeshes carry materials”A character is several submeshes because the entity hands a different material
to each one. By default they are all merged into the first, which leaves the
rest as empty stubs — so everything draws with the first material and your
second texture never appears. submeshes="map" lays yours onto the original’s
one for one instead. Pairing is by order, so order your objects in Blender to
match the original’s.
Two limits worth knowing before you model: meshes above 65,535 vertices are refused, because a heavier one crashes the game at load (decimate toward that ceiling, not far below it — it is far higher than the vanilla count and looks near-identical to a 250k film source); and a custom skeleton or custom animations cannot be shipped at all, because nothing writes those formats yet. Animation clips also key translation on every bone, not just rotation — measured across a shipped hero clip, 113 tracks of 113 — so a posed skeleton always has the original’s proportions, and a taller or shorter body follows the original’s limb lengths no matter how it is bound. Reskinning what already animates is the supported path.
Numeric balance / modifier / camp difficulty
Section titled “Numeric balance / modifier / camp difficulty”Three families of numeric values are editable by name: global values
(*.globalvalue.ot, e.g. Bleed_Duration_Value), game-modifier definitions,
and enemy-camp difficulty bands (Easy, …). The name is the asset’s file name
without extensions — ./rsmm assets search globalvalue Bleed lists them.
with sdk.Mod("LongerStatusEffects") as m: m.stat("Bleed_Duration_Value", value=10) m.stat("Ignite_Duration_Value", value=11) m.stat("Easy", min=5, max=10) # multi-field: one keyword per fieldor directly in manifest.toml:
[[patch]]kind = "stat"name = "Bleed_Duration_Value"value = 10rsmm apply merges every enabled mod’s stat patches into one file per value:
two mods changing different fields both take effect, and two mods changing the
same field log a conflict (the later mod by load_order wins). An unknown name
is reported and skipped.
Randomise or replace a monster population (kind="enemy", mode="override")
Section titled “Randomise or replace a monster population (kind="enemy", mode="override")”Rewrites retail enemy definitions in place so a biome’s slots instantiate different creatures. Camps, tiers, tribes and difficulty are untouched — only the prefab each slot spawns changes.
[[content]]kind = "enemy"mode = "override"id = "random_roster"cross_biome = true # draw from every creature in the game, and repoint each # biome's EntityPooling asset so they are streamed theremix = "shuffle" # each biome gets as many distinct creatures as it hasseed = 1337 # pool slots, each used once ("random" draws with # replacement and leaves ~a third of the slots unused)power (optional) sets one power cost for every overridden enemy. It is
not spawn odds: a camp spends a power budget, so raising it makes each camp
field fewer, pricier enemies, and a cost above the budget means the enemy is
never picked. Vanilla camp enemies cost 0.1-20. weight is its old,
misleading name and still works with a warning.
cross_biome is the load-bearing flag. Without it a swap must stay inside
the biome’s own entity pool, so the randomiser can only permute the cast that
chapter already had — Storm Island still shows crabs and gnolls, and it looks
identical to vanilla. With it, each chapter draws from all 50 camp-spawnable
creatures and gets 8-11 foreign ones. A biome hosts exactly as many distinct
creatures as it has pool slots (10-15): an oCGameStream ref can be repointed,
but the vector cannot grow.
Or pin a whole biome to one monster:
[[content]]kind = "enemy"mode = "override"id = "treant_world"pools = ["Dark_Hills"]entity = "Enemies\\Treant\\Standard_Clawed_Treant.entity.ot"Or write the cast yourself, chapter by chapter, instead of letting the seed deal it:
[[content]]kind = "enemy"mode = "override"id = "my_roster"cross_biome = truerepoint_pools = false # required to pull a creature across chaptersmix = "random" # how the cast is spread over the chapter's defsseed = 1337
[content.casts]Dark_Hills = ["Elite_Wolf_Alpha", "Standard_Reef_Crab", "Standard_Storm_Jinn"]Storm_Island = ["Standard_Clawed_Treant"] # one monster = the whole chapterA chapter listed in casts draws only from the monsters written there; a
chapter left out keeps its dealt (or vanilla) cast, so pinning one chapter does
not reshuffle the others. Monsters may be named by definition id
(Elite_Wolf_Alpha), prefab stem, or full entity ref. mix still decides how
the cast spreads over that chapter’s ~15 definitions, which is why a
one-monster list turns the whole chapter into that monster.
The same cast can come from the mod’s config panel instead of the
manifest: declare one multiselect field per chapter, named after the pool,
with source = "enemy-roster" in config_schema.toml, and the desktop app
draws a grouped monster picker. A chapter the player picks for overrides the
manifest’s cast for that chapter; an empty pick leaves it on the roll. See
mods/random-monsters for the worked example. Two same-source multiselect
fields are treated as buckets over one option set, so the panel draws each
pick as a chip with a remove (×) and a “move to another list” arrow — moving a
monster from one chapter to another is one click, not a hunt through two
50-row scrollers.
The picker’s options and the re-emit both work on a plain install: the enemy
definitions, pool assets and resource caches are read from the uncooked mirror
when an authoring checkout has one, and otherwise straight out of
<install>/DarkTalesResources/_Cooking through the bundled asset_map.json
(preferring the pristine .rsmm.bak when a previous apply left one). Both
stores hold the same bytes, and a test asserts an emit from either is
byte-identical.
Casting a creature from another chapter needs cross_biome = true, and
repoint_pools = false is the combination proven in-game. With pools rewritten
(repoint_pools = true) two extra rules are enforced, both of which crash a
chapter transition otherwise: a cast may not be longer than the chapter’s pool
slots, and no creature may be cast in two chapters at once.
rsmm enemies pools lists the biome pools; rsmm enemies pool <biome> lists
the prefabs valid as entity there. Scope defaults to every open-world pool;
narrow it with pools, extend it with enemies, and drop individuals with
exclude.
Two rules the builder enforces rather than documents, because both fail silently in-game:
- A creature is only ever assigned to a biome that streams it. Candidates
come from the biome’s own cast, and under
cross_biomethe pool is rewritten first so the cast is streamed. Only def-owned pool slots are repointed — never the projectiles, attack zones and VFX trails a real attack needs. - The resource cache travels with the swap. Each rewritten definition gets
the sorted union of its own
*.UsedRscCache.otand that of the definition owning the new prefab. Without it the new meshes are unlisted, resolve to null at level build, and the engine’s teardown loop destroys the null — an access violation nowhere near the edit.
Bosses, summons and quest enemies are never in scope: no pool streams them, so
they are placed by the script owning their encounter rather than rolled by a
camp selector. To make a boss arena fight a different boss, use the boss
kind, which knows which arenas pick their boss by flag alone.
The roll happens once, at rsmm apply, and is baked into the emitted
assets — not re-rolled per run. That is what keeps co-op consistent: peers
have to agree on the seed, not on a runtime RNG. A peer without the mod sees
vanilla monsters.
Disable items (kind="item", mode="ban")
Section titled “Disable items (kind="item", mode="ban")”Drop vanilla magical objects from the catalog so they can never be offered or drop — the “ban the crutch items” challenge-run lever.
[[content]]kind = "item"mode = "ban"id = "no_crutches"items = ["Avoid_Death_Once_Per_Chapter", "Armor_Per_Object"]Or skip the ids entirely and pick the items from a list of the game’s own
icons: the rsmm-item-bans mod (the item picker’s own; the id is reserved,
so the store never publishes a mod under it) declares a multiselect config field (see
Config with icons), so opening its config in
the desktop app shows every item with its art, display name and effect text, and
the ban list is whatever you ticked. rsmm items catalog is the same list in a
terminal, and rsmm items ban --add <id> edits it without a UI. When a mod
declares the picker, the picker’s selection wins over the manifest’s items
list.
items are bare vanilla item ids — the filenames under
EntitySettings/Objects/Magical_Objects/<Rarity>/. rsmm apply rebuilds the
LiveOps versiondef magical-object vector without them, so the engine never
loads them into the pool and no draw can reach them. The vanilla manifest is
backed up once and rebuilt from that pristine copy on every apply, so disabling
the mod restores the full catalog.
Bans from several mods are unioned, so two mods each banning a different item yield both bans.
You can ban everything. The game draws every offer with a modulo over the
candidate count, so a pool with nothing left in it would crash the game (the
Sandman’s Major and Medium pools hold a single item each). When a ban would
empty a rarity or a vendor pool (or leave the Sandman’s Minor pool, which offers
two different items at once, below two), the ban adds a “Sold Out” item to
it: a copy of the Stars of Fate powerup that grants nothing. Pools that keep a
real item get none. If a placeholder cannot be built, apply un-bans just
enough items instead and names them in a warning.
Progress is kept. While an item is banned the game writes it out of your
profile save. Every apply and restore puts those records back, so lifting a
ban brings each item back as you left it, not as never seen.
Two side effects worth knowing:
- A banned item disappears from the compendium too. The catalog entry is what the compendium enumerates; there is no separate “hide from drops only” flag.
- The entity file itself stays installed and its resource-cache line is left alone. That is deliberate: a surplus cache line only wastes a preload, while a missing one crashes the load.
An id that no vanilla item has is refused at emit time when the asset corpus is
available, and reported as a [warn] against the install’s own manifest at
apply time. Banning a name nothing matches is otherwise a perfectly well-formed
no-op that only surfaces as “the banned item still dropped” a playtest later.
Ban talents (kind="talent", mode="ban")
Section titled “Ban talents (kind="talent", mode="ban")”[[content]]kind = "talent"mode = "ban"id = "my_talent_bans"talents = ["Red/Basic Cleave", "Merlin/Special Block"]A banned talent is never dealt, at the starting pick or on level-up, for any
hero. Its card still shows in the compendium. Ids are "<Hero>/<controller>",
the hero’s folder name and the talent’s controller without the
Skill Controller prefix: Red/Basic Cleave is Scarlet’s Cleave.
The banned-talents mod does this with a picker: its config declares a
multiselect field with source = "talent-catalog", so the desktop app lists
every bannable talent with its name and card text, grouped by hero. As with
item bans, the picker’s selection wins over the manifest’s talents list.
How it works: a talent card is dealt only after its controller activates, which registers it in the hero’s offer pool. The ban makes the controller start inactive, the state the game ships its ultimate upgrades in until their ultimate is owned. Every player running the mod builds the same pools, so the talent draw stays in step in co-op.
Two limits:
- Only the starting pick and level-up talents can be banned: not ultimates, their upgrades, or talents the game already cut.
- A ban that would leave a hero’s starting pick empty, or fewer than three level-up talents, is refused. An empty pick closes at once and blocks every later pick in the run.
The ban rewrites each touched hero’s main entity file, so it overlaps with another mod that edits the same hero’s talents. Not yet confirmed in game.
Edit the Sandman shop (kind="shop")
Section titled “Edit the Sandman shop (kind="shop")”The Sandman is the game’s vendor. A shop def changes what it costs and what it
offers, by overriding the retail files in place. There is one Sandman, so a mod
declares at most one.
[mod]id = "cheap-sandman"multiplayer_scope = "deterministic-shared" # every peer needs the same shop
[[content]]kind = "shop"id = "sandman"price_scale = 0.5 # every item not listed below costs half
[content.prices] # dream shards; prefix Power_Up_Sandman_ is optionalMinor_Heal = 10Major_Upgrade_Talent_To_Legendary = 150
[content.offers.minor]count = 2 # vanilla rolls 4
[content.offers.major_object]weights = { legendary = 1, cursed = 0 } # unlisted qualities keep their vanilla weightWhat the shop is made of:
| Generator | Vanilla count | Pool | Quality weights |
|---|---|---|---|
minor |
4 | Sandman; Minor (heal, reroll, shield, strength) |
powerup |
medium |
1 | Sandman; Medium |
powerup |
medium_duplicate |
1 | Sandman; MediumDuplicate |
powerup |
medium_object |
1 | none — a random magical object | common 0.5, rare 0.5 |
major |
1 | Sandman; Major |
powerup |
major_duplicate |
1 | Sandman; MajorDuplicate |
powerup |
major_object |
1 | none — a random magical object | epic 0.5, legendary 0.25, cursed 0.25 |
Vanilla prices: Minor items 50–75, Medium 100–200, Major 250.
Each generator accepts count, weights (qualities common, rare, epic,
legendary, cursed, powerup) and pool (the include-flag filter; ""
means no filter). Things to know:
- A generator never offers the same item twice, so a
countabove the number of items in its pool adds nothing. Theminorpool holds exactly 4 items, which is why the vanilla Minor row never changes. - Every Sandman item is quality
powerup. Moving a Sandman pool’s weight onto another quality finds nothing to offer. - The
*_duplicateand*_objectgenerators are a pair. The duplicate offer is a powerup, and the object offer is the magical object it copies.major_object’s weights decide which quality of object that is. - Prices are also multiplied at runtime by the hero’s “Reduce all dream
shard prices” and “Reduce Sandman dream shard prices” values and the run’s
“Dream Shard Costs Modifier” (the
HigherPricesgame modifier), then rounded.
Unknown items, generators, qualities or fields raise at emit time rather than producing a file that silently changes nothing.
Choosing exactly which items a slot offers. slots names the items per
generator, and is how an item from another family (a Grimoire chapter, a
Wishing Well gift) gets into the shop:
[content.slots.minor]items = ["Power_Up_Sandman_Minor_Heal", "Power_Up_Grimoire_Armor_High"]count = 2 # up to what the slot ships with; minor needs at least 2The shop screen shows two of each tier’s three offers (the offer, the copy
offer and the random magical object), so all three are slots you can fill.
medium_object and major_object ship with no item list — they sell a random
magical object of the listed rarities — and giving one items makes it sell
those instead (its weights switch to powerup, the only quality they have).
A slot whose list differs from the game’s gets its own pool tag
(RSMM_Shop_minor), and each chosen item gets that tag appended to its flags.
Nothing is removed from any item, so other vendors that read the same items are
unaffected.
and a *_duplicate slot only takes the powerups that copy an object.
Editing it from a config screen instead. Point the shop at an
item-grid field backed by the
shop-items provider, with one section per slot id, and the player edits
slots, counts and prices in the desktop app; the grid’s stored value replaces
slots and prices:
[[content]]kind = "shop"id = "sandman"config = "shop" # the item-grid field in config_schema.tomlMagical-object & talent values (value_patches)
Section titled “Magical-object & talent values (value_patches)”Edit the numbers inside a magical object or a hero talent (“Skill”). Discover
the editable labels + defaults first, then declare the edits in manifest.toml:
./rsmm items show Damage_Power # item value fields (+ [shadowed] markers)./rsmm talents Juliet # hero talent values (+ [shadowed/no-op])# Item: clone a vanilla magical object with patched values[[content]]kind = "item"id = "MyStrongerPower"base = "Damage_Power"value_patches = [ ["Power Crit Chance Value", 0.4, 0.1], # A shadowed value (see below) needs clear_override to take effect: { label = "Damage Value", old = 0.2, new = 0.5, clear_override = true },]
# Talent: patch a hero's cooked entity in place (plain override, no clone)[[content]]kind = "talent"hero = "Juliet"id = "JulietBuff"value_patches = [["Primary Ability Rose Explosion Damage Value", 8.0, 24.0]]Shadowed values. Some value nodes don’t use their inline number — the game
reads the value from a selector/curve (e.g. card-count scaling), so editing the
inline float is a silent no-op. rsmm items show / rsmm talents tag these
[shadowed], and apply errors if you patch one without
clear_override = true. Clearing the override makes the inline number
authoritative but unbinds the selector — e.g. per-card-stack scaling becomes a
flat value. That trade-off is intentional; pick the flat number you want.
Which stat an item’s effect gives (stats)
Section titled “Which stat an item’s effect gives (stats)”Each effect of a magical object (its always-on effect and its super effect)
changes one stat. stats points an effect at a different one, by the effect’s
name. rsmm items show <base> lists the effects, the stat each one gives, and
whether it is the super effect:
[[content]]kind = "item"id = "Damage_Per_Vitalitz"base = "Damage_Per_Vitality"name = "Ogre Crit"stats = { "Super Effect Modifier" = "Crit damage" }value_patches = [["Super Effect Crit Chance Value", 0.2, 0.3]]super_description = "#Crit Damage@ &+{0}%~"- Stat names are the engine’s own (
Attack power,Crit chance,Crit damage,Armour,Vitality,Move Speed Ratio, …); the full list isdata/stat_keys.json. A few stats have no name yet; give those by key ("0x58e0a5c"), asrsmm items showprints them. - The amount keeps its old unit. 0.2 crit chance becomes 0.2 of the new
stat, so change the number with
value_patchestoo. super_descriptiongives the copy super-effect text of its own (the base’s text still names the old stat). Items without a super effect (cursed, legendary, power-ups) refuse it.super_effect = falseremoves the base’s super effect: the bonus never applies and the card shows no super text. Use it when the item you are making has none of its own.- A copy gets an identity of its own (
unique_identity, on by default). A copy that keeps its base’s identity is treated as the base: a grant hands out the vanilla item, and owning both keeps only one.unique_identity = falseopts out. - Some stats need more than the stat. Plain numbers (attack power, armour,
crit, cooldowns, move speed) work anywhere. Flags like
Lightning explodeor the instant-kill thresholds only do something with the components the item that ships them carries. - The stat changes, the behaviour doesn’t. A copy of
Increase_Shieldkeeps the shield’s permanent on-hit modifier, which never wears off because only damage used up the shield. As crit chance it stacks for the rest of the run. Its amount also still scales with the hero’s level healing. Fix the behaviour with[[content.steps]]: theset/link/add_link/remove_link/percent/clonesteps of theentitykind, run on the copy by the part namesrsmm entity-graphprints for the base:
# "After taking damage, gain crit chance for 5 seconds" from Increase_Shield.# A bonus hung on a state lasted ~1.5 s in game. The shipped way to time a# bonus is Dash_Crit_Chance's: a tester (run by State Picked Up) holds the# modifier on while a timer has time left. Copy those three parts in, and let# the hit restart the timer instead of granting the permanent modifier.[[content.steps]]clone = ["Crit Chance Modifier Active Tester", "Crit Chance Modifier Timer", "Crit Chance Modifier"]from = "Objects/Magical_Objects/Common/Dash_Crit_Chance" # any entity, or a hero namesuffix = " Pebbles"[[content.steps]]add_link = "State Picked Up.while_active"to = "Crit Chance Modifier Active Tester Pebbles"[[content.steps]]remove_link = "On Damage Received.activates" # the permanent grantto = "Modifier"[[content.steps]]remove_link = "On Damage Received.deactivates?" # keep listening: everyto = "Shield Protection Up State" # hit restarts the 5 s[[content.steps]]add_link = "On Damage Received.deactivates?" # restart: off, then onto = "Crit Chance Modifier Timer Pebbles"[[content.steps]]add_link = "On Damage Received.activates"to = "Crit Chance Modifier Timer Pebbles"[[content.steps]]link = "Crit Chance Modifier Timer Pebbles.duration" # the copies read thisto = "Shield Reload Delay" # item's numbers, not[[content.steps]] # the donor'slink = "Crit Chance Modifier Pebbles.amount"to = "Shield Value"[[content.steps]]link = "Descripton Format.obj_4[0]" # the card's {0}to = "Shield Value"[[content.steps]]percent = "Descripton Format.obj_4" # 0.3 -> "30", not "0"value = trueA card slot shows its number plain or x100 as a percentage; a shield’s shows
it plain, so a stat that is a fraction needs a percent step.
A timed bonus (effect)
Section titled “A timed bonus (effect)”The recipe above, in one line, on any base item:
[[content]]kind = "item"id = "Increase_Crit_M"base = "Increase_Shield" # the look; its own effect is cutname = "Little Thumb Pebbles"description = "After taking damage, gain #+{0}%@ #Crit Chance@ for #{1}@ seconds"super_effect = falseeffect = { stat = "Crit chance", amount = 0.3, seconds = 5, on = "damage_taken" }on: when it triggers. rsmm writes the listener itself, with the event and filter the shipped items that react to it use:damage_taken,dash,special,defense,ultimate,power,day_start,night_start,talent_picked,item_picked_up,dream_shards_gained,sandman_purchase,reroll. Proven in game:damage_taken,dash,special,defense,power,talent_picked,item_picked_up,dream_shards_gainedandnight_start. There is no “on kill” or “on crit”: no item listens for those. The item’s icon counts the bonus down. Each trigger restarts the full time;refresh = falselets a running bonus finish first.- Stars of Fate (rerolls) is a gain, not a bonus:
{ stat = "Stars of Fate", amount = 1 }gives them once on pickup, and withon(and noseconds) it givesamountmore every time the trigger fires:{ stat = "Stars of Fate", amount = 1, on = "night_start" }is “+1 Star of Fate each night”, wired as the shipped Full_Heal_At_Day_Night wires its heal. Not yet playtested. amountis in the stat’s own unit (crit chance 0.3 = +30%). ForVitalityand theAttack powerstats, enter the points shown in game:15gives +15 vitality or +15% attack power; rsmm writes the game’s raw value as0.15. The card’s{0}is the amount, shown x100 as a percentage (percent = falseshows it as entered), and{1}the seconds. Vitality, attack power and flat stats (Armour,Shield, …) default topercent = false.per_level = truemakes a flat amount grow with hero level, as Fairy Dust’s shield does:amountis the level-1 number and the game scales it by the hero’s Level Healing (10 at level 1).{ stat = "Shield", amount = 10, per_level = true }gives 10 shield at level 1 and more after. Not for percent stats, Vitality, Attack power or whole-number stats.- The base’s own stat effects are cut, so a shield base stops being a
shield;
keep_base_effect = truekeeps them. Its super effect is separate:super_effect = falsedrops it. stepsstill run after the effect, to adjust anything it built (its parts end inEffect).
The editor’s What it does section writes these tables (a row per bonus, always on or after a trigger), and its card preview shows the numbers as the game will print them.
An item from scratch (effects, no base)
Section titled “An item from scratch (effects, no base)”Leave base out and list what the item does. Each entry without seconds is
always on while the item is held; one with seconds (and on) is a timed
bonus as above. Any number of each:
[[content]]kind = "item"id = "Wanderers_Charm" # any lengthname = "Wanderer's Charm"rarity = "Rare" # default Commonicon = "icons/charm.png" # or a vanilla icon stemeffects = [ { stat = "Crit chance", amount = 0.1 }, { stat = "Armour", amount = 5, percent = false }, { stat = "Attack power", amount = 0.2, seconds = 4, on = "dash" },]- An
amountis added to the stat, in the stat’s own unit:0.1onCrit chanceis +10%,5onArmouris +5. To make the meaning unmistakable, write it as text:amount = "+10%","-60%","+5". Bonuses never multiply a stat, so a multiplier like"x0.4"is refused, and the error tells you what to write instead ("-60%"). Talentadd_statsvalues take the same forms, and the build prints one line per bonus saying what each rarity does, so you can check the numbers before playing. - With no
description, the card text is written from the effects, one bullet each, numbered{0},{1}… in order (a timed effect takes two: its amount, then its seconds). Write your own with the same numbering. effectsalso works next to abase: the base then gives only the look.- In
rsmm editor(and the web editor), + New custom item → Start from scratch makes one of these, with the card preview. - The whole item is written by rsmm, not copied out of another item: its
frame (name, icon, quality, card, its own save id) and every part an effect
needs (modifier, timer, tester, trigger listener). A game patch that changes
some shipped item does not change yours. The only shipped file it reads is
the magical-object model every item inherits. With no
nameit is named after its id; it has no super effect unlesssuper_effectsgives it one.
Actions (action)
Section titled “Actions (action)”An entry with action instead of stat makes the item do something
rather than give a bonus: once when it is picked up, or every time on fires
while it is held. It goes in effects and super_effects next to the stat
entries:
[[content]]kind = "item"id = "Hourglass_Shard"rarity = "Epic"effects = [ { action = "reset_cooldown", ability = "dash", on = "defense" }, { action = "upgrade_talents", amount = 1 }, # once, on pickup { action = "spawn_consumables", amount = 2, on = "night_start" },]action |
Extra fields | What it does |
|---|---|---|
reset_cooldown |
ability = dash, power, special, defense or all |
that ability is ready again |
upgrade_talents |
amount (default 1) |
upgrades that many random talents |
upgrade_lowest_talent |
your lowest talent becomes Legendary | |
duplicate_item |
rarity = any (default), common, rare or epic |
a copy of a random magical object you hold |
spawn_consumables |
amount (default 1) |
drops that many consumables |
relearn_talents |
resets your talents to pick again |
ontakes the same triggers as a timed bonus. With noonthe action runs once, when the item is picked up.- Each action sends the event the shipped item that does it sends (Clear Dash Cooldown on Defense, Reduce Ultimate CD, Spawn Consumables, Upgrade All Talents Once and the Sandman power-ups), written the same way. The game’s own code does the work, so rsmm adds nothing to the hero.
- A counted action’s
amountis a card number ({0},{1}… in order, as for bonuses), and the card text is written from the actions when there is nodescription. - Nothing limits how often an action fires:
duplicate_itemondamage_takenduplicates an item on every hit. - Not yet playtested. The events are proven (shipped items and the loader’s
R.ability/R.talent/R.givesend them), but no item built this way has been seen in game yet. There is noultimatecooldown reset: no shipped item sends that event from its data.
Conditions (during)
Section titled “Conditions (during)”during holds an effect on only while a condition is true, on always-on and
timed effects alike (a timed one then needs its trigger and the condition), in
effects and super_effects:
[[content]]kind = "item"id = "Lone_Wolf_Charm"rarity = "Rare"effects = [ { stat = "Crit chance", amount = 0.15, during = "day" }, { stat = "Attack power", amount = 50, during = "no_allies_nearby" }, # 8 m]day/night: the global flags Scarlet and Piper read.no_allies_nearby: on while no living hero but the holder is withinradiusmetres, so always on in a solo run. A hero counts while it carries “Can Fight”, which it has in its Default, Hit Stunned and Staggered behaviours: a downed or dead teammate does not count, one using an ability does, and one in a cinematic, a map teleport or an interaction drops out for that moment. Summons (Kintaro’s Bear, Geppetto’s Dummy, clones) never count. rsmm writes the parts as the shipped ones: Holy Grail’s search around its holder, Sun Wukong’s “Can Fight” filter and Snow Queen’s detector count, which includes the holder (on while it is at most 1). Proven in game, solo and in co-op: off while a living teammate is in range, on again when they leave, are downed or die, in later chapters and continued runs too. Not yet playtested with three or four players.radiusis how far it looks, in metres (default 8).height = [below, above]is how far below and above the holder a hero still counts, in metres. The default[-0.5, 1.5]is every shipped hero search’s band.- Effects with the same
radiusandheightshare one detector; a super effect gets its own.
Super effects (super_effects)
Section titled “Super effects (super_effects)”A super effect is what an item does once the hero holds enough copies of it:
5 of a Common, 4 of a Rare, 3 of an Epic (the card’s “x3”; some effects lower
it). Different items of the same rarity do not count. The game then switches
the item’s super-effect state on, and the card’s second paragraph describes it. super_effects takes the same tables
as effects (always on, or timed after a trigger) and runs them from that
state instead:
[[content]]kind = "item"id = "Wanderers_Charm"rarity = "Rare"effects = [{ stat = "Crit chance", amount = 0.1 }]super_effects = [ { stat = "Attack power", amount = 0.2 }, { stat = "Crit damage", amount = 0.3, seconds = 4, on = "dash" },]- Works on a blank item and on a copy (or
mode = "replace") of any shipped item. A base’s own super effect is replaced; an item without one (a legendary copied down to Rare) gets one. - Common, Rare and Epic only. A Legendary, Cursed or Power-up item has no copy target, so it never switches one on; the build refuses it.
- With no
super_descriptionthe super text is written from them, numbered from{0}likedescription, as one line. - Write super text as one line, without
•. No shipped super text has a bullet or a line break, and the card prints a bulleted one as???. super_effect = falseandsuper_effectscontradict each other: give one.- In the editor, each item has a Super effect section with the same rows as What it does.
A talent takes the same stats table, next to its file (effect names
repeat across a hero’s files):
[[content]]kind = "talent"id = "aladdin_wish_armour"hero = "Aladdin"file = "Hero_Aladdin.entity"stats = { "Ability Trait Wish 3 Shield Gain Modifier" = "Armour" }The Items and Talents tabs of rsmm editor and the
web editor show the same thing as a stat picker per
effect.
Lua-scripted mod
Section titled “Lua-scripted mod”The loader DLL (dist/winhttp.dll) runs init.lua once per launch in a sandboxed lua_State per mod.
./rsmm install-loader # Copy the DLL into the game installOn Linux, launch with rsmm run: it writes the loader override into the Proton prefix. The fallback is the Steam launch option WINEDLLOVERRIDES="winhttp=n,b" %command%.
init.lua gets the SDK from require, and every call goes through the R it returns:
local R = require "rsmm"
R.log("hello from " .. R.mod_dir())R.on("ready", function() R.log("game is up") end)rsmm lint fails a mod whose Lua reads R without that local R = require "rsmm"
line, because the mod would die at load with R nil. It also fails raw game
addresses and the low-level primitives (_internal, peek/poke, read_*/write_*,
read_block, module_base, scratch, call_raw, engine.resolve); those stay inside
the SDK, and a mod uses the high-level R.* calls built on them. The same goes for
R.hook / R.unhook and R.ptr.* (what the SDK itself is built on), for a
require "rsmm.<sub>" of an SDK internal, and for writing into the SDK table
(R.x = ..., function R.x() end): keep a table of your own instead. R.debug.*
is a warning unless the mod’s tags include debug or test.
All game interaction in mod Lua goes through the public, high-level
Lua gameplay API. The loader’s native rsmm table and
direct engine calls such as R.engine.call, R.engine.call_safe, and
R.engine.fn are RSMM internals. If the SDK lacks a capability, follow
When RSMM is missing something.
See examples/ExampleSeedPin/init.lua for a mod that uses the public SDK.
Events
Section titled “Events”R.on is the whole surface. Both engine buses are armed by default, so a mod
sees every event the game fires without the user touching launch options.
local h = R.on("gameplay:GIVE_MAGICAL_OBJECT", function(ev) ... end)R.on_match("^gameplay:ABILITY_", function(ev, name) ... end) -- whole familyR.once("run:start", function() ... end) -- fire onceR.off(h) -- unsubscribeR.emit("mymod:something", { n = 1 }) -- tell other modsFour sources land on the same bus:
| Source | Names | Notes |
|---|---|---|
| Lifecycle | setup, ready, tick, exit |
loader thread |
| Analytics firehose | run_start, enemy_killed, unlock_hero, … |
after the action, no live handles |
| Gameplay bus | gameplay:<NAME> |
at the action, live handles, game’s MAIN thread |
| Loader-derived | hero:captured, hero:changed, hero:lost, menu:enter, menu:leave, run:start, run:end |
loader thread |
ev.source says which ("analytics", "gameplay", "loader", "mod") — and
it is stamped by the loader, so it can be trusted. Only "gameplay" handlers
run on the game’s main thread; anything else must route engine-mutating work
through R.schedule.next_main (see the thread model).
150 gameplay events are catalogued — mined out of the shipped exe by
tools/mine_event_names.py and browsable without launching anything:
./rsmm symbols events # all of them, grouped by family./rsmm symbols events boss # BOSS_ACTIVATED, BOSS_DEFEATED, …A taste of what’s on the bus: BOSS_DEFEATED, OPEN_CHEST, HERO_REVIVE,
START_NIGHTMARE, WISHING_WELL_FILLED, USE_HEAL_FOUNTAIN,
UPGRADE_RANDOM_SKILL, DUPLICATE_RANDOM_EPIC_OBJECT, CHOOSE_MELODY,
MAP_GENERATION_DONE, TELEPORT_SUBMAP_ENTER, ENEMY_KILLED.
The same catalog is available inside the game, plus a live one of everything that has actually fired:
R.events.known("gameplay") -- the 150 static names, before anything firesR.events.category("BOSS_DEFEATED") --> "boss"
R.events.list("^gameplay:") -- sorted names seen THIS sessionR.events.count("enemy_killed")R.events.dump() -- log every event with its count + payload keysThe catalog is a browsing aid, not a whitelist: the loader reads the plaintext name off the event object, so a name a future patch adds fires too.
Event payloads
Section titled “Event payloads”Most events have no payload — and that is the engine’s design, not a gap
in ours. There are only ~24 oCGameNamedEvent subclasses that carry data;
every other name is dispatched as the bare base class, so all it can tell you
is that it happened, plus the dispatcher / entity handles saying to whom.
For the ~24 that do carry data, the layouts are recovered from the binary by
tools/mine_event_payloads.py (RTTI → vftable → the code that stores it) and
the loader decodes them by matching the event’s own vftable, so the match
is exact:
R.on("gameplay:NETWORK_DAMAGE", function(ev) R.log(ev.value) -- 12.5 (f32, hand-confirmed) R.log(ev.source_id) -- "0x2a1f…" (the attacker's NET id; handles are R.log(ev.dispatcher) -- hex strings, because a Lua numberend) -- would lose the low bits)Read the field names honestly: offsets and widths are recovered, meaning is
not. A field only gets a semantic name (value, source_id,
mo_guid_lo) where hand-RE confirmed it; everything else is mechanical —
u50 is “u32 at +0x50”, f6c is “float at +0x6c”. They are real fields at
real offsets, but what they mean is for you to pin down.
Two things help with that. ev.class tells you which struct you are looking
at, and the RSMM_EVENT_PROBE loader flag adds a raw window (ev.w38 … ev.w70) to every gameplay event — so a field gets pinned from Lua in one
session instead of a C++ rebuild per guess.
Decoding is gated on the build fingerprint: vftable addresses are
build-specific, so after a game update the loader falls back to the plain
envelope until the schemas are re-mined
(python tools/mine_event_payloads.py --verify).
Damage attribution (R.damage)
Section titled “Damage attribution (R.damage)”“Who is carrying the run?” is a question about damage per PLAYER, and no single
event answers it. R.damage merges the three places the engine produces a
damage number with an attacker attached, and hands you a live ranking:
R.damage.enable{ window = 10 } -- opt-in: it installs engine hooks
R.damage.on(function(hit) -- hit.label / hit.slot / hit.is_local / hit.amount / hit.source -- hit.kind == "dealt" (they hurt something) or "taken" (they got hurt) -- dealt hits also carry hit.damage_kind ("attack", "ultimate", ... or -- "other"), hit.killed (this hit killed the target) and hit.is_enemy -- (true = enemy, false = scenery, nil = could not tell)end)
for _, row in ipairs(R.damage.board()) do -- already sorted, row.rank set R.log(row.rank, row.label, row.dealt, row.share, row.dps, row.by_type.ultimate)end
R.damage.leader() -- the row on top right nowR.damage.engine_totals() -- the game's OWN totals for the local playerR.damage.reset() -- e.g. per run or per chapterEnemies only, or everything the game counts?
Section titled “Enemies only, or everything the game counts?”Fences, jars, vegetation and mission props are damageable entities, so damage dealt to them reaches the same bookkeeping hook a boss does — and the engine’s own end-screen total counts it. A player who clears a room of furniture can therefore out-rank one who fought. Opt out per meter:
R.damage.enable{ ignore_scenery = true } -- rank enemy damage onlyR.damage.ignore_scenery(true) -- or toggle it mid-runR.damage.scenery_total() -- what the filter droppedR.damage.is_enemy(entity) -- true / false / nil = unknownThe test walks the victim’s component map — an oCEntity keeps its
components in an F14 table (slots at entity+0x5f0, stride 0x10 =
{u32 class id, component*}, bucket mask at +0x600) keyed by the engine’s
32-bit class id. A gameplay enemy carries
oCDtEntityCpntEnemyController = 0x1561073c; destructible props carry only
Hittable + HitPoint. Class ids are mined by tools/mine_class_ids.py into
data/class_ids.json, and a class id is a hash of the class NAME, so it
survives a game patch that moves every address.
It is a page-guarded READ — never an engine call — so a stale offset gives a
wrong answer, never a crash, and an entity that cannot be read is nil
(unknown), which still counts: a failed read must never delete a player’s
real damage. Filtered damage is not lost either — it stays on the row as
row.scenery / row.scenery_hits.
The SDK default is off, because counting props is what agrees with the
game’s own total; filtering is a deliberate divergence a mod asks for. The
bundled damage-meter mod turns it on — a prop takes a flat 1.0 per hit, so
counting props distorts hit counts and DPS far more than damage.
| Source | Sees | Identity |
|---|---|---|
HeroStats_OnDamageDealt (hooked) |
every hero’s damage applied on this machine, allies included | hero controller |
Entity_ResolveAttackHits (hooked) |
attacks resolved locally — used for damage taken, and as a fallback | attacker entity |
gameplay:NETWORK_DAMAGE |
damage the target’s owner replicates to you | attacker net id |
The first source is what makes an ALLY’s damage countable. It is the engine’s
own per-hero bookkeeping, and it runs for every hero — the game just declines
to total anything for a hero that is not the local player (its +0x1d88
gate), which is why the end-of-run screen only ever shows your own numbers.
Hooking it read-only gives every hero’s damage, split by ability type
(row.by_type.attack / power / special / defense / trait / ultimate / dash).
The three views are unified per player: a row found by controller, by entity
and by net id is the same row, so nobody appears twice and share stays
honest. A replicated echo of a hit already counted locally is dropped, while
repeated identical hits from one source (a multi-hit flurry) are kept.
A player keeps ONE row across a chapter change, where the engine rebuilds every
hero controller: the row is re-adopted by hero id (exact — each player’s hero is
distinct) or, failing that, by the engine’s is-local byte. Both joins are gated
on a chapter epoch, bumped by GAME_END_NEXT_CHAPTER /
MAP_GENERATION_DONE: inside one chapter, a hero controller the meter has never
seen is a different player, never a rebuilt one. Without that gate the
third and fourth players to deal damage are adopted as “the same person again”
and a four-player board collapses to two rows — a merge deletes a player, while
the duplicate it prevents is visible and keeps everyone’s damage. A declined
merge is logged (refused to merge …), as is every row boarded, with the
local_byte and hero_id the joins were about to use.
Every hook is observation-only: it replays the original with the exact arguments it received and returns the engine’s own result, so no damage value, target list or event changes.
The damage-meter mod is the ready-made consumer: it reports to the loader log
and publishes an overlay once a second (see below), which feeds both
rsmm overlay damage-meter --watch and the desktop app’s overlay window.
Player names (R.player)
Section titled “Player names (R.player)”R.player.name() --> "Ovilli" (nil when Steam is unavailable)R.player.name_of(steamid64) --> a known account's name, or nilThe local player’s real display name, read from steam_api64.dll’s flat
API by the loader — no game structures, so it survives game patches. R.damage
uses it to label your own row instead of “You”.
Remote players are not named yet, and the reason is worth knowing before
you try: the game resolves an ally’s name from the party member’s user-data
JSON (steam.personaName, gamertag, Nickname, pseudo — FUN_140929940)
and stores it in the party-slot UI model, but nothing observed so far links a
party slot to the hero entity a damage row is keyed by. Pinning that link needs
a live co-op session. Until then, label unknown players by join order and let
the player rename them (the damage-meter mod exposes player_1..4 for exactly
that).
Mouse wheel (R.input)
Section titled “Mouse wheel (R.input)”R.input.on_wheel(function(steps, ev) -- steps > 0 = wheel up if R.game.flag("is_menu_open") then return end R.log("wheel " .. steps)end)R.input.wheel_free() --> true | false, action | nil, reasonR.input.wheel_totals() --> up, down (notches since launch)The loader counts a wheel notch on the frame the game’s input poll reads it and
posts the input:wheel event (steps, plus up/down totals and blocked,
true when the game had input blocked, e.g. during a transition). Nothing is
swallowed: menus, the hero book and scroll panels still get every notch, so a
handler that acts in a run should skip menus, as above.
By default nothing in a run reads the wheel. Out of the box it is bound only to
the menu page alternates. wheel_free() reads the player’s own key bindings and
returns false plus the action name when they have bound the wheel to something
else (an ability, a dash), so a mod can step aside instead of doubling up. It
returns nil plus a reason when the bindings cannot be read.
Handlers run on the game thread inside the input poll. Keep them short.
Middle-mouse drag (R.input)
Section titled “Middle-mouse drag (R.input)”R.input.on_drag(function(phase, dx, dy, ev) -- "start", then "move"s, then "end" if phase == "move" and not R.game.flag("is_menu_open") then R.log(("dragged %.1f, %.1f of %dx%d"):format(dx, dy, ev.w, ev.h)) endend)R.input.drag_available() --> true | false, reasonR.input.drag_state() --> { held, x, y, w, h, drags, dx, dy } | nil, reasonR.input.middle_free() --> true | false, action | nil, reasonThe game’s own input poll reads the middle button every frame, and its UI
update keeps the cursor position. While the game reports the button held, the
loader adds up how far the cursor moved between two polls and posts
input:drag: one start, any number of move (dx, dy in pixels since the
last move), one end. The payload also carries the cursor (x, y), the
window’s client size (w, h, to make a drag resolution-independent),
blocked and button ("middle"). A handler that subscribes mid-drag hears
nothing until the next start.
The cursor stops at the window edge, so a drag does too. Nothing is swallowed:
the game’s UI still sees the click. By default nothing in a run uses the middle
button; middle_free() returns false plus the action name when the player has
bound one to it. drag_state() gives the running totals (drags started, total
dx/dy while held, since launch) for a mod that polls instead of listening.
Mouse-look (R.input)
Section titled “Mouse-look (R.input)”R.input.mouse_look_available() --> true | false, reasonR.input.mouse_look(true, { hide = true }) --> true | nil, reasonR.input.on_mouse_move(function(dx, dy, ev) -- dx, dy: pixels moved since the last delivery -- ev: x, y, w, h, locked, blockedend)R.input.mouse_look_state() --> { requested, active, paused, hidden } | nil, reasonR.input.mouse_look(false)The game’s UI update has a cursor-lock mode that nothing in the game turns on.
mouse_look(true) asks the loader to turn it on: each input poll it writes the
game window’s client-area centre (screen coordinates) where the game expects it
and sets the lock byte, so the game measures dx/dy against the centre and
puts the cursor back there every frame. on_mouse_move delivers the game’s own
dx/dy, in pixels, once per poll in which either is non-zero. ev.locked is
true when the lock was on for that poll. With hide = true the operating
system cursor is hidden while the lock is engaged and shown again on release.
When the lock engages or resumes the loader first moves the cursor to the
centre, and it posts no move event for the poll where the lock changes either
way nor the two polls after it, so a pause or resume never delivers a jump.
The lock pauses (released, cursor shown) while the game wants the cursor (the
pause menu, talent choice, Sandman shop, magical-object menu, cinematic,
loading screen or main menu) or the game window is not the foreground window,
and resumes when that ends. Each pause logs the flag that caused it. The window
check is per frame. The menu check is pushed to the loader from two places.
Every mouse move runs on the game thread and reads the flags live through
R.game.flag, so a menu releases the cursor within a frame of the next move.
The 500 ms tick runs on a loader thread that must not touch the game’s scene
map, so it reads R.game.cached instead (plain memory reads of the records the
last move found). A menu that opens while the mouse is still therefore releases
within half a second, but only after one mouse move in the current scene; after
a scene change it waits for the next move. While the
lock is on, middle-drag events are suppressed: no start, and a drag in
progress ends. The request is a lease: if the mod’s Lua state stops refreshing
it (reload, unload), it lapses after a few seconds and leaves the lock off. It
is one global state, so the last mod to call mouse_look wins: each request
gets an id and a mod only refreshes its own, so a superseded mod stops keeping
the lock alive. Without the
cursor symbols mouse_look returns nil, reason.
Hero mouse-aim probably reads the window cursor, so a centred cursor aims at the screen centre. That is inferred from the code, not traced in a run.
Keybinds (R.input.keybinds)
Section titled “Keybinds (R.input.keybinds)”local K = R.input.keybindslocal zin, why = K.add{ id = "ZoomIn", label = "Zoom in", key = 92 } --> handle | nil, reasonlocal zout = K.add{ id = "ZoomOut", label = "Zoom out", key = 93 }local function fallback(why) --[[ e.g. read the wheel with R.input.on_wheel ]] endif zin then K.on_press(zin, function(n, ev) -- n = presses since the last delivery R.camera.zoom(0.9 ^ n) end) K.on_ready(function(ok, why) -- once, after every init.lua if not ok then fallback(why) end end)else fallback(why) -- the reason add() refusedendK.keys(zin) --> keyboard key id, pad key id (0 = unbound)K.list() --> { {id=, label=, key=, pad=}, ... }K.available() --> true | false, reasonA keybind is a row in the game’s own Settings > Controls menu, on the Keyboard
tab and on the Gamepad tab, after the game’s actions and titled with label.
The player rebinds it there like any shipped action. The game saves it in
GameSettings.ini under <mod id>::<id> and applies its duplicate-key rule: a
key taken by one row is cleared from whatever held it, vanilla action or
keybind. A rebind, also from the pause menu in the middle of a run, takes effect
on the next frame.
add takes id (1-32 letters, digits or _, unique within the mod), label
(1-32 characters), key (the Keyboard tab’s default: keyboard 1-84, mouse
buttons 85-91, wheel up 92 / down 93) and pad (the Gamepad tab’s default:
gamepad key ids 94 and up). Either defaults to 0, unbound, and an id from the
other device is refused. menus = true gets the keybind’s presses in menus too
(see below). The handle also has zin:on_press(fn) and zin:keys().
During init.lua, add queues the keybind. It returns nil and a reason
when keybinds cannot work here at all: a loader without them, or a game build
the loader does not trust. Whether a queued keybind goes live is settled after
every init.lua, when the loader installs its hooks and registers the
keybinds with the game. on_ready(fn) reports that once: fn(true), or
fn(false, reason) when they never will be. A mod with a fallback runs it from
both places, as above. available() is true while that is still pending and
nothing rules it out.
Add keybinds from init.lua. The loader registers every mod’s keybinds with
the game once, on the first input poll after all mods have loaded, and has the
game read GameSettings.ini again so the saved keys apply. A keybind added
after that returns nil and a reason. Adding an id the mod already added
returns the same handle, so a hot reload keeps working. There is room for 16
keybinds across all mods.
on_press handlers run on the game thread inside the input poll, like
on_wheel. ev also carries key and pad (the current keys) and blocked.
A handler gets only presses made in play: presses made while a menu or another
screen that wants the cursor is open (the same list mouse-look pauses on:
talent choice, Sandman shop and the rest, R.input.cursor_screen()) or while
the game has input blocked (during a transition) are dropped, since the
game’s UI gets those keys, and so are presses that waited for the Lua lock (the
loader sorts each press when it is made). A keybind added with menus = true
gets every press; ev.blocked_presses and ev.late_presses count the blocked
and the waiting ones. A player who starts the game once without the loader and
changes a setting loses the saved keys (the game drops lines it does not know
when it saves) and gets the defaults back.
Camera fields (R.camera.get / R.camera.set)
Section titled “Camera fields (R.camera.get / R.camera.set)”R.camera.get("pitch") --> 54 | nil, reason (degrees)R.camera.set("look_offset", 3) --> cameras written | nil, reasonR.camera.reset() -- put back everything R.camera changedThese read and write the hero’s top-down camera settings live. The default
camera takes the value, and the hero’s other cameras (Kintaro on foot,
Melusine’s wisp, the ultimates) follow so the view keeps it when the game
switches cameras. Pass { all = false } to write the default camera only.
| Field | Unit | What it does |
|---|---|---|
yaw |
degrees | Turns the camera around the hero. |
pitch |
degrees | Tilt; the game clamps it to about 0.6 to 86. |
distance |
units | Eye distance from the look-at point. |
fov |
degrees | Field of view. Refused on the default camera, whose FOV is linked. |
look_offset |
units | Slides the look-at point along the ground toward the camera (negative: away). It does not raise the view. height is an older name for it. |
near, far |
units | Clip planes. Written on the default camera only. |
R.camera.FIELDS[name].proven says whether a field has been checked in game;
yaw, distance and look_offset have.
Camera zoom (R.camera.zoom)
Section titled “Camera zoom (R.camera.zoom)”R.camera.zoom(0.9, { duration = 0.25 }) --> true | nil, reason (0.9 = 10% closer)R.camera.zoom_factor() --> target, current (1 = the camera's own distance)R.camera.zoom_reset({ duration = 0.25 })zoom(step) multiplies the zoom factor by step (0.05 to 20), and the game’s
own camera blender eases it in over duration seconds with its cosine curve.
The factor scales the eye’s distance to the look-at point on top of whatever
top-down camera is active, so a hero’s alternate cameras (Kintaro on foot,
Melusine’s wisp, ultimates) and boss fight cameras keep it through every switch.
Boss death scenes are not zoomed. Menus, the hub book and end screens are left
alone, and the factor carries over to the next chapter and the next run.
Pair it with R.input.on_wheel for wheel zoom, and clamp against
R.camera.get("distance") to keep the result in a range you choose.
camera-control does exactly this.
What the UI is showing (R.ui)
Section titled “What the UI is showing (R.ui)”R.ui.is_open("menu") --> true | false | nil, reason (kinds: menu, book, modal, loading, page, root)R.ui.book() --> which book is shown: "main", "settings", "score", "credits", or nilR.ui.page() --> the book page shown: "PlayPage", "OptionsPage", "CreditsPage", ... or nilR.ui.any() --> is a menu, the book or a modal open?R.ui.count("menu") --> how many menus are open (nested ones count)R.ui.open() --> { {kind, class, ptr}, ... }, oldest firstR.on("ui:open", function(e) R.log(e.kind .. " " .. e.class) end)R.on("ui:close", function(e) ... end) -- book events also carry e.whichThe loader tracks the game’s own UI controllers rather than scene flags, so a sub-panel closing does not report the pause menu as closed. The kinds:
| kind | controllers |
|---|---|
menu |
pause menu, hero selection, Sandman’s shop, inventory, magic mirror, social options |
book |
the 3D book is shown (main menu, Settings from pause, score, credits) |
modal |
modal dialogs (including the EULA, multiplayer and MyNacon ones) |
loading |
the loading screen |
root |
MainMenu and BookMenu, the session-long controllers. They are active from boot to shutdown, so this is not a visibility signal |
page |
a page of the book: play, hero selection, hero page and story, Merlin’s abilities, the compendium and its heroes / items / memories / tutorial tabs, challenges, social, options, the end-of-run recap, stats and score |
It arms when the loader starts, so controllers already open when a mod first
asks are counted and their close still fires. The cost is one vftable compare
per component the engine shows or hides. When it cannot
arm (a game patch, or RSMM_DISABLE_UI_STATE=1), is_open returns nil and a
reason: unknown is never reported as closed. ui:open / ui:close fire after
the game has finished showing or hiding the controller.
book reads the book’s own mode, so it is true only while a book is on screen,
and R.ui.book() says which one. A book ui:open / ui:close carries
e.which ("main", "settings", "score" or "credits"); going from one book
to another is a close and an open.
R.ui.page() follows the book’s current page and its open child pages, so tab
switches are seen, and Credits reads "CreditsPage" even though it shares a
class with the tutorial tab. The page kind’s count and events still follow
controller activation: the main-menu book activates all five tab pages at once,
so use page() to ask which page is shown.
Book menu pages (R.ui.menus)
Section titled “Book menu pages (R.ui.menus)”R.ui.menus.page("my.page", { title = "My Mod", categories = function(ctx) return { { id = "a", label = "Alpha", header = { title = "Alpha", text = "line one\nline two" }, rows = { { id = "speed", label = "Speed", choices = { "Slow", "Normal", "Fast" }, value = 2, default = 2 } } } } end, on_back = function(ctx) return true end, -- false vetoes the Back press})R.ui.menus.entry{ id = "my", title = "My Mod", page = "my.page" }R.on("ui:menus_change", function(e) R.log(e.category .. "/" .. e.row .. " = " .. e.index) end)A page is a second copy of the game’s own Settings page: a column of categories on the left, the selected category’s rows on the right, and the game’s Reset button. An entry adds a button to the Settings tab column that opens it, with the book’s own page turn and its own Back. The vanilla tabs (Graphics, Audio, Controls and the rest, plus Credits, EULA and Privacy) do not appear on your page, and the Settings page is unchanged after it closes.
R.ui.menus.page(id, def) registers a page and returns a handle, or nil and a
reason. def.title is the column heading and def.kind is "categories", the
only kind. def.categories(ctx) returns the list of categories; each has an
id, a label (the column button), an optional header (title, subtitle,
text) and rows. The game has no header text element, so each present header
field becomes read-only rows at the top of the category, text one row per line.
A row has id, label, choices (a list of strings), value (the initial
choice) and default (what Reset restores). A row with readonly = true shows
the single text readonly_text and cannot be changed. Every index is 1-based
and clamped to 1..#choices.
R.ui.menus.entry{ id, title, page, after } returns a handle, or nil and a
reason. after = "settings" (the default) puts the entry in the Settings tab
column after the Mods entry. after = "<page id>" puts it in that page’s column
instead, so a page can lead to a nested page. The game builds the Settings page
once, at boot, so register entries in init.lua: an entry registered later
shows up on the next launch.
R.ui.menus.open(page_id, ctx) opens a page from the current leaf page and
R.ui.menus.back() pops one level like the Back button; both return true, or
nil and a reason, and run on the game thread within a frame. ctx is any
JSON-encodable value and reaches categories(ctx) and on_back(ctx).
R.ui.menus.current() returns { page, ctx, depth } while one of your pages is
the leaf, else nil. R.ui.menus.off(handle) removes a page or an entry for the
next open. R.ui.menus.available() is true, or false and a reason (a loader
without it, a symbol that did not resolve, RSMM_DISABLE_UI_MENUS=1, or the native
menu being off or failed to install, RSMM_DISABLE_NATIVE_MENU=1: “needs the
Settings build hook”); with that, every other call returns nil and the reason.
Pages nest at most 8 deep: beyond that open returns false and “too deep (max
8)”, and an entry on the deepest page does not open. The page heading shows
def.title instead of “Settings”.
Events, all with 1-based indices:
| Event | Payload |
|---|---|
ui:menus_open / ui:menus_close |
{ page, ctx, depth } |
ui:menus_select |
{ page, category }, a category was picked (no page turn) |
ui:menus_change |
{ page, category, row, index } |
ui:menus_reset |
{ page, category }, the rows are already back at default |
When a page closes, its pending ui:menus_change events fire before its
ui:menus_close.
R.ui.menus holds no values, so a row shows its value again each time the page
opens; the consumer rebuilds the snapshot in categories(ctx). A consumer writes the result to R.config or
anywhere else from ui:menus_change and ui:menus_reset.
categories(ctx) runs at registration and again each time the page opens, with
the ctx of that open. on_back(ctx) runs on every Back press while your page
is the leaf. Both run inside the game’s own UI code on the game thread, so keep
them fast and never wait in them. An error is logged and the page keeps its
last good rows (empty, if the first call failed). ui:menus_change events come
from a watcher thread that polls every 200 ms.
Sequences (the Credits and Tutorial page turns) and a multi-turn flip are not
part of R.ui.menus yet.
Overlays (R.overlay)
Section titled “Overlays (R.overlay)”The game gives a mod nowhere to draw a HUD, so a mod can publish one to the desktop client instead. Two halves:
Declare the shape in manifest.toml. The client renders exactly this:
[overlay]title = "Damage"icon = "swords" # from a fixed icon setsort = { key = "dealt", dir = "desc" }highlight = "is_local" # bool row key -> accented rowempty = "Waiting for a run."
[[overlay.columns]]key = "label"label = "Player"type = "text" # text | number | percent | bar
[[overlay.columns]]key = "dealt"label = "Damage"type = "number"format = "compact" # 48.2ksuffix = ""Publish the rows at runtime, at whatever cadence suits the mod:
R.overlay.publish{ rows = { { label = "You", dealt = 4821, share = 0.57, is_local = true } }, meta = { total = 8410 }, -- shown in the footer}R.overlay.clear() -- e.g. at a run boundaryRows are flat records of string/number/boolean — anything else is dropped. An unchanged payload is skipped, so publishing every tick costs nothing.
Then: the desktop app puts an Overlay button on the mod itself (library card,
list row, mod page) for every mod that declares one, and rsmm overlay <mod>
renders the same board in a terminal.
Hot-reload (Lua iteration < 5 seconds)
Section titled “Hot-reload (Lua iteration < 5 seconds)”Run ./rsmm watch in a side terminal while the game runs. On any save under mods/:
- Lints the mods you changed. A lint error holds the apply back and is printed, so a typo
never reaches the game (
--no-lintskips this). - Re-applies cooked overrides and syncs each enabled mod’s
manifest.toml,init.luaand other top-level Lua/data files into the game-dirmods/<id>/. - The loader polls those files every ~1 second, tears down the changed mod’s
lua_State, and re-runsinit.lua.
Tweak a number, hit save, see the result in-game without restarting.
Watch the live log:
./rsmm log -f --grep "lua\|reload"Expected output on a Lua-only edit:
[lua] ExampleSeedPin reload (init.lua changed)[lua] ExampleSeedPin init OK[SeedPin] forced seed = 12345 (enable=1) after 1 ticksReading the loader log
Section titled “Reading the loader log”The loader writes to <game>/mods/_log.txt. Read it from the repo:
./rsmm log # Full dump./rsmm log -n 80 # Last 80 lines./rsmm log -f # Follow live (Ctrl-C to stop)./rsmm log --grep lua # Filter (case-insensitive)./rsmm log --clear # Clear before a fresh launchLua errors print as [lua] <mod-id> ...; R.log("msg") calls land in the same file.
Loader features a mod needs
Section titled “Loader features a mod needs”Some loader features are off until switched on, because they hook the engine
more deeply. The one mods need most is hero capture: without it R.entity,
R.stat, R.combat, R.xp, R.camera and the talent grants never find your
hero, and a mod that uses them silently does nothing. Declare what your mod needs
and rsmm apply switches it on while the mod is enabled (and off again when no
enabled mod needs it, leaving flags the player set alone):
[mod]id = "camera-control"loader_flags = ["RSMM_ENABLE_HERO_CAPTURE"]Only the flags the app’s Loader features panel lets a player switch on are
accepted; rsmm lint names them. In Lua, R.entity.capture_enabled() tells “the
player turned it off” apart from “the hero is not found yet” (loading, menus).
Don’t ship vanilla bytes
Section titled “Don’t ship vanilla bytes”rsmm pack <id> hashes every file against the original cooked asset. If any file is byte-identical to the original, pack refuses — shipping unmodified game bytes is redistribution of copyrighted game content, not a mod.
$ ./rsmm pack MyModrefusing to pack MyMod: contains files byte-identical to original game assets ... assets/Ui/BookMenu/Heroes/UI_HeroPortrait_Romeo_Active.png.Texture.dxt (matches original cooked asset)Fix: replace the listed files with your own modified bytes. --allow-vanilla bypasses the check for personal backup zips only.
The data/uncooked/ mirror is git-ignored for the same reason — it exists for local reference only (see Uncooked Assets).
Online play: client-only and gameplay mods
Section titled “Online play: client-only and gameplay mods”For online play, RSMM sorts every running mod into one of two groups:
- Client-only mods change what you see or read, never the game the party plays: a damage meter or other overlay, a camera change, a texture or sound swap, new UI text.
- Gameplay mods change the game: new or edited content (
[[content]]), data patches ([[patch]]), overrides of game data, or Lua that does more than read (R.give,R.stat.modify,R.hp.set,R.talent.grant,R.emit, …).
An install that runs only client-only mods counts as vanilla online. Run
rsmm modpack to see which group each of your mods is in, and why.
RSMM decides the group from what the mod contains, not from its
multiplayer_scope, so a wrong declaration cannot move a mod into the
client-only group. Lint warns when a mod declares cosmetic or local-only (or
nothing) but changes the game. Declare deterministic-shared or
host-authoritative for those.
For Lua, the client-only calls are the whole of R.log,
R.on/R.on_match/R.off/R.once, R.overlay, R.config, R.kv, R.schedule,
R.exp, R.health, R.i18n, R.damage, R.camera, R.audio, R.input and R.ui,
plus these reads: R.entity.hero/ready/capture_enabled/hp/hp_frac/max_hp,
R.stat.get/cached/keys/names/key, R.hp.get/frac/max,
R.game.get/flag/cached/ready/describe,
R.events.known/count/category, R.net.peers,
R.lobby.members/allies/hero_name and R.debug.components. Anything else, including R[...] lookups or
passing R to another function, counts as gameplay.
Load order
Section titled “Load order”When two mods override the same encoded path, the applier keeps the later mod by alphabetical id and warns. Explicit load-order control will come with the in-game UI. If order matters now, encode it: 10_Patch, 20_Skins, …
Content kinds & confidence
Section titled “Content kinds & confidence”Every content kind carries an honesty rating — how much we trust the bytes
it emits. The single source of truth is
src/rsmm/sdk/content.py::KIND_CONFIDENCE, which rsmm lint and the SDK
enforce. The per-kind table is generated from it:
Content kinds & confidence. This page links there
rather than restating a rating, because a hand-kept copy drifts the first time
a kind is proven in game. (tests/test_kind_docs_lockstep.py fails if a prose
table here pairs a kind="…" with a rating.)
Finer than a kind. Some kinds have modes proven to different degrees. The kind’s rating is the weakest mode it ships, so read these alongside it:
kind="enemy",mode="override": proven in-game 2026-08-28. A fixed-entity override turned every Dark Hills camp into treants, andcross_biomeplaced chapter-2/3 creatures in an earlier chapter. What’s still unknown is an imported creature’s projectiles and attack zones (see the caution above).kind="enemy",mode="clone": proven in-game 2026-09-24. A Gnolls-tribe clone with a Mud Crab body spawned in Storm Island gnoll camps. The def self-registers onto its tribe’s roster at load, soUsedRscListregistration is the whole contract. The trap:power(formerlyweight) is the clone’s cost against the camp’s power budget. At 20, the first attempt was priced out of every gnoll camp and never appeared. Leave it unset to keep the base’s cost.kind="item",mode="ban": the exact inverse of the proven catalog write. It drops entries from the same LiveOps MO vector. It hasn’t been confirmed in-game yet.kind="mesh"is proven, but an override is global: every tile that uses that mesh changes too. A character replacement also needs the righttransform.skin, or the model is shredded on the first animation frame.
Capabilities that are not content kinds:
| Capability | Rating | Reality |
|---|---|---|
| Replace a cooked file (raw / texture / model / stat / text / url patch) | ✅ confirmed | Install-time file replacement. Bread and butter. |
| PNG → cooked texture | ✅ confirmed | engine/cooked_schemas/texture.py cooks PNG/DDS/TGA into the oCTexture container at apply-time. |
| Reskin an existing hero (texture/model override) | ✅ confirmed | See JulietReskin. |
| New selectable skin slot | ⚠️ experimental | Needs the loader skin detour; the DLC-entitlement filter rejects new keys by default (RSMM_SKIN_FORCE_SHOW=1 to test). Replacing an existing slot is ✅ confirmed. |
Engine event hooks (R.on("OnDamage", …)) |
⚠️ experimental | The event bus + payload envelope ship in the loader, and emitter addresses are mapped — but the runtime path is not yet verified end-to-end on CI (loader is Windows-only). Treat as unproven until the loader smoke test (below) is green. |
Opting into unverified kinds. Registering any non-confirmed kind requires
sdk.Mod(..., experimental=True) (and the manifest records experimental = true);
otherwise the SDK raises and rsmm lint fails. This is deliberate — a ⚠️/❓
kind is a known guess, not a finished feature.
with sdk.Mod("MyMapMod", experimental=True) as m: # required for any non-confirmed kind m.map("Twilight_Hills", base="Dark_Hills")See Internals for the engine notes that ground all of the above, and Roadmap for open work.
Cooked-file inspector
Section titled “Cooked-file inspector”./rsmm decode <path-to-cooked-file> # Structural dump./rsmm decode <path> --raw # Include hex payloadsParses the class table + section structure. Won’t fully decode per-class property bodies (schemas live in Ravenswatch.exe) but prints enough to identify what you’d be modifying.
