ScryMaster Docs

Triggers & actions

Behavior in ScryMaster is data, not code. A rule reads: when something happens, if a condition holds, then run an ordered list of actions. That’s the whole system — and it’s why community content is safe to run.

Closed vocabulary, default-deny. Actions come from one fixed list. Anything not on it is rejected by the validator and can never execute — no eval, no arbitrary code, no RCE vector in shared content. Every table below is generated from the same source the engine and the AI grounding endpoint use, so it’s always current. The machine-readable version lives at /api/v1/actions.

Triggers (the “when”)

Rules fire on a trigger. You attach rules to a node, or once at the adventure level. Triggers marked reserved are declared for upcoming passes and don’t fire yet.

TriggerFires?When
onEnterNode✓ liveWhen a node is entered.
onExitNodereservedWhen a node is left (reserved).
onChoice✓ liveWith a choice anchor (Rule.choiceAnchor { sceneKey, choiceId }): on the step the host says that choice was taken in that scene (an Arena dialogue scene, or a Story node). hero/self is the creature who chose. Unanchored it is reserved.
onCheckTierreservedWhen a check resolves to a tier (reserved).
onCombatEnd✓ liveWith a battle anchor (Rule.battleAnchor, optional outcome victory/defeat/stalemate), in an encounter: once, on the step the victory door says the battle ended. Unanchored it is reserved.
onFlagSetreservedWhen a flag is set (reserved).
onVarChange✓ liveWith a variable anchor (Rule.varAnchor.varId), in an encounter: when another rule's write changes that scenario variable. Chains of these are capped and held rule_cascade_limit. Unanchored it is reserved.
onZoneEnter✓ liveWhen the hero moves into a scene zone (gate with inZone) — or, with a spatial anchor (Rule.anchor.spatialZoneId), when a creature enters that MAP zone, fired from the engine's committed crossings.
onAttackedreservedIn-combat reaction window — reserved/deferred (task #52).
onZoneExit✓ liveWhen a creature leaves the MAP zone the rule is anchored to (Rule.anchor.spatialZoneId), fired from the engine's committed crossings. Needs an anchor: the scene band model has no exit event, so an unanchored onZoneExit rule is refused.
onInteract✓ liveWhen a creature's interaction with the object the rule is anchored to (Rule.objectAnchor.objectId) commits: opening a chest, taking a key; objectAnchor.outcome 'failure' fires on a failed pick or force instead. objectAnchor.verb narrows it to one verb. Needs an object anchor.
onCombatStart✓ liveWith a battle anchor (Rule.battleAnchor, no outcome), in an encounter: once, on the step the host opens the encounter with, before that step's other rules (an opening briefing). Unanchored it is reserved.
onTurnStart✓ liveWith a creature anchor (Rule.creatureAnchor, subject party/anyCreature/nonParty), in an encounter: when that creature's turn begins. hero/self is the creature.
onTurnEnd✓ liveWith a creature anchor, in an encounter: when that creature's turn ends. hero/self is the creature.
onRoundEnd✓ liveWith a round anchor (Rule.roundAnchor, optional every N or at N), in an encounter: when a combat round ends. hero/self is the party lead.
onCreatureDown✓ liveWith a creature anchor (optional lifeState dying/stable/dead), in an encounter: when a creature drops to 0 HP. hero/self is the creature.
onCreatureStabilized✓ liveWith a creature anchor, in an encounter: when a dying creature is stabilised. hero/self is the creature.
onDamageTaken✓ liveWith a creature anchor (optional damageType), in an encounter: when damage lands on a creature (a fully resisted hit does not count). hero/self is the creature.
onConditionGained✓ liveWith a creature anchor (optional condition), in an encounter: when a creature gains a condition. hero/self is the creature.
onConditionLost✓ liveWith a creature anchor (optional condition), in an encounter: when a creature loses a condition. hero/self is the creature.
onObjectDestroyed✓ liveWith an object anchor (Rule.objectAnchor.objectId, no verb or subject), in an encounter: when that whole object is destroyed. hero/self is the destroyer, else the party lead.
onSighted✓ liveWith a sight anchor (Rule.sightAnchor.seers, the creatures whose eyes it watches) and once, on a map: after a step on which one of those creatures sees a party member - a clear line of sight, by the same read Hide uses. hero/self is the creature seen.

Conditions (the “if”)

A condition is a small predicate over the run’s state. Combine and nest them with all (AND), any (OR), and not — e.g. (A and B) and (here or there). The same predicates power choice gating (requires) and gate-node branching.

ConditionShapeWhat it tests
allall: Condition[]All sub-conditions are true (AND).
anyany: Condition[]Any sub-condition is true (OR).
notnot: ConditionThe sub-condition is false (NOT).
flagflag, isA flag equals a boolean.
hasFlaghasFlagA flag is truthy (shorthand).
varvar, op, valueA variable compares (==,!=,>,>=,<,<=) to a value.
bindbind, op, valueA live value read through a binding (e.g. creatures.g1.hp.pct) compares (==,!=,>,>=,<,<=) to a value.
clockclock, gte?, lte?A clock is within gte/lte bounds.
hasCluehasClueThe hero has learned a clue.
objectiveobjective, isAn objective has a given status.
relationshiprelationship, gte?, lte?An NPC relationship is within gte/lte bounds.
hasItemhasItem, qty?The hero holds an item (optional qty).
affordsaffords: {cp?,sp?,ep?,gp?,pp?}The purse can afford a coin cost.
visitedvisited: NodeIdA node has been entered at least once.
visitCountvisitCount, gte?, lte?A node’s visit count is within gte/lte bounds.
inZoneinZone: zoneId, actor?: cast keyThe hero is in a given scene zone. With actor, a cast member is inside that map zone instead (an Arena encounter only; a story run reports it).
heldheld: cast keyA cast member's standing order is hold (the Hold order, or a rule's holdActor). An Arena encounter only; a story run reports it.
objectStateobjectState: {id, key?, is}A scene object’s state key matches (default: revealed).
statstat, op, valueCompare a character stat (level / xp / hp / maxHp).
passivePerceptionpassivePerception: {gte}The printed Passive Perception score (10 + Wisdom (Perception) bonus; SRD 5.2.1 p.186) is at least a DC — a score, not a roll.
starsstars: levelId, gteThe best stars the account has earned on a level (a scenario id) are at least gte. Read from the campaign's view of the account; a story run cannot answer it and refuses.

