Inline Rolls
From Roll20 Wiki
Main Page: Complete Guide to Macros & Rolls#Inline Rolls
Inline Rolls refers to the numerical roll result in(usually yellow) boxes that is displayed in the q Text Chat, and the double bracket syntax[[2d6+2]]
used for creating them. They can be used both in user-made macros(Free) as well as API Scripts(Macro Creation
- Complete Guide to Macros & Rolls
- q Text Chat
- Dice Reference
- Inline Rolls & Labels
- Order of Operations
- Macros
- Token Reference
- Character Reference
- Roll Templates
- Roll Table
Advanced
- Formatting
- HTML Replacement
- Chat Menus
- Hidden Rolls
- Advanced Macro Tips
- API Commands
- Char Sheet Creation
- External tools
Misc.
Contents |
Inline Rolls
If you use simple roll commands/macros like /roll 2d10+5
, the whole command is a dice roll, and the individual rolled dice & their results are displayed in the q Text Chat.
But when you use Roll Templates, or want to have embedded dice rolls within other commands like /em
, you use inline rolls, which results are displayed as a final sum(breakdown can be seen if you hover mouse over it). Inline Rolls are wrapped in double brackets([[ ]]
) around the calculation for it to be processed.
The result of "Normal" dice rolls is shown as individual dice images displaying the result on each dice separately, along with the total result, while inline roll results are displayed in as a single numerical result, where you can see the roll breakdown by hovering your mouse over the result.
Inline rolls are just like regular rolls, with the following exceptions:
- You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote(
/em
), or a whisper(/w
), with an inline roll included.- Ex.
/w alice the silent curse will affect you for [[2d4]] days.
- Ex.
- They are evaluated completely before any (
/roll
) commands, so you can use them as "random variables" in your rolls. See Order of Operations for more. - You see only the total roll result by default, by the dice roll breakdown can be seen if you hover your mouse over the result.
- Using inline labels in rolls will make it easier to understand more complex rolls
- Highlights (Critical Successes & Failures) are highlighted
- If an inline roll contains a critical success, it will be highlighted with a green border.
- If there's a critical failure, it's highlighted in red.
- If it contains both, it's in blue.
Also when you mouse-over the inline roll to see the details of the roll, it'll show red and green highlights for the individual dice that rolled crits/fumbles.
With inline rolls, the numerical end result is shown in a (yellow) box, and if you hover you mouse over the result, you see the full equation of the roll, along with the result of each.
Examples
/em swings their sword and does [[2d6+2]] damage.
&{template:default} {{name=Test Attack}} {{attack=[[1d20+5]]}}
Inline Labels
If you want to include additional comments before the end of the roll (we call them "inline labels"), use square brackets. For example, /roll 2d10+5[Fire Damage] + 3d6[Ice Damage]
. Inline labels works both with "normal" rolls and inline rolls.
When these comments are applied directly after a die roll they show up as tool-tips on the dice:
/roll 2d10+5[Fire Damage] + 3d6[Ice Damage]
This is especially useful if a roll contains multiple variables and you want to look up what number comes from what attribute.
You can even use sheet attributes in labels. Especially useful if the name of the stat can be customized by the user, so the corresponding label should change to reflect the name.
Example:
/r @{selected|customskill1}d6[@{selected|customskill1name}] + @{selected|str}[str]
Tricks
- Inline Rolls in Rollable Tables(Forum) - Eric B
- followup(Forum)