Creating macros with variables
For those who master or play systems with dynamic rules, the Dice Queen engine offers an in-line macro environment that supports the creation of variables and conditional rules (“If-Then”) through the vertical bar operator (pipe |).
Declaring variables (/v)
You can pre-calculate values or save intermediate rolls using the /v prefix:
/v bonus = 1d4 + 2 | /r 1d20 + bonus [Ataque abençoado]
The engine resolves the bonus calculation first and reuses it in the final attack roll.
Logical conditionals and automation of critical hits
We can link the execution of a roll to a logical condition with the /r [condicao]; [expressao] syntax:
- Comparison operators:
<,>,<=,>=,==,!=. - Logical operators:
and,or,not.
Critical Hit Check Example:
/v dado = 1d20 | /r dado >= 19; dado + 10 [Acerto crítico fulminante!] | /r dado + 2 [Ataque comum]
How the engine evaluates pipes:
The system reads expressions from left to right.On the first /r directive where the condition is true (or when there is no condition), it is executed and all subsequent ones are ignored.This allows you to create complete “If-Else” structures in a single line!
Interpolation of token values ({variavel})
Within character sheets and system models, you can reference current character values in curly braces:
{forca}: Injects the value of the token’s Strength attribute.{this}: Smart shortcut to inject the value of the skill or item that triggered the test.
Classic example in Paranormal Order:
When the Strength attribute is greater than zero, the number of dice is rolled keeping the highest;otherwise, 2 dice are rolled keeping the worst:
/r {forca} > 0 ; {forca}d20kh1 + ({this}*5) | /r 2d20kl1 + ({this}*5)
If the variable does not exist in the form, Dice Queen replaces it with 0 automatically, ensuring that scrolling never fails due to a typing error.
To understand the philosophy behind this no-strings-attached system, read systems-agnostic VTT.