Actions (the “then”)

A then is an ordered list of actions — they run top to bottom, so you chain as many as you like. Grouped by what they touch:

State

ActionParametersWhat it does
setFlagflagSet a boolean flag true.
clearFlagflagSet a boolean flag false.
incVarvar, byAdd to a numeric variable (counters/clocks).
setVarvar, valueSet a variable to a number or string.
tickClockclock, byAdvance a declared clock by N.
addClueclueAdd a clue to the investigation board.
setObjectiveobjective, toSet a quest objective’s status.
adjustRelationshipnpc, byShift an NPC relationship score.
grantAdvantageNextscope?Advantage on the next check (or initiative).
grantDisadvantageNextscope?Disadvantage on the next check (or initiative).
upsertVarvar, value, byCreate a variable at a value, or add to it if it already exists.
unsetVarvarRemove a variable, so reads find nothing until it is written again.

Combat & dice

ActionParametersWhat it does
applyDamagetarget, dice?|amount?, damageType?Deal damage (dice or amount) to a target.
applyHealtarget, dice?|amount?Heal a target (dice or amount).
applyConditiontarget, conditionApply a 5e condition to a target.
clearConditiontarget, conditionRemove a condition from a target.
requestCheckability?|skill?, dc, adv?Deprecated — author an ability/skill check as a skillCheck NODE (with outcome tiers), not a then-list action.
resolveAbilityelementId, targets?Deprecated — not wired; apply effects via applyDamage/applyHeal/applyCondition (or an item), not this verb.
startCombatencounterDeprecated — begin an encounter via a combat NODE (with onVictory/onDefeat/onFlee), not a then-list action.
joinCombatactorId, side, initiativeBring a creature the encounter placed into the running fight, on a side and at an initiative you state (reinforcements arrive). It never makes a creature. Performed in an Arena encounter; a story run holds no fight and warns.
resolveRecipetarget, recipeResolve a recipe on one creature with the encounter's dice (a trap's needle: a saving throw, then damage and a condition on a failure, half on a success), in a fight or out of one. It comes from the rule, never from a made-up creature. Performed in an Arena encounter; a story run holds no session and warns.
departCombattarget, causeA creature leaves the running fight (the cart horse bolts, a guard flees through a portal): it takes no further turn here. Cause fled or teleported. With no fight running, a creature that flees is taken off the board (a despawn) and the next fight does not seat it; teleported still needs a fight. Performed in an Arena encounter; a story run holds no board and warns.
setControltarget, controller?, side?, duration?A creature in the running fight answers to another creature's command (the charmed guard, the bought mercenary): the controller decides its turns and it fights for the controller's side, for some rounds, turns or minutes, or the whole encounter, then reverts. A side instead (or as well) puts it on that team (the surrendering bandit who joins the party), and the fight's victory counts it there while it holds; a second setControl with its own side puts it back. Performed in an Arena encounter; a story run holds no fight and warns.
setPerceptiontarget, preset?, searchRounds?, leashFeet?, duration?A creature in the running fight hunts differently for a while (the difficulty knob): a preset (aggressive, guard or hunter) or its own numbers set how far it strays from its post and how many rounds it searches for a hero it lost sight of, for some rounds, turns or minutes, or the whole encounter, then it goes back to its own. A second setPerception replaces the first. Performed in an Arena encounter; a story run holds no fight and warns.
rollInitiativesurprised? (creatures)Roll for initiative: the encounter's fight begins now, with every creature on the map on the side, and surprised or not, that the encounter set up. A surprised list adds creatures the rule adjudged surprised (they failed to notice the party): each rolls its Initiative with Disadvantage. Performed by an Arena encounter's Play session; in a fight already running it is refused; a story run begins fights with a combat node and warns.

Rewards & currency

ActionParametersWhat it does
grantItemitemId, qty?, note?Give an item to the hero’s bag.
grantGoldgp, note?Give gold (folds into the purse + ledger).
grantCoinscoins, note?Give mixed coins (cp/sp/ep/gp/pp).
spendCoinsamount, note?Deduct coins (gate with an affords condition).
grantLevel—Level the hero up (milestone).
awardXpxpAward XP toward the next level.
craftItemrecipeIdCraft from a recipe — consume the ingredients, grant the output (re-validated against the bag).
grantInspirationamount?Grant real Heroic Inspiration — spendable at the combat roll windows (✨).
grantGategateIdPass a campaign gate for the carrier hero (its costs debit, its grant applies) when the rewards settle at quest end. A story run warns.
buyItemitemId, price, stockVar?, shopId?, note?Buy one item for a price - the coins, the item and the stock change together, or nothing does (sold out, can't afford, or locked).

Random

ActionParametersWhat it does
rollTabletable[], note?Roll a seeded weighted table and apply the picked entry.

Flow & sub-scenes

ActionParametersWhat it does
callScenenodeJump to a node and push a return address (sub-scene).
returnScene—Pop back to the caller of a sub-scene.
ifThenif, then, else?Run `then` (else `else`) by an inline condition — conditional effects inside a then-list.
forEachgroup {inRegion}, doRun `do` once for each creature in a region (an encounter only); target `each` inside it names that creature.
repeattimes, doRun `do` a set number of times (1–20; nested repeats multiply under the same cap).
abilityCheckability, skill?, dc?, passiveOf? {actorId, ability, skill}, then, else?The creature that set the rule off makes an ability check (rolled with the session's dice) against a DC, another creature's passive score, or both, then runs `then` on a success (else `else`). Performed by an encounter or Play; a story's checks are skillCheck nodes, so a story run warns.
gotonodeJump to another node.

Sheet actions

ActionParametersWhat it does
restrestType (short)The party takes a short rest: an hour, and each hero may spend Hit Dice to heal. Not during a fight. Performed in an Arena encounter through the same rest the village uses; a story run rests at a rest node and warns.
consumeItemitemId, qty?Consume a single-use item the hero holds.
useItemitemIdUse an owned item — a PLAYER command from the bag/inventory (not an author then-list action).
spendResourcekey, amount?Spend a resource/slot the hero actually has.
equipItemitemId, slot?Equip an item the hero OWNS (grant it first) — auto-picks the slot, or takes an explicit one. Runs through the same equip rules as the inventory.

Scene state

ActionParametersWhat it does
revealObjectobjectId | zoneIdReveal a hidden scene object, or a hidden zone of the map. A zone is presentation only: an Arena encounter shows it to the players once its zone check passes; a story run has no map and warns.
setObjectStateobjectId, key, valueSet a scene object’s state key (drives layer swaps).
moveActoractorId, zoneId, mode?Move an actor to a zone. In an Arena encounter, mode append queues the walk behind whatever the creature is already doing; the default replaces it.
setActorVisibilityactorId, visibility, findDc?Set an actor visible/hidden/concealed.
unlockObjectobjectIdUnlock a door or chest on the encounter map (the rule is the key: no check, no action spent). It never opens it — a creature does. Performed in an Arena encounter; a story run holds no doors and warns.
setDoorStateobjectId, state (open | closed | locked)Open, close or lock a door on the encounter map (a lever, a ward, a trap slamming shut): the rule moves it, so no action and no check is spent. Locking an open door shuts it first. A door that is already in that state, or a lock that cannot hold, is refused and the rule records why. Performed in an Arena encounter; a story run holds no doors and warns.
carrycarrierId, riderIds, vehicle?Seat creatures on a carrier (two heroes on the cart a horse pulls): when the carrier walks they ride along behind it, and they do not walk on their own until they dismount. A fight beginning ends it. Performed in an Arena encounter; a story run holds no map and warns.
dismountcarrierIdThe riders get down from their carrier, each staying on the square it rode to. Performed in an Arena encounter; a story run holds no map and warns.
dropItemitemId, at ({cell} | {actorId}), quantity?Put an item on the ground - under a creature (loot where a bandit fell) or on a square - for any creature to pick up, a coin pouch included. Picking it up is handling an object: within 5 ft, and in a fight the free object interaction or the Utilize action. Performed in an Arena encounter; a story run holds no map and warns.
traveltarget, along ({zoneId}), paceWalk a creature along a zone's trail at a pace (walk, trot or gallop), one cell at a time, each step an ordinary move, so every zone on the way fires its own rules. The trail starts at the zone cell nearest the creature, then the nearest cell not yet walked, a tie going to the cell listed first. A refused step ends the travel there. Performed by an Arena encounter's Play session out of a fight; a story run has no map and warns.
holdActortarget, heldHold a creature where it stands (held true), or release it (held false): a held companion does not follow the party, and a walk it is ordered on ends in a hold. Performed in an Arena encounter out of a fight; a story run has no command channel and warns.
followActortarget, leaderA creature follows a leader: its standing order becomes follow that creature. Performed in an Arena encounter out of a fight; a story run has no command channel and warns.
teleportActortarget, to ({cell})A creature arrives at a square at once, without walking the squares between (a portal, a blink). A square another creature holds refuses it. Performed in an Arena encounter out of a fight; a story run has no map and warns.

Display & I/O

ActionParametersWhat it does
emitEventname, props?Emit a domain event (analytics / AI / voice hook seam).
showScenesceneRefShow a scene on the shared display.
playAudiotrackIdPlay a soundboard clip.
showToasttext, ms?Float a short message to the player ("You found 10 silver").
focusCameratarget ({cell} | {actorId} | {zoneId}), follow?, blend? ('cut' | {glideMs})Point the map camera at a cell, a creature or a zone, and optionally follow the creature as it moves. Presentation only: it changes nothing in the game. Performed by an Arena encounter's viewport; a story run has no map and warns.

Node kinds (the beats you string together)

An adventure is a graph of nodes. These are the kinds you can place:

Node kindWhat it is
sceneNarrative beat: prose + optional interactables / passive onEnterCheck → next.
choiceA branch: a list of choices (each with optional requires / then / next).
dialogueA conversation: conditional lines + response choices in one node.
skillCheckAn ability/skill check with 5 outcome tiers + a failure model.
challengeA skill challenge: reach N successes before M failures.
combatAn encounter → onVictory / onDefeat / onFlee.
lootGrant rewards (then actions) → next.
transitionA conditional jump to another node.
gateFirst matching branch wins; else a fallback node.
consequenceApply effects (then actions) → next.
restA short/long rest (spend Hit Dice / refresh resources) → next.
hubA revisitable hub with conditional exits.
endingA terminal node (endingId + outcome + epilogue variants).

Authoring with AI

Because the vocabulary is small, closed, and published as JSON, an LLM can author whole adventures grounded in the real verbs — then self-check with validate + simulate before you publish. Build in the Studio by hand, or bring your own AI (Claude, Gemini, ChatGPT) pointed at the grounding endpoint and OpenAPI spec.

Next: Publishing & saves →