ROLZ

Dice Expressions
Help | Info

Dice codes can be more than a single die roll. You can combine dice, numbers, comparisons, and functions in one expression. Function arguments can themselves be full dice expressions, so you can nest calculations instead of splitting them into several rolls.
Math
  • Multiplication before addition:
  • Parentheses first:
  • Negative numbers:
  • Combine dice and numbers:
Comparisons
Comparisons return 1 when true and 0 when false.
  • Equal:
  • Greater or equal:
  • Less than:
Functions
Functions can use numbers, dice rolls, and full expressions as arguments.
  • Minimum and maximum:
  • Absolute value:
  • Rounding:
  • Clamp into a range:
  • Inclusive range test:
Output tags
Use tag(result [, name, value...] ) to return a result and add output tags. You can omit tags. You can give a name without a value. A name without a value displays as a key-only tag. If a name repeats, its last value wins. The result can be a dice expression or a quoted string.
  • Add one tag:
  • Add a key-only tag:
  • Add two tags:
  • Add tags from the selected branch only:
Variables with var()
Use var("name") as a readable form of !name. It can read personal macros, built-in roll references, lookup lists, and character-sheet fields. For example, var("DEX") reads DEX from your character page if that field exists. var("!DEX") also works.
Use var("name", value) to set and return a value. If name resolves to a wiki field or const, Rolz writes the new value back to that wiki page. The roll shows an orange write tag with the source page.
If name resolves to a personal macro, built-in roll reference, or lookup list, Rolz does not overwrite it. The new value only exists for the current command. Undefined names also create command-local values.
  • Store and read a value:
  • Use !name as the shorter form:
  • Read a character field:
  • Write a character field if DEX exists there:
  • Roll once, then use the value in a conditional result:
  • Keep an existing macro until the setter runs:
A command-local value disappears after the command. A later setter does not change an earlier !name in the same command.
Nesting expressions
Function arguments can contain other functions, dice, comparisons, and arithmetic.
  • Nested functions:
  • Dice inside a function argument:
  • Conditional with a dice expression branch:
Conditional rolls
Use if(condition, true result [, false result] ) for conditional dice. The false result is optional. A false condition returns 0 when you omit it. Only the selected branch is evaluated. An unused branch does not roll dice or trigger side effects. A selected branch can return a quoted string.
  • Roll damage only on a hit:
  • Omit the false result to return 0:
  • Only the selected branch rolls:
  • Return text for either result:
  • Mix a dice result and text:
Success levels / Warhammer rolls
The wh(target, die max, step) function rolls one die and returns signed success levels. It defaults to d100 and step 10.
  • Basic roll-under success levels:
  • Custom die and step: