Skip to content
3 Death Saves

Dialogue Tree Editor

Every shop runs on a dialogue tree. The tree decides what the shopkeeper says, which choices the player sees, when the shelf opens, and how a visit ends. The archetypes ship with finished trees, and this editor is how you change them or write your own.

Trees are stored on journal entry pages. Opening a tree page shows an “Edit dialogue tree” button that launches the editor. The Journal directory gains a “New dialogue tree” button that creates a fresh page and opens it for editing. Both buttons appear only on your client. A shop points at its tree from shop settings, so several shops can share one tree.

The editor lists every node as a row that expands into its full detail. It has a Nodes tab, an Overview tab that summarizes the tree, and a Help tab with a reference for the node types. Shift-click selects multiple rows. Right-clicking a row offers copy, copy sub-tree, duplicate, paste, and delete. Nothing is written to the page until you press Save.

A tree is a set of nodes joined by choices. A visit starts at the entry node and follows choices until it reaches an End node. There are eight node types.

  • Dialogue speaks lines to the player and presents each choice as a button. Individual lines can carry conditions, so the shopkeeper’s script can shift with circumstances.
  • Browse opens the shelf with a filtered slice of the shop’s stock and the cart. It requires a query, a checkout choice, and a leave choice.
  • Inventory asks the player to pick one of their own items and stores it in a named variable for later nodes. An item filter narrows what it accepts. It requires a picked choice and a leave choice.
  • Transaction commits the cart, moving items and currency, then branches by outcome. It requires a choice for the cancelled outcome.
  • RollTable rolls a Foundry roll table, stores the result in a variable, and branches on conditions against the roll.
  • Auto branches silently on conditions without showing the player anything. Auto and RollTable nodes each require one unconditional choice as the fallback.
  • Goto jumps to another node, or to another tree by its page UUID.
  • End closes the visit and can run a final batch of effects.

A choice carries its button text, a target node, an optional cost, a “Show when” condition, and a “When chosen” effect list. Conditions and effects are built from rows in a builder, grouped with AND, OR, and NOT.

Conditions draw from a registry of predicates. They can test the buyer’s wealth, level, attributes, and owned items, shop and world flags and counters, the time of day and season, the last roll result, and the shop’s transaction log, including what a buyer bought before and how often they have visited. Effects can set flags and counters, adjust price modifiers, move currency and items, advance world time, play a sound, post a chat message, fire a hook, or run a Foundry macro. Macro conditions and macro effects are restricted to you.

A choice on a Dialogue node can instead accept free-text input. The player types a word, keywords route matching input to other choices, and a fallback choice catches everything else.

Inventory and Transaction nodes can grant an Active Effect when they complete, applied to either the chosen item or the customer, which is how service shops sell blessings and repairs. Drag an Active Effect into the grant field or paste its UUID. The archetypes install their reference effects into a world compendium created on demand, described in System adapters.

Browse nodes can carry a flavor pool. The shopkeeper draws from it as items move in and out of the cart, surfacing as speech bubbles in the vignette.

The editor validates the tree and lists problems with a jump-to-node link. Errors cover structural breaks such as missing required choices, dangling targets, and free-text choices outside a Dialogue node. Warnings flag unreachable nodes, cycles between Auto and RollTable nodes, and references to unregistered predicates, effects, or filters.

The Graph button opens a read-only map of the tree. It pans, zooms, and redraws live as you edit. Clicking a node in the graph focuses that node’s row in the editor.