Skip to content
Jacob Guenther edited this page Aug 8, 2021 · 15 revisions

Roll Lang

Help

Quick Guide

Rolling

/r [roll goes here]
/r [roll goes here] \
/roll [roll goes here]
/roll [roll goes here] \

Rolls start with a /r or /roll and end with an optional \. Text can be placed before or after a roll which can be useful to give the roll context. The optional backslash is used to denote the end of the roll. This is useful if you want to include text after your roll that could be interpreted as part of it.

For example:

Rolling my attack /r d20 + 3 +3 is my str modifier

This would print the result of the 20 sided dice roll plus 6.

Rolling my attack (8) + 3 + 3 = 14 is my str modifier

So to exclude the second + 3 we use a backslash like so

Rolling my attack /r d20 + 3 \ +3 is my str modifier

Dice

dN
XdN

Where
    X is the number of dice and
    N is the number of sides
X and N must be integers

Roll Lang supports dice with at least 1 side. When you use the XdN format the dice are summed.

To roll a 20 sided dice enter

/r d20

To roll four six sided dice and add them together enter

/r 4d6

(2+1+5+4) = 12

Math Operations

+ Addition
- Subtraction
* Multiplication
/ Division
^ or ** Power
- Unary Minus
() Parentheses

The above list is the order of precedence from lowest to highest.

Builtin Functions

floor( [expression] )
ceil( [expression] )
round( [expression] )
round_half_down( [expression] )
abs( [expression] )

floor rounds a decimal number down to the next integer. ceil rounds a decimal number up to the next integer. round rounds a decimal number to the nearest integer and on 0.5 rounds up. round_half_down similar to round but rounds down on 0.5. abs takes the absolute value of an integer or decimal.

Comments

[comment goes here]

You can add comments inside your roll by surrounding your comment with braces. This can be useful for labelling parts of your roll. Comments can go almost anywhere in a roll but two comments can not be back to back.

I deal /r [spear]d6 + 3[str mod] + 4[prof bonus] \ damage

I deal [spear](4) + 3[str mod] + 4[prof bonus] = 11 damage

Comments can be combined with inline rolls like so

I deal /r d6[spear] + [[ 3[str mod] + 4[prof bonus] ]][modifiers] \ damage

I deal (4)[spear] + (7)[modifiers] = 11 damage

Advanced Features

Inline Rolls

[[ [roll goes here] ]]

Inline rolls can be used on their own or embedded in a larger roll. They will only display their final result. Inline rolls can be useful if you want to group all of your modifiers together.

Rolling my attack /r d20 + [[ 3 + 4]]

This would display

Rolling my attack (12) + (7) = 19

Tooltips

[? Tooltip goes here]Number or Dice Roll Here
Number or Dice Roll Here[? Tooltip goes here]

Tooltips can be added before or after a number or dice expression. Each number or dice expression can have only one tooltip.

/r d8[? damage dice]

Is the same as

/r [? damage dice]d8

This would display as

[(4) tip: damage dice] = 4

You can also use tooltips as well as comments.

/r [Say something before d8][? This is my tooltip]d8[Say something after d8]

Tooltips are very similar to comments but with the right framework can be used to display them only when the mouse hovers over the something.

Tooltips are not a stable feature.

Computed Dice

( [expression] )dN
( [expression] )d( [expression] )
                d( [expression] )
               Xd( [expression] )

Computed dice rely on an expression rather than a fixed integer for the number of dice and/or the number of sides. The expression must be an expression that evaluates to an integer.

Roll Queries

{? [prompt] | [default] }
{? [prompt] }

Roll queries can be used to ask the user for more information. For example during an attack roll it might be useful to ask a user if they have any additional buffs. The default response is optional.

The prompt can include any text that is not a horizontal bar | or a right curly brace }, and the default can contain any text that is not a right curly brace }.

/r d8 + 4[STR] + {? What other modifiers do you have other than strength? | 1[Proficiency] }

What other modifiers do you have other than strength?
1[Proficiency]
(5) + 4[STR] + 1[Proficiency]

In the above example the user is prompted with a question and given a default response that they can edit. The response was not edited so the default was used.

Roll Modifiers

Something you will see in many of the roll modifiers are comparisons. The comparisons listed below are valid anywhere comparisons can be used.

> greater than
< less than
= equal to
>= greater than or equal to
<= less than or equal to

Note: An error will be returned if a combination of modifiers that would result in rerolling or exploding on every roll is used.

Rerolls

[dice]rN
[dice]r[comparison]N

Reroll modifiers will reroll dice if their condition is met. If a dice is rerolled the original value is not added to the roll. You can use comparisons with the reroll modifier like so

/r 4d6r<=2

This will reroll any dice that is equal to 1 or 2. You could write this another way using multiple reroll modifiers.

/r 4d6r1r2

The result might look like

(3+not_counted(2)+3+4+6) = 16

In the form rN whenever N is rolled on the dice the dice will be rerolled. This is a shorthand for r=N.

/r d20r1

This will reroll the d20 if a 1 is rolled.

Drop/Keep

Drop Lowest
dlN
dN
Where N is an integer

The drop lowest modifier will drop the lowest N number of dice. Dropped dice will not be counted towards the result.

Drop Highest
dhN
Where N is an integer

The drop highest modifier will drop the highest N number of dice. Dropped dice will not be counted towards the result.

Keep Lowest
klN
Where N is an integer

The keep lowest modifier will drop all but the lowest N number of dice. Dropped dice will not be counted towards the result.

Keep Highest
khN
kN
Where N is an integer

The keep highest modifier will drop all but the highest N number of dice. Dropped dice will not be counted towards the result.

Success/Fail Rolls

NOT IMPLEMENTED YET

Exploding Dice

[dice]!
[dice]!N
[dice]![comparison]N

TODO

Penetrating Dice

[dice]!p
[dice]!pN
[dice]!p[comparison]N

TODO

Compounding Exploding Dice

[dice]!!
[dice]!!N
[dice]!![comparison]N

TODO

Sort

Sort Ascending
sa
s

Sort dice rolls in ascending order

Sort Descending
 sd

Sort dice rolls in descending order

Macros

TODO