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:
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. Only the selected branch is rolled, so an unused branch does not spend dice or trigger side effects.
  • Roll damage only on a hit:
  • Only the chosen branch rolls:
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: