Conventions
Each feature will be covered in 3 sections.
- Syntax
- Description
- Examples
There may be multiple syntaxes for each feature. Each of them will be listed. The differences will be covered in the description.
In the syntax definition you may see words enclosed in < and > these are required parameters. They can be any of the following
expression - any group of operations that evaluates to a number or a number.integer - an integer.comparison - see comparisons
Optional parameters are encolsed by two question marks. ?N? would mean an optional number.
The description will describe each part of the syntax, and may give recommendations or advice on how to use the feature.
Examples will cover basic usage of the feature.
In the future there will be an area for you to test the feature for yourself.
Invoking Roll Lang
Roll
Syntax
/roll <expression> \
/r <expression> \
Description
The primary way to use Roll Lang is by passing it a string with /roll
or /r
in it. Roll lang will only attempt to interpret content after one of these keywords until it reaches a backslash \
, the end of the input, or the expression ends.
The backslash is optional but recommended.
/r
is just a shorthand for /roll
.
Examples
-
/roll 1+1 \
1+1=2
-
/r 1+1
1+1=2
Inline Roll
Syntax
<anything> [[ <expression> ]] <anything>
Description
Inline rolls differ from the /roll
keyword in two ways.
- They can be nested in other rolls.
- They do not display the formula that led to the result.
One use case for inline rolls is grouping modifiers together.
Examples
-
I deal [[1+1]] damage to the goblin.
I deal 2 damage to the goblin.
-
/roll 1+[[1+1]]
1+2=3
Roll Query
Syntax
Description
Examples
Math Operations
Addition
Syntax
<expression> + <expression>
Description
Examples
/roll 1+1 \
1+1=2
Subtraction
Syntax
<expression> - <expression>
Description
Examples
/roll 1-1 \
1-1=0
Multiplication
Syntax
<expression> * <expression>
Description
Examples
/roll 3*4 \
3*4=12
Division
Syntax
<expression> / <expression>
Description
Examples
/roll 3/4 \
3/4=0.75
Raise to a Power
Syntax
<expression> ** <expression>
<expression> ^ <expression>
Description
Examples
-
/roll 4**2 \
4**2=16
-
/roll 5^2 \
5^2=25
Unary minus (negative numbers)
Syntax
-<expression>
Description
Examples
/roll -1+4 \
-1+4=3
Parentheses
Syntax
(<expression>)
Description
Examples
/roll (1+2)*3 \
(1+2)*3=9
Builtin Functions
floor
Syntax
floor(<expression>)
Description
Rounds a decimal number down to the next integer.
Examples
/roll floor(4.9) \
floor(4.9)=4
ceil
Syntax
ceil(<expression>)
Description
Rounds a decimal number up to the next integer.
Examples
/roll ceil(4.9) \
ceil(4.9)=5
round
Syntax
round(<expression>)
Description
Rounds a decimal number to the nearest integer and rounds up when the decimal part is .5.
Examples
/roll round(3.5) \
round(3.5)=4
round_half_down
Syntax
round_half_down(<expression>)
Description
Rounds a decimal number to the nearest integer and rounds down when the decimal part is .5.
Examples
/roll round_half_down(3.5) \
round_half_down(3.5)=3
abs
Syntax
abs(<expression>)
Description
abs is short for absolute value. Applies the absolute value to an expression.
Examples
/roll abs(-7) \
abs(-7)=7
Dice
Normal Dice
Syntax
d<sides>
<number of dice>d<sides>
Description
Examples
-
/roll d20
(11)=11
-
/roll 2d6
(3+4)=7
Computed Dice
Syntax
d(<expression>)
<number of dice>d(<expression>)
(<expression>)d(<expression>)
Description
Examples
-
/roll d20
(11)=11
-
/roll 2d6
(3+4)=7
Fate Dice
Syntax
dF
<number of dice>dF
(<expression>)dF
Description
Examples
/roll 3dF
(1+-1+-1)=-1
Dice Modifiers
Dice modifiers change how dice are rolled, calculated, or displayed.
Some dice modifiers can't be used in combination with other modifiers or be used multiple times on the same dice. The description will tell you if there are any conflicts.
Many dice modifiers can be used with a comparison. The comparisons that are supported are listed below.
=
equal<
less than>
greater than<=
less than or equal>=
greater than or equal
Reroll Modifier
Syntax
reroll ?N / Comparison <N>? ?limit T? ?nonrecursive?
Description
Shorthands
- reroll - r
- limit - lim
reroll/r <Comparison<N>>
This form of the syntax will reroll any dice that has a roll value that makes the comparison true.
reroll/r
When used with only the reroll or r keyword a reroll modifier will reroll any roll that has a value of 1.
This is equivalent to reroll=1 and reroll1.
reroll/r <N>
This form of the syntax will reroll any dice that who's roll value equals N.
This is equivalent to reroll=N.
limit keyword
The limit keyword can be added to any reroll modifier. It will reroll the dice a max of T times. T is optional and has a default value of 1.
Examples
/roll 3d10r
(1+-1+-1)=-1
Roll 3 d10 and reroll any 1s.
Comments