Placeholders and Conditions
Placeholders
Section titled “Placeholders”A {{path}} placeholder reads a dot-separated path out of the current run and drops its value into a text field. In a text field the value is converted to text. In a condition, number, or expression field, the raw value passes through unchanged, so a function can receive a token or other document directly.
| Path | Resolves to |
|---|---|
token.name, token.actor, etc. | The token involved in the current run, when its event carries one. |
event.name | The event key that fired this run: the handler you’re editing on the Program tab. |
region | This trigger’s Region. |
scene | The scene the Region belongs to. |
variables.<name> | A value from the trigger’s Variables tab or set by a Set Variable node. |
previous | Whatever the most recent node that produces a result set it to. |
results.<name> | A named field merged in by a node that produces more than one value, such as Call Handler merging the called handler’s results. |
item | The current item inside a For Each, or inside an any()/all() clause. |
triggerCount | How many times this trigger has fired, counting this run. |
An event can also carry its own data at the top level: token, a click’s point and shiftKey/altKey/ctrlKey/metaKey, a movement’s movement.origin/movement.destination, a rotation’s rotation, a combat event’s combat, or a door event’s wall. See Events for which event carries which.
Numbers with dice and placeholders
Section titled “Numbers with dice and placeholders”A number field accepts a plain number, a {{path}} placeholder, or a dice formula. Placeholders resolve first, so {{variables.bonus}} + 1d4 becomes something like 3 + 1d4 before it’s rolled. If the resolved text isn’t a plain number, it’s evaluated as a Roll formula.
Conditions
Section titled “Conditions”A condition evaluates to true or false. Write a comparison with one of these operators:
| Operator | Meaning |
|---|---|
== | Equal |
!= | Not equal |
>, >= | Greater than, greater than or equal |
<, <= | Less than, less than or equal |
Join several comparisons with &&; every clause must be true. There’s no OR operator: to test whether any item in a collection matches, use any(collection, condition) or all(collection, condition), where condition runs once per item with {{item}} bound to it.
For example:
{{token.name}} == "Goblin"attribute({{item}}, "system.attributes.hp.value") > 0hasCondition({{item}}, "prone") && visible({{item}})distance({{item}}, {{region}}) <= 30any(within, hasCondition({{item}}, "prone"))These call condition functions such as attribute(), hasCondition(), visible(), and distance(). The full list, with their arguments and return values, is on Condition Functions.
References
Section titled “References”A reference field points at a single document, chosen one of these ways:
| Kind | Points at |
|---|---|
| Document | A specific document, chosen manually. Doesn’t change between fires. |
| Triggering Token | The token from this firing of the trigger. |
| Triggering Actor | That token’s actor. |
| Tagger Tag | The first placeable carrying a given Tagger tag. Comma-separate several tags to match any of them. |
| First Of A Group | The first document in one of the collections below. |
| Run Data Path | A {{path}}-style dot path into the current run, such as token.name or variables.myVar. |
| This Trigger’s Tile | The Tile this trigger is linked to. |
Collections
Section titled “Collections”A collection is a named list of documents. For Each’s Collection field and Set Current Collection’s Source field pick one from a dropdown of these built-in ids:
| Id | List |
|---|---|
within | Tokens currently inside this Region. |
players | Player-owned tokens on this scene. |
players:active | Tokens owned by a currently active player. |
controlled | Tokens currently controlled on canvas. |
users | Every user. |
users:active | Currently active users. |
region, scene, activeScene | This Region, this scene, or the currently active scene, each as a single-item list. |
regions, notes, tiles, walls, sounds, drawings | Every Region, Note, Tile, Wall, ambient sound, or drawing on this scene. |
actors, items, journal, macros | Every Actor, Item, journal entry, or macro in the world. |
playing | Every currently playing playlist sound. |
previous | The result of the previous node, as a list. |
A condition function that takes a collection, such as any(), all(), or count(), needs one of these ids typed directly as text rather than picked from a dropdown. Add tag:<tag> for every placeable carrying a Tagger tag, or var:<name> for a list a Set Current Collection node built up during this run; both also work as a Collection or Source dropdown choice.
Variables
Section titled “Variables”A value stored in the Variables tab or written by a Set Variable node is readable anywhere in the trigger as {{variables.<name>}}. A Set Current Collection node instead builds a list that lasts only for the current run, and that list shows up as a var:<name> collection.