The notebook can include markdown that rolls digital dice. You can roll dice with any number of sides
rollable([dice=]dicenotation,[dicelabel=label text,label=label text])
|Required||The dice notation for the roll. See below for more details.|
|Optional||The text to display in the title bar of the roll notification. Will default to the dice notation if omitted.|
|Optional||The text to show in the rendered markdown. Will default to the dice notation if omitted.|
If the only field used is
dice=, the field label can be omitted, so
rollable(dice=1d20+2) is can be shortened to
Dice rolls are given in the form
AdX. A and X are variables, separated by the letter d, which stands for die or dice. The letter d is lower-case.
- A is the number of dice to be rolled.
- X is the number of faces of each dice.
To this basic notation, an additive modifier can be appended, yielding expressions of the form AdX+B. The plus sign can be replaced by a minus sign (“-“) to indicate subtraction. B is a number to be added to the sum of the rolls. So,
1d20+10 would indicate a roll of a single 20-sided die with 10 being added to the result. These expressions can also be chained (e.g.
Each dice group is resolved and the total re-calculated as it is processed left-to-right. No order of operations are used to calculate the final result.
Dice notation is usable in
rollable() markdown as well as the dice rolling panel.
1d20 will roll a 20-sided die and return the result.
2d6+4 will roll 2 6-sided dice, add them together and add 4.
Some systems allow for rolling multiple times and picking the highest or lowest dice from all those rolled. This can be accomplished with by adding the following the the dice notation
- A is either
kfor keep or
- B is either
hfor highest or
- X is the number of dice to keep or drop
4d6dl1 will roll 4 6-sided dice, drop the lowest, and add the remaining 3 together. This is functionally equivalent to
4d6kh3 (roll 4d6, keep the highest 3, add them together).
Open-ended rolling, exploding dice, and penetration rolls
Several games use mechanics that allow one or more dice to be rerolled (often a die that rolls the highest possible number), with each successive roll being added to the total.
The notation for exploding dice is to use an exclamation point:
AdX! or 6d6!.
number() and mod5e() in Statblocks
As well as the standalone
mod5e() now also have the
dicelabel= properties to allow dice to be rolled based on the numerical value of the field. This allows you to create a number that is editable via the UI then have that number used in the roll. To use the selected number in the roll, replace any of
AdX+B with the character
Damage 1d6 + number(name=damage,label=Strength,value=4,dice=1d6+n,dicelabel=Damage) Rolls
n is the
numer() value selected.
Strength number(name=str,label=Strength,value=12) (mod5e(show_symbol,value=str,dice=1d20+n,dicelabel=Strength Roll)) Rolls
1d20+n where n is the
mod5e() value calculated from the
Referencing numbers in other dice rolls
You can include the value of a
mod5e() in the dice notation of another number or rollable by using the
field[fieldname] syntax in the dice notation. To include the number from a different object, use the
field[objectid.fieldname] syntax. This allows you to easily re-use the same field multiple times.
**Strength:** number(name=strength,value=14) (mod5e(name=strengthmod,show_symbol,value=strength,dice=1d20+n,dicelabel=Strength Check)) **Reference Field:** rollable(1d20+field[strengthmod])
When the dice are rolled, the result will appear at the top of the page.
- The title can be customised with the
- Shows the individual dice rolls. Groups will be shown in parenthesis, e.g.
2d6 + 2d4 + 2will show the
2d6grouped together, the
2d4grouped together and the
+ 2by itself. Max die rolls are highlighted green, min die rolls are highlighted red. If you specify keep/drop high/low then the rolls kept will be highlighted in green and the rolls dropped will be greyed and crossed out.
- The final total.
- The original roll notation.
You can close the notification by clicking the X button or swiping it away on a touch screen. Rolling again will also update the notification. There is no history of rolls kept.