MATT Handlebar Expressions - ironmonk88/monks-module-wiki GitHub Wiki
Handlebar Expressions
Handlebar expressions can be used to display or normalize data in actions.
Wherever you place the handlebars, it will instead be treated as the actual data; IE:
{{user.name}}
will be treated asGamemaster
if Gamemaster triggers that tile, but will treated asBob
if Bob triggers it.
You may need to include [0]
if there is an array, such as more than one current token or more than one roll table result.
If your result includes special characters, you may need to use triple handlebars on each side: {{{value.text.[0]}}}
.
{{actor.name}}
The name of the associated actor of thetriggering token
.{{darkness}}
The scene's darkness level.{{method}}
How the tile was triggered.{{scene.name}}
The name of the scene the triggered tile is on.{{time}}
The world clock's time in minutes after midnight.{{token.name}}
The name of thetriggering token
.{{user.name}}
The name of thetriggering user
.{{value.entityType.length}}
The number of entities of that type returned by a Check Entity Count.entityType
will need to be replaced with the type of entity you are checking, such astoken
.{{value.items.[0].name}}
If used following an Add Item action, it will use the item name.{{value.round}}
The combat round value when triggered by the Combat Round trigger.{{{value.text.[0]}}}
If used following a Roll Table action, it will use the result if it was a text entry; see the Random NPC Dialog sample tile.{{value.tokens.[0].id}}
ID of the first token in thecurrent token collection
.{{value.tokens.[0].name}}
The name of the first token in thecurrent token collection
.{{value.turn}}
The combat turn value when triggered by the Combat Turn Start trigger.{{variable.valuename}}
References a stored variable.
Handlebars can also reference an entity's attributes; {{actor.system.skills.prc.passive}}
, {{token.texture.src}}
or {{tile.texture.src}}
. Depending on the use case, entity
may need to be used in place of either token
or tile
.
Using Handlebar Expressions
These are just examples; all actions with value or text fields accept handlebar expressions now.
- Alter can alter an attribute by referencing a variable value; or alter a string to match a different expression.
- Chat Message can display any of these in the chat message.
- Jump to Landing can jump to a landing whose name matches the result of the expression.
- Send Notification can display any of these in the notification.
Page Last Updated
- Foundry 12.331
- MATT 12.02