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).
onChoicereservedWhen a choice is taken (reserved).
onCheckTierreservedWhen a check resolves to a tier (reserved).
onCombatEndreservedWhen combat ends (reserved).
onFlagSetreservedWhen a flag is set (reserved).
onVarChangereservedWhen a variable changes (reserved).
onZoneEnter✓ liveWhen the hero moves into a scene zone (gate with inZone).
onAttackedreservedIn-combat reaction window — reserved/deferred (task #52).

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.
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: zoneIdThe hero is in a given scene zone.
objectStateobjectState: {id, key?, is}A scene object’s state key matches (default: revealed).
statstat, op, valueCompare a character stat (level / xp / hp / maxHp).

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).

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.

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).
grantLevelLevel 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 (✨).

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).
returnScenePop 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.
gotonodeJump to another node.

Sheet actions

ActionParametersWhat it does
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.

Scene state

ActionParametersWhat it does
revealObjectobjectIdReveal a hidden scene object.
setObjectStateobjectId, key, valueSet a scene object’s state key (drives layer swaps).
moveActoractorId, zoneIdMove an actor to a zone.
setActorVisibilityactorId, visibilitySet an actor visible/hidden/concealed.

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").

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 →