https://wiki.roll20.net/api.php?action=feedcontributions&user=243061&feedformat=atomRoll20 Wiki - User contributions [en]2019-06-20T23:34:14ZUser contributionsMediaWiki 1.20.3https://wiki.roll20.net/ShadowrunShadowrun2014-02-01T23:43:02Z<p>243061: </p>
<hr />
<div>Tips on playing Shadowrun 4th Edition on Roll20<br />
[[Category:Guides]]<br />
<br />
So you’re considering playing Shadowrun on Roll20.<br />
Excellent choice - great game and a great table. But I’m guessing that you’ve come across a problem - Shadowrun has a fair few quirks that other games don’t have, which means it doesn’t always fit snugly into Roll20.<br />
<br />
Fear not, for here are some tips my friends and I have been toying with to make the game run smooth.<br />
<br />
Setting up a new page<br />
Alright, you’re the GM for a brand new campaign. You’ve got some excellent ideas to run the players through the paces, now it’s time to set up your first page. Open the toolbar at the top of the screen (1) and click on the page settings (2).<br />
<br />
<br />
Shadowrun uses the metric system, so set the scale to 1m. You can set the grid, fog of war and dynamic lighting to suit your preferences.<br />
<br />
Setting up the page in this way means that people can use the measurement tool easily figure out things like weapon ranges and how far a character can move without sprinting.<br />
I like to setup a title page with the character tokens and the name of the campaign on it too. Partly because it helps set up the mood and partly because it means no matter what the players decide to do, I can just copy and paste them from the title onto the relevant map. I find 2 minutes in Roll20’s image search makes some decent title pages.<br />
<br />
<br />
I also like to set up a token bag (or the GM Stash Page, as I call it) with some handy pre-made NPC tokens for either set pieces or random encounters. I find this particularly useful in something like Shadowrun, because my players have a habit of never doing what I expect them to. <br />
<br />
Handouts.<br />
Once you’ve created or uploaded a map, consider creating a handout with that map as an image ready for when a hacker decides to try and find the building plans on city hall or for when a mage decides to do some astral recon.<br />
<br />
I also like to get some of the more forgettable rules set up as “cheat sheet handouts” - I love Shadowrun, but some of the rules just fall out of my ears between sessions. That way if a player needs to check exactly what the different fire modes on a weapon mean, or exactly how they can use edge, they just need to open the handout<br />
<br />
Rolling Dice<br />
Alright, this is Shadowrun. Which means you’re going to need buckets of 6 sided dice. There are two ways to deal with rolling the d6 of doom here; with a formula or with the dice tool. We’ll start with formula first.<br />
<br />
Let’s use Smirky the Orc as our example. <br />
Smirky is trying to outdrive a bunch of unhappy people on a crowded highway. To make things simple, we’re going to pretend that he has a pilot ground craft skill of 5 and a Reaction of 5. To make a driving check, we’d add up the skill and the attribute, so 5+5 which gives us a dice pool of 10. We’re not using the optional Action Movie rules, so a success will be a 5 or a 6.<br />
<br />
All we really need to know is that in Roll 20, > is not “greater than” but “greater or equal to”. You can use the /roll command, or abbreviate it to /r. We’re rolling 10 6-sided die and we want to know every value of 5 or greater, So we’re going to type /r 10d6>5.<br />
<br />
<br />
3 successes? Ew. Something tells me that our boy should have used edge on that roll. If we’d wanted to use edge and call upon the rule of 6, we’d put a ! next to the number of dice in our formula. In other words, we’d roll 10 6-sided “exploding” dice while wanting to know every value of 5 or over. So we’re going to type /r 10d6!>5.<br />
<br />
You’ll notice that we rolled more that 10 dice there - that’s because the ! called upon the rule of 6. Good thing too - 5 success is a lot healthier.<br />
<br />
If we wanted to, we could use the Dice Rolling tool. Personally, I prefer to just type the formula, but you might be someone who prefers an interface. So let’s take a looksee.<br />
You can ignore the basic dice rolls section and head straight for the advanced section - the chances that you’ll ever have to roll just 1d6 in Shadowrun are slim, and frankly if you’re ever in a situation where you can only roll one dice, you might want to do everything you can to avoid making that roll.<br />
<br />
This interface is pretty simple - just fill in the fields as required. In Shadowrun you’ll not need to use the modifier box (the one to the right of the d6 field), and remember to set the target numbers to >5.<br />
<br />
You’ll probably have seen the “Compounded (Shadowrun-style)” option under exploding dice. Well, don’t get too excited, because that doesn’t work with Shadowrun 4th edition. Hit the “Separate” option if you want exploding dice, otherwise it’ll add the extra values to the sixes you roll. That’s fine and all, but it won’t actually count as extra successes.<br />
<br />
It’s worth noting that Roll20 has a pretty robust macro system. Unlike when the guide was first written, there is now a way to change the dice pool for a roll in-macro, but it looks a little unwieldy when you look at it. To modify the dice pool you'll put the initial roll value and a Prompt modifier into the macro: <code>/r {(3 + ?{Modifier Total|0})d6}>5</code><br />
This will ask the rolling player to enter a value for the Total Modifier, with a default value of 0 (See the [[Dice Reference]], section "Roll Queries" for more info). As of yet, though, there doesn't seem to be a way to choose whether to use edge (<code>!</code> roll modifier) or not without making a duplicate macro.<br />
<br />
Rolling initiative<br />
<br />
To calculate your initiative in Shadowrun, you roll your initiative score in d6 and then add your initiative to that value. So let’s say Smirky the Orc has an initiative score of 10 (What? I like 10. It’s easy to remember. When you write a guide you can pick the numbers). So we’d roll 10d6 and add 10 to it to give us our initiative score. Luckily, we can do that straight in the command line and avoid doing math during a late night game session!<br />
<br />
/r 10d6>5 + 10<br />
<br />
We can even have our players drag and drop that 13 successes straight into the turn tracker. Now that is what I call “pretty sweet”.<br />
<br />
How to deal with Initiative Passes<br />
Of course, we can’t talk about initiative in Shadowrun in Roll20 without walking smack into the initiative pass system. Unlike most games, we’re going to have to track the initiative score in each turn and which initiative pass in each turn we’re in. A character can have anywhere from one to four passes per combat turn, and after a lot of different attempts with things like using decimals or letters in the initiative tracker, I’ve found that there are two workable solutions;<br />
<br />
1: Remember the initiative pass.<br />
Not what I’d call foolproof, especially when it gets late in the evening. But this is the <br />
simplest method because you just need your brain.<br />
<br />
2: Use the token markers<br />
Unlike games like D&D4e, we’re not going to be tracking a lot of things like “marked by X, bloodied, 5 fire ongoing.” So that frees up the token markers. When combat starts, click on the tokens and select the markers option. The simply select a color for each initiative pass each character has at that time. This makes it easy to see how many passes a character has, and all we have to remember now is which pass we’re in.<br />
Setting up a Character Sheet<br />
<br />
You can automate some of the rolls in character sheets now, too. Just use @Attributes and Abilities. For example, a character with a Negotiation Dice Pool of 10 could have a Negotiation Attribute and linked Ability: <code>/r {(@{Negotiation} + ?{Modifier Total|0})d6}>5</code> which, when run, will ask the user for any modifiers to their roll and then pull the value of the Attribute (in this case 10), then roll the dice and display the result. Unfortunately, as with Macros, there does not seem to be a way to set whether to use edge (Exploding Dice (<code>!</code> modifier)) or not without using a second "copy" ability.<br />
<br />
That being said, here are some character sheet tips that my players and I find really useful.<br />
<br />
We create and manage our characters on Chummer (which is free and well-supported), then tell the program to print the character sheet as text. This displays a preview window, which we can copy and paste directly into the character sheet. This really helps when a player can’t make a session, as it means another player can float their character, which is why I always make the character appear and be controllable by players.<br />
<br />
You don’t have to export it as plain text of course - the character sheet also supports tables, so pick the format you like best and paste it in there.<br />
<br />
Once we’ve copied the information in, we create three Attributes - Physical, Stun and Init. Fill these in with your physical and stun track, and put your physical initiative in the Init field. You could also create a MagicInit or MatrixInit for characters that require them.<br />
<br />
<br />
Once we’ve filled out those fields we can automate the initiative by creating a new ability. Hit the add button and then the edit pencil and type /r @Init d6>5 + @Init. Then move the cursor to the space between Init and d6 and get rid of the space there. You should end up with this screen:<br />
<br />
<br />
You can test the macro by hitting the d20 button to the right of the initiative roll - once you’re happy it’s working, press the green tick.<br />
<br />
Before we save this character, we just need to scroll to the bottom and press duplicate. This saves a lot of time when we move on to our next character or NPC; paste in the new character sheet, drag a new portrait image in and alter the Physical, Stun and Initiative values. <br />
<br />
<br />
<br />
I like to have the character initiatives ready to go at the bottom of my screen, so on each character I tick the “show in Macro bar” box and make sure that “show macro in quick bar” is selected on the settings tab<br />
.<br />
<br />
<br />
It’s worth noting that these buttons only appear on my screen - players see only the macro buttons they choose to see (by selecting “show in macro bar” and “show macro in quick bar” as above) <br />
<br />
When you place a token on the map for the first time, remember to link it to the character sheet. That way the tokens will reflect the correct physical and stun values no matter what map you’re on. To do that, click on the token and press the cogwheel (1) or double click on the token. Then select the character sheet to link the token to (2) and select Physical for bar 1 and Stun for Bar 2 (3). Your character is now linked, and any changes you make to the physical or stun values will be tracked throughout the table.<br />
<br />
<br />
I recommend not linking trash NPCs to the sheet in this way; I’ve tried that in the past, and the result was that every time one biker took damage, the table thought that they all did.<br />
<br />
<br />
Some useful Macros<br />
<br />
Roll a regular Test<br />
[[(?{Ability|2}+?{Skill|2}-?{penilty|0})d6>5]]<br />
<br />
Roll a Test with edge<br />
[[{(?{Ability|2}+?{Skill|2}+?{Edge|2}-?{Penalties|0})d6!}>5]]<br />
<br />
Role a strait edge test<br />
[[{?{Edge|2}d6!}>5]]<br />
<br />
Initiative tests<br />
/em has a total initiative of [[?{Initiative}+{(?{Reaction|2}+?{Intuition|2}-?{Wound Penalties|0})d6}>5]]<br />
<br />
Initiative test with edge<br />
/em has a total initiative of [[?{Initiative}+{(?{Reaction|2}+?{Intuition|2}-?{Wound Penalties|0}+?{Edge|2})d6!}>5]]<br />
<br />
<br />
There! You’re now all set to play Shadowrun. Enjoy! And pay your fixers a finders fee, dangit!</div>243061https://wiki.roll20.net/ShadowrunShadowrun2014-02-01T23:42:39Z<p>243061: Added small list of useful macros</p>
<hr />
<div>Tips on playing Shadowrun 4th Edition on Roll20<br />
[[Category:Guides]]<br />
<br />
So you’re considering playing Shadowrun on Roll20.<br />
Excellent choice - great game and a great table. But I’m guessing that you’ve come across a problem - Shadowrun has a fair few quirks that other games don’t have, which means it doesn’t always fit snugly into Roll20.<br />
<br />
Fear not, for here are some tips my friends and I have been toying with to make the game run smooth.<br />
<br />
Setting up a new page<br />
Alright, you’re the GM for a brand new campaign. You’ve got some excellent ideas to run the players through the paces, now it’s time to set up your first page. Open the toolbar at the top of the screen (1) and click on the page settings (2).<br />
<br />
<br />
Shadowrun uses the metric system, so set the scale to 1m. You can set the grid, fog of war and dynamic lighting to suit your preferences.<br />
<br />
Setting up the page in this way means that people can use the measurement tool easily figure out things like weapon ranges and how far a character can move without sprinting.<br />
I like to setup a title page with the character tokens and the name of the campaign on it too. Partly because it helps set up the mood and partly because it means no matter what the players decide to do, I can just copy and paste them from the title onto the relevant map. I find 2 minutes in Roll20’s image search makes some decent title pages.<br />
<br />
<br />
I also like to set up a token bag (or the GM Stash Page, as I call it) with some handy pre-made NPC tokens for either set pieces or random encounters. I find this particularly useful in something like Shadowrun, because my players have a habit of never doing what I expect them to. <br />
<br />
Handouts.<br />
Once you’ve created or uploaded a map, consider creating a handout with that map as an image ready for when a hacker decides to try and find the building plans on city hall or for when a mage decides to do some astral recon.<br />
<br />
I also like to get some of the more forgettable rules set up as “cheat sheet handouts” - I love Shadowrun, but some of the rules just fall out of my ears between sessions. That way if a player needs to check exactly what the different fire modes on a weapon mean, or exactly how they can use edge, they just need to open the handout<br />
<br />
Rolling Dice<br />
Alright, this is Shadowrun. Which means you’re going to need buckets of 6 sided dice. There are two ways to deal with rolling the d6 of doom here; with a formula or with the dice tool. We’ll start with formula first.<br />
<br />
Let’s use Smirky the Orc as our example. <br />
Smirky is trying to outdrive a bunch of unhappy people on a crowded highway. To make things simple, we’re going to pretend that he has a pilot ground craft skill of 5 and a Reaction of 5. To make a driving check, we’d add up the skill and the attribute, so 5+5 which gives us a dice pool of 10. We’re not using the optional Action Movie rules, so a success will be a 5 or a 6.<br />
<br />
All we really need to know is that in Roll 20, > is not “greater than” but “greater or equal to”. You can use the /roll command, or abbreviate it to /r. We’re rolling 10 6-sided die and we want to know every value of 5 or greater, So we’re going to type /r 10d6>5.<br />
<br />
<br />
3 successes? Ew. Something tells me that our boy should have used edge on that roll. If we’d wanted to use edge and call upon the rule of 6, we’d put a ! next to the number of dice in our formula. In other words, we’d roll 10 6-sided “exploding” dice while wanting to know every value of 5 or over. So we’re going to type /r 10d6!>5.<br />
<br />
You’ll notice that we rolled more that 10 dice there - that’s because the ! called upon the rule of 6. Good thing too - 5 success is a lot healthier.<br />
<br />
If we wanted to, we could use the Dice Rolling tool. Personally, I prefer to just type the formula, but you might be someone who prefers an interface. So let’s take a looksee.<br />
You can ignore the basic dice rolls section and head straight for the advanced section - the chances that you’ll ever have to roll just 1d6 in Shadowrun are slim, and frankly if you’re ever in a situation where you can only roll one dice, you might want to do everything you can to avoid making that roll.<br />
<br />
This interface is pretty simple - just fill in the fields as required. In Shadowrun you’ll not need to use the modifier box (the one to the right of the d6 field), and remember to set the target numbers to >5.<br />
<br />
You’ll probably have seen the “Compounded (Shadowrun-style)” option under exploding dice. Well, don’t get too excited, because that doesn’t work with Shadowrun 4th edition. Hit the “Separate” option if you want exploding dice, otherwise it’ll add the extra values to the sixes you roll. That’s fine and all, but it won’t actually count as extra successes.<br />
<br />
It’s worth noting that Roll20 has a pretty robust macro system. Unlike when the guide was first written, there is now a way to change the dice pool for a roll in-macro, but it looks a little unwieldy when you look at it. To modify the dice pool you'll put the initial roll value and a Prompt modifier into the macro: <code>/r {(3 + ?{Modifier Total|0})d6}>5</code><br />
This will ask the rolling player to enter a value for the Total Modifier, with a default value of 0 (See the [[Dice Reference]], section "Roll Queries" for more info). As of yet, though, there doesn't seem to be a way to choose whether to use edge (<code>!</code> roll modifier) or not without making a duplicate macro.<br />
<br />
Rolling initiative<br />
<br />
To calculate your initiative in Shadowrun, you roll your initiative score in d6 and then add your initiative to that value. So let’s say Smirky the Orc has an initiative score of 10 (What? I like 10. It’s easy to remember. When you write a guide you can pick the numbers). So we’d roll 10d6 and add 10 to it to give us our initiative score. Luckily, we can do that straight in the command line and avoid doing math during a late night game session!<br />
<br />
/r 10d6>5 + 10<br />
<br />
We can even have our players drag and drop that 13 successes straight into the turn tracker. Now that is what I call “pretty sweet”.<br />
<br />
How to deal with Initiative Passes<br />
Of course, we can’t talk about initiative in Shadowrun in Roll20 without walking smack into the initiative pass system. Unlike most games, we’re going to have to track the initiative score in each turn and which initiative pass in each turn we’re in. A character can have anywhere from one to four passes per combat turn, and after a lot of different attempts with things like using decimals or letters in the initiative tracker, I’ve found that there are two workable solutions;<br />
<br />
1: Remember the initiative pass.<br />
Not what I’d call foolproof, especially when it gets late in the evening. But this is the <br />
simplest method because you just need your brain.<br />
<br />
2: Use the token markers<br />
Unlike games like D&D4e, we’re not going to be tracking a lot of things like “marked by X, bloodied, 5 fire ongoing.” So that frees up the token markers. When combat starts, click on the tokens and select the markers option. The simply select a color for each initiative pass each character has at that time. This makes it easy to see how many passes a character has, and all we have to remember now is which pass we’re in.<br />
Setting up a Character Sheet<br />
<br />
You can automate some of the rolls in character sheets now, too. Just use @Attributes and Abilities. For example, a character with a Negotiation Dice Pool of 10 could have a Negotiation Attribute and linked Ability: <code>/r {(@{Negotiation} + ?{Modifier Total|0})d6}>5</code> which, when run, will ask the user for any modifiers to their roll and then pull the value of the Attribute (in this case 10), then roll the dice and display the result. Unfortunately, as with Macros, there does not seem to be a way to set whether to use edge (Exploding Dice (<code>!</code> modifier)) or not without using a second "copy" ability.<br />
<br />
That being said, here are some character sheet tips that my players and I find really useful.<br />
<br />
We create and manage our characters on Chummer (which is free and well-supported), then tell the program to print the character sheet as text. This displays a preview window, which we can copy and paste directly into the character sheet. This really helps when a player can’t make a session, as it means another player can float their character, which is why I always make the character appear and be controllable by players.<br />
<br />
You don’t have to export it as plain text of course - the character sheet also supports tables, so pick the format you like best and paste it in there.<br />
<br />
Once we’ve copied the information in, we create three Attributes - Physical, Stun and Init. Fill these in with your physical and stun track, and put your physical initiative in the Init field. You could also create a MagicInit or MatrixInit for characters that require them.<br />
<br />
<br />
Once we’ve filled out those fields we can automate the initiative by creating a new ability. Hit the add button and then the edit pencil and type /r @Init d6>5 + @Init. Then move the cursor to the space between Init and d6 and get rid of the space there. You should end up with this screen:<br />
<br />
<br />
You can test the macro by hitting the d20 button to the right of the initiative roll - once you’re happy it’s working, press the green tick.<br />
<br />
Before we save this character, we just need to scroll to the bottom and press duplicate. This saves a lot of time when we move on to our next character or NPC; paste in the new character sheet, drag a new portrait image in and alter the Physical, Stun and Initiative values. <br />
<br />
<br />
<br />
I like to have the character initiatives ready to go at the bottom of my screen, so on each character I tick the “show in Macro bar” box and make sure that “show macro in quick bar” is selected on the settings tab<br />
.<br />
<br />
<br />
It’s worth noting that these buttons only appear on my screen - players see only the macro buttons they choose to see (by selecting “show in macro bar” and “show macro in quick bar” as above) <br />
<br />
When you place a token on the map for the first time, remember to link it to the character sheet. That way the tokens will reflect the correct physical and stun values no matter what map you’re on. To do that, click on the token and press the cogwheel (1) or double click on the token. Then select the character sheet to link the token to (2) and select Physical for bar 1 and Stun for Bar 2 (3). Your character is now linked, and any changes you make to the physical or stun values will be tracked throughout the table.<br />
<br />
<br />
I recommend not linking trash NPCs to the sheet in this way; I’ve tried that in the past, and the result was that every time one biker took damage, the table thought that they all did.<br />
<br />
Some useful Macros<br />
<br />
Roll a regular Test<br />
[[(?{Ability|2}+?{Skill|2}-?{penilty|0})d6>5]]<br />
<br />
Roll a Test with edge<br />
[[{(?{Ability|2}+?{Skill|2}+?{Edge|2}-?{Penalties|0})d6!}>5]]<br />
<br />
Role a strait edge test<br />
[[{?{Edge|2}d6!}>5]]<br />
<br />
Initiative tests<br />
/em has a total initiative of [[?{Initiative}+{(?{Reaction|2}+?{Intuition|2}-?{Wound Penalties|0})d6}>5]]<br />
<br />
Initiative test with edge<br />
/em has a total initiative of [[?{Initiative}+{(?{Reaction|2}+?{Intuition|2}-?{Wound Penalties|0}+?{Edge|2})d6!}>5]]<br />
<br />
There! You’re now all set to play Shadowrun. Enjoy! And pay your fixers a finders fee, dangit!</div>243061https://wiki.roll20.net/Pathfinder_TipsPathfinder Tips2013-10-19T00:42:40Z<p>243061: </p>
<hr />
<div><br />
This guide only discusses how to play Pathfinder RPG with the Roll20 virtual tabletop. You can find all of the Pathfinder RPG rules (free!) on Paizo Publishing's [http://www.paizo.com/pathfinderRPG/prd/ Pathfinder Reference Document] (PRD) or if you also want 3rd party stuff gathered with the official, visit the [http://www.d20pfsrd.com D20pfsrd]. Of course, hardcover books are available from paizo.com or your friendly local game store. This guide is based on you knowing the basics of Roll20, so more focus can be given to the Pathfinder-specific parts.<br />
<br />
==Character Creation==<br />
The most relevant thing for players would be this section, even though GMs could make good use of what's in here, but GMs will get a special treatment with campaign creation and handling NPCs, monsters and handouts, in chapter 2 and 3.<br />
=== Setting up your [[Journal|Character Sheet]] for players ===<br />
There are several ways to set up the player character sheet. Most important is that the GM makes it available to the player. A good way for the GM is to have a general Player Character Sheet made already, and simply duplicate it, and give permissions as suited. Normally those would be that All Players can see, the relevant player can edit.<br />
<br />
Basically your entire Pen&Paper character sheet can be added in Roll20. The things you need to figure out as a GM when making the standard, is how much effort you (and your players) should do to make the character.Questions you can ask yourself to find out what you need on your character sheet and how detailed it should be:<br />
* Is it a one time campaign?<br />
* Will the campaign stretch over several levels?<br />
* Will you have the same players playing every time?<br />
* Are the characters supposed to be low or high level?<br />
<br />
<br />
If it's only a one-shot campaign, you might not need such elaborate character sheets. The basics would probably suffice, with Ability modifiers, HP, AC, maybe even Base Attack Bonus. The corresponding macros usually aren't that complex either, but they would still be time-saving.<br />
If, on the other hand, you're going to take your normal Pathfinder-group online, and keep on playing, level after level, hour after hour, getting the Character Sheet right, already at start, is extremely time-saving.<br />
<br />
==== Example Inline stat roll ====<br />
For those of you who's DM/GM asks them to roll their starting stats. Here is a Inline 4d6 keep the highest 3<br />
'''Roll''': <pre>/me rolls for starting stats [[4d6k3]][[4d6k3]][[4d6k3]][[4d6k3]][[4d6k3]][[4d6k3]]</pre><br />
<br />
==== Example of a Character Sheet on a oneshot campaign ====<br />
I'd encourage getting a picture for your character. The "Bio & Info"-box would probably be filled up with some statistics, like To hit, saves, weapons/spells/Spell-like abilities and so on.<br />
Even in a oneshot campaign, you'd probably like to add some macros, to shorten waiting time, and maximizing the gaming time you have. You'd like to add at least these Attributes: HP, AC. These will be linked to your token, so that they are quick to check and to edit. You should also add your basic attack, and a full attack, if there's any difference. For tips on creating the macros, see the example of abilities further down the page. You'd probably not make them that much of a work, but simply:<br />
'''Attack''': <pre>/r 1d20+6 vs AC<br />
/r 1d10+4</pre><br />
'''Ray of Frost''':<pre>/r 1d20+4 vs Touch AC, ranged touch<br />
/r 1d20+2 vs Spell Resistance (if applicable)<br />
/r 1d3 cold damage</pre><br />
And maybe you'd like to put some energy into it and add the Abilities you need in the Attributes tab, as Strength 4, and Dexterity +2, BAB +2, just to be able to get the reasoning behind the numbers.<br />
But basically you'd want it stripped down to what you need, even though there's not much work to do it in a decent and good way, which we will look at now:<br />
<br />
==== Example of a Character Sheet going for the long run ====<br />
<br />
You would probably find (or create) a nice picture for your Character, type in some bio that you have planned, and start with the automation on the "Attributes & Abilities"-tab. In this case you might not need to have many stats (if any) in the "Bio & Info", as you can add all those on your "Attributes & Abilities" tab, even the languages and all, if you'd like.<br />
<br />
The list of Attributes could look like this:<br />
<br />
<pre>HP 26/26<br />
AC 18<br />
Level 3<br />
High Save 3<br />
Low Save 1<br />
Base Attack Bonus 3<br />
Strength 2/15<br />
Dexterity 1/12<br />
Constitution 0/11<br />
Intelligence -1/9<br />
Wisdom 1/13<br />
Charisma -2/7<br />
Longsword 1d8<br />
Weapon Focus (Longsword) 1<br />
Weapon Specialization (Longsword) 2<br />
Masterwork +1<br />
Shortsword 1d6<br />
Magic Enhancement +1<br />
Lightning Damage 1d6<br />
Two Weapon Fighting -2<br />
Ring of Protection +1<br />
Breastplate AC +6<br />
Breastplate Check Penalty -4</pre><br />
<br />
Notes:<br />
*The Ability scores are written "backwards" because it's the modifier which is used, and not the score. This way you can keep track of the score (when it gets modified) while the modifier is used.<br />
*Normally a Fighter would simply use Level instead of Base Attack Bonus, and not need this at all, but since this is an example this is added, so it's easier to switch to other classes.<br />
*If there's planned multiclassing, it might be easier to simply use Fortitude, Reflex and Will than High and Low Save.<br />
*Instead of "Longsword" and "Shortsword," you might consider using "Weapon," as it's easier to change the weapon in the macros - unless you do like this guy and go all in on longsword, which means he will probably use this weapon forever. Pro tip: Use "Weapon 1," "Weapon 2" and such, and keep on the Bio (or in the macro) which weapon is which.<br />
*It's practical to have the stuff that changes in the top. So if you've created them in another order, simply drag the ones you change most often to the top by hovering the abilities you want to move, and drag the three lines that pop up in the right end, to where you want them.<br />
<br />
=== Setting up Macros in Abilities ===<br />
<br />
There are two ways of saving macros in Roll20, both of which can be very useful in your session. Normal macros found under [[My Settings]] is mainly used by players, and only to give the abilities a shorter name in the [[macro quick bar]]. But mainly both players and GMs should stick to using [[Abilities]] on the [[Character Sheet]]. When using [[abilities]] together with [[attributes]], you get a quick way of doing "everything" with your character.<br />
<br />
With the Character Sheet above us, we can make the player really effective, and we don't need to wait for the slow calculation of adding it all up. We will use the "Character for the Long run" onwards to the example of Abilities, and also some new ones.<br />
====Example of Abilities====<br />
<br />
=====Attacking=====<br />
You can add short macros, like a '''basic attack''', and if you'd like, you can even add some flavour text by using the /me-function into the macro, which will make a orange text box describing what you do. You should add your character name as the person you talk to in the drop down menu below your chat, to make this more useful.<br />
<pre>/me swings his Long Sword at the enemy, trying to hit him hard!<br />
/r 1d20+@{Base Attack Bonus} +@{Strength} +@{Weapon Focus (Long Sword)} +@{Masterwork} vs. AC To hit with Long Sword. Critical: 19-20x2 <br />
/r @{Long Sword}+ @{Strength} +@{Weapon Specialization (Long Sword)}</pre><br />
<br />
<br />
You can also add your whole '''Full Attack''' in one "simple" macro.<br />
<pre>/me does a mighty strike with his Long Sword, and his glowing Shortsword!<br />
/r 1d20+@{Base Attack Bonus} +@{Strength} +@{Weapon Focus (Longsword)} +@{Masterwork} +@{Two Weapon Fighting} vs. AC To hit with longsword. Critical: 19-20x2 <br />
/r @{Longsword}+ @{Strength} +@{Weapon Specialization (Longsword)} Damage with longsword.<br />
/r 1d20+@{Base Attack Bonus} +@{Strength} +{Magic Enhancement} vs. AC To hit with the shortsword. Critical: 19-20x2<br />
/r @{Shortsword} +@{Strength}/2 +@{Lightning Damage} +{Magic Enhancement} Damage with shortsword.</pre><br />
<br />
<br />
This gives you the two hits, both damages if they are hits, and everything with no math involved. Note that if you didn't use Base Attack Bonus on your character sheet, use level instead of base attack bonus, like this: /r 1d20+@{Level}+@{Strength}.... Another strength of this way of doing it, is that every time you wonder how you got to that number, you can simply check everything in the macro, and it's easy to remove and add effects and modifiers for later time. Say to get the Long Sword enchanted, simply remove Masterwork and add the Magic Enchantment Bonus.<br />
<br />
You can also use the Abilities for way more than just "simple" attacks.<br />
<br />
<br />
'''Casting Spells''' could be more than just "I cast Obscuring mist", maybe like this:<br />
<pre>/me mumbles on Arcana, claps his hands together, and a thick obscuring mist quickly spreads out from him in 20. ft radius.<br />
A misty vapor arises around you. It is stationary. The vapor obscures all sight, including darkvision, beyond 5 feet. A creature 5 feet away has concealment (attacks have a 20% miss chance). Creatures farther away have total concealment (50% miss chance, and the attacker cannot use sight to locate the target).<br />
A moderate wind (11+ mph), such as from a gust of wind spell, disperses the fog in 4 rounds. A strong wind (21+ mph) disperses the fog in 1 round. A fireball, flame strike, or similar spell burns away the fog in the explosive or fiery spell's area. A wall of fire burns away the fog in the area into which it deals damage.</pre><br />
<br />
Casting '''Offensive Spells''' would do everything at once:<br />
<pre>/me takes some fur and two glass figurines out of my pouch, rub them together while rambeling on Arcana, and suddenly a great lightning arc reaches out of the figurine and lashes out to two creatures of my desire, and hits everyone in between.<br />
/r 1d20+@{Level} Spell Resistance applies.<br />
/r @{Level}d6 (Maximum 15d6) electricity damage done, reflex save for half damage. <br />
Good to know: The spell fails if there is no line of effect between the targets. Lightning arc sets fire to combustibles and damages objects in its path. It can melt metals that have a low melting point, such as lead, gold, copper, silver, or bronze.</pre><br />
This one would make you change the formula for damage on either level 15 or 16 to simply 15d6 instead of @{Level}d6.<br />
<br />
<br />
'''Grapple''' might be usefull to have all the rules added:<br />
<pre>/me tries to grapple his opponent as best he can.<br />
/r 1d20+ @{Base Attack Bonus} + @{Strength} vs CMD.<br />
When grappled does not break the grapple in the first round, the grappler gain a +5 circumstance bonus.<br />
Grappled Condition<br />
A grappled creature is restrained by a creature, trap, or effect. Grappled creatures cannot move and take a –4 penalty to Dexterity. A grappled creature takes a –2 penalty on all attack rolls and combat maneuver checks, except those made to grapple or escape a grapple. In addition, grappled creatures can take no action that requires two hands to perform. A grappled character who attempts to cast a spell or use a spell-like ability must make a concentration check (DC 10 + grappler's CMB + spell level), or lose the spell. Grappled creatures cannot make attacks of opportunity.<br />
A grappled creature cannot use Stealth to hide from the creature grappling it, even if a special ability, such as hide in plain sight, would normally allow it to do so. If a grappled creature becomes invisible, through a spell or other ability, it gains a +2 circumstance bonus on its CMD to avoid being grappled, but receives no other benefit.<br />
Casting Spells while Grappled/Grappling: The only spells which can be cast while grappling or pinned are those without somatic components and whose material components (if any) you have in hand. Even so, you must make a concentration check (DC 10 + the grappler's CMB + the level of the spell you're casting) or lose the spell.*Pinned Condition<br />
A pinned creature is tightly bound and can take few actions. A pinned creature cannot move and is denied its Dexterity bonus. A pinned character also takes an additional –4 penalty to his Armor Class. A pinned creature is limited in the actions that it can take. A pinned creature can always attempt to free itself, usually through a combat maneuver check or Escape Artist check. A pinned creature can take verbal and mental actions, but cannot cast any spells that require a somatic or material component. A pinned character who attempts to cast a spell or use a spell-like ability must make a concentration check (DC 10 + grappler's CMB + spell level) or lose the spell. Pinned is a more severe version of grappled, and their effects do not stack.<br />
Casting Spells while Pinned: The only spells which can be cast while grappling or pinned are those without somatic components and whose material components (if any) you have in hand. Even so, you must make a concentration check (DC 10 + the grappler's CMB + the level of the spell you're casting) or lose the spell.</pre><br />
<br />
This way you get everything in one place. Maybe you want to make one Macro only for the Grapple rules, or maybe you'd like it better if the GM simply had a Handout with the basics and included a link?<br />
<br />
=====Misc Combatmacros=====<br />
<br />
'''Initiative''' is used rather often, and even if it's a short /r 1d20+3, it might be quicker to have it ready in your macro-bar:<br />
<pre>/me throws himself into the battle, as soon as he figures there's gonna be a fight!<br />
/r 1d20 + @{Dexterity} Initiative</pre><br />
<br />
<br />
There's also a lot of '''Skill checks''', and some of them might be good to have in a quick click, and maybe even some quick reminders:<br />
<pre>/me is making a jump.<br />
/r 1d20+@{Dexterity} +@{Level} +3 -@{Breast Plate Check Penalty} <br />
You can jump your jump score in feet long, and one fourth of the jump score high.</pre><br />
<br />
<br />
A good idea is often to have a macro '''throwing saves''', and remembering all the effects that we so often forget:<br />
<pre>/r 1d20+@{High Save} +@{Constitution} Fortitude Save<br />
Remember +2 vs poisons and sleep effects </pre><br />
<br />
=====Practical macros=====<br />
You could also do information-macros, to get '''all''' your character sheet on the "Attributes and abilities"-tab.<br />
<br />
<br />
Maybe you'd even want a macro '''checking the AC''', to see why your AC is what it is, or if you have forgotten to update it:<br />
<pre>/me simply checks his AC<br />
/r 1d1-1 + 10 + @{Dexterity} +@{Ring of Protection} +@{Breast Plate AC}</pre><br />
<br />
<br />
Having the languages in handy could be good too, which many would simply put in the Bio&Info-box:<pre>/me knows common, elven and dwarven.</pre><br />
<br />
You could even do creative ones that you normally don't do in-game, like reminding you what to do when '''leveling up''':<br />
<pre>/me has DINGed! DINGDINGDING!<br />
/r 1d10+@{Constitution} <br />
http://www.d20pfsrd.com/classes/character-advancement<br />
http://www.d20pfsrd.com/classes/core-classes/fighter<br />
Checklist: HP (Check),Level, Favored Class Bonus, Skill Ranks, BAB, Saving Throws, Feats, Class Features, Spells, Consequnses of these changes that doesn't go with the sheet, (extra language for upped in Int, and such).</pre><br />
<br />
<br />
Here's even some '''Messages''' you use often or often enough (as you can have as many as you could ever want):<br />
<pre>/w gm Hi, I'll be gone for about 5 min, BRB.</pre><br />
<pre>/w gm Going to the Bathroom ASAP.</pre>These two going to the GM only (Whisper to GM)<br />
<pre>/ooc Time to take have something to eat, can we take a break, guys?</pre><br />
This one using the function to talk OutOfCharacter, using your username on the account instead of the selected character name you've selected in the dropdown menu.<br />
<br />
Basically only the imagination stops you on how to use the macros efficiently. Please '''feel free to add new kinds of macros''', don't be afraid.<br />
<br />
=====Suggested GM macros=====<br />
There are times that a GM needs to make secret rolls that reference his players characters.<br />
<br />
For example, maybe you want to roll Perception checks for the entire party without having to tip them off by asking for their Perception modifier.<pre>/w gm Char 1: [[d20+@{Char 1's Name|Perception}]], Char 2: [[d20+@{Char 2's Name|Perception}]], etc...</pre>Just make sure all of your players have an attribute named "Perception".<br />
<br />
==Campaign Creation in Roll20==<br />
From now on, players won't find anything useful, there's no need for players to read on. GMs on the other hand. This is where it gets started.Creating a campaign is so incredibly diverse from GM to GM, and they range from creating everything on the run, while playing, to using months upon months to prepare a grand campaign setting, ment to last for several campaigns, sessions, groups and whatever you can prepare. On this Wiki, we will not go into plots and the history of the campaign, as much as building the actual maps and what you can do on Roll20. Maybe plots and history can come on a later point.<br />
===Creating a city===<br />
There's several ways to get this done. You can use map editors online, a dedicated app, find images online, or create your own within Roll20. There's lots of art both reachable by the Art Library, which will help you make the city nice and usable. Normally this kind of map would be either a map, or simply a concept picture, depending on how much work you'd like to do. This map should not be so detailed, that it can be used as a battlemap. What you'd like to do, is to make an overview map, and then make your own pages with the specific places you want.<br />
<br />
<br />
As mentioned, there's a whole lot of ways to make these maps. Some may simply use the [[drawing tools]] and make basic maps (or even some complex ones). This way you get total control on how you want it, and the only limitations you have, are your drawing skills and patience.<br />
<br />
<br />
A faster way, but more limiting way, is to use some of the online tools that's made for this kind of work. They will give you different forms of freedom, but some really great tools are out there.<br />
<br />
<br />
An even faster way, but even more limiting, would be to use the Art Library, but still here, you should be able to make some really fantastic maps, but the Art Library shines at its best on encounter-maps, not citymaps and overland maps.<br />
<br />
<br />
The definitely fastest way to get city maps, and no doubt the most restricting way, would be to simply search the net. There's a whole lot of very good maps all over the internet.<br />
<br />
<br />
====Adding detail to your city====<br />
You can add much detail to your city, to get some good preparations done. You can use the GM Layer actively, to get control on what is where. What's the name of the inns? Put them in the GM Layer on the map with the text-tool. When the players gets to know these names, simply turn to the GM Layer, and mark them, right click, and choose layer, and send it back to the map layer. This can be done with main NPCs, maybe the smith in the city, and so on. Marking where these are, and what is where, gives good consistency when playing. And it's equally easy to make things you figure out on the fly, to actually be consistent.Example: Player: "What's the name of the blacksmith?"... Pause... GM: "Emmm... Wilbur... Greatsword?". Now you simply add a text on the map where they are, with: "Blacksmith: Wilbur Greatsword". Now the players, and you, will remember where he lives and what his name was. If you were prepared for this in front of the question, you simply move the text "Blacksmith: Wilbur Greatsword" to the map layer, so that everyone can see it.<br />
<br />
====Making encounter maps in your city====<br />
For encounter maps in your city, you need individual pages. It's probably a good idea to make some general ones, in addition to the specific ones. You never know what the players will do, and the best way to prepare for this, is to make generic maps. A generic house, would be high priority. When you are done with what you consider a generic house, a good tips would be to add some extra squares at the side of the map, which will be covered in fog of war. Here you can add a bunch of townsfolk tokens, to be prepared. Whenever your players decide to go into a random house you haven't made a specific map of, you open your generic house page, move some tokens to fill up the desired places, and then you move the players over to the page, and be ready. Also here you should not be afraid to name the token, mark the house and name on your city map with ie. "Smiles Family", and copy the token, so that you can also keep consistency on which tokens used.<br />
<br />
====Some tips on what could be made in an open city-campaign====<br />
<br />
There's much you want to do, and as already said, there's many ways of doing it. Maybe only a concept picture is what you want, and that is it, maybe only a picture of the relevant character. Or maybe you want a grand, very detailed map on every possible solution the players may find. Most of these will be great to have in case of encounters, and with that you should consider making them like encounter maps, which is a pretty quick job using only the Art Library of Roll20. So here's a list on sites you should be prepared to show your players, if you don't want to just talk them through it, without anything to show (like you probably would have done when playing around a table anyhow). Several of these might not even be present in the city, or simply off limits for your players. You might consider having several different types too, if you really want to do a lot of work.<br />
<br />
*General house<br />
*House that can be used for different kinds of work, like shoemaking, bookwriting, carpenting, pottering, stonemasoning and so on.<br />
*Tavern<br />
*Blacksmith<br />
*Marketplace<br />
*Inn<br />
*General street (ie. for random encounters)<br />
*Nearby farm<br />
*Magic Shop<br />
<br />
===Creating encounter maps in Roll20===<br />
<br />
A lot from the citycreation is also true here, but there's one special difference. Using the Art Library is way faster and usually it gives you great diversity and options. It's clear that this is the major intention of Roll20 mapmaking. <br />
There are some good tips on how to make encounter maps. For instance, if you're going to make a map over several floors, it might be a good idea to make them all on one page. This is because of the limitation of Roll20, where you need to have everyone in the same window. This means that if someone is on 2nd floor and someone in the 1st floor, you will have no problem with your players splitting the party within a building/dungeon/etc. To do this, you simply make your starting floor, and then expand the page size to right or down, accordingly, so you can start fresh again.<br />
<br />
'''Protip''': If you're going to make ie. an enormous inn, you should make the ground level on the map layer, then mark the whole level, and copy it. Scroll down/right, and paste it. Another tips then, is to zoom out with the zoom-tool, and maybe even expand the page size more than nesessary, to make it fit when you paste it. The pasting may take some time, depending on how much you copy. Also, you need to mark everything again to move it all. Before moving it, you should make sure it's all marked as drawing, so it doesn't get disorted by snapping to grid. If you're now going to make 4th and 5th floor the same, you should make it on the token or GM layer, and then mark it when you are done with one level, adding all the walls and the rest which will be the same, and copy/paste. When you have made everything match up like you want, you mark everyting on your level, and send it back to map layer. PS: For subscribers, this also works on dynamic lighting-layer.<br />
<br />
====List of encounter maps that would be useful in most open campaigns====<br />
As a GM you never know when and how your players will end up in an encounter, and thus having some premade generic battlescenes might be a good idea. Here are some suggestions on what you can make to be a little bit prepared, even though, as the last list, some of these might not even be possible to reach in your specific campaign. A good way to keep them more usable, is to not have a road on them, but laying a road "outside" the map, behind fog of war. This way you can use them and add the road if needed in just a matter of seconds, and you can lay it as you want for the situation. Also, making them big enough so that the map size won't hinder the players could be a good idea.<br />
<br />
*Forest (fill it up with trees, you can delete them for road quickly)<br />
*Small cave, with outside<br />
*Nearby a body of lake<br />
*Harbour<br />
*Marketplace<br />
*Farm<br />
*Small gathering of houses<br />
*Open landscape (Desert, hill, grass)*Mountain pass<br />
*River (Keep bridge as with road, on the side of the map, and try giving good space on both sides of the river)<br />
<br />
==NPCs, monsters, handouts and organizing==<br />
<br />
So this is about the Journal, which makes being a GM so much easier. It's also great for the players to keep info, and for you to have secret notes on characters. The ability to show to only some characters can be greatly benefitted, and you can make finding monsters and creating a random encounter very quickly (especially if you already have done some of the generic maps already), because of the saved token on the characters. Just a warning, it will probably fill up pretty fast with NPCs, monsters, handouts and whatever else you find use for the journal, it is strongly recommended to find a system for tagging already from start. Tips can be tagging by race, class, location. Example; [Human bartender, Minestown]. [Dwarf, fighter, silvermineroom3]. [Wolf, encounter3, forest, encounter6, encounter8]You can also match several tags to organize better: [enc1, cave2] [enc7, sewers1] [enc1, sewers1] [enc2, cave2] [enc3, forest1, cave1] [enc2, cave3, forest1]The search for tags is pretty smart, so in the last case, when you type [1 2] into the search field, you will get only the ones with both numbers, in this case, only [enc1, cave2] and [enc2, cave3, forest1]. You can type [enc1 for] and get only the ones that are tagged with both forest and encounter 1. This way you have a mighty organizing tool, if you just make sure you use it from the start. The search also automatically searches the names of your journal entries.<br />
<br />
===NPCs===<br />
Making a NPC in the journal, is almost like making a player character, but generally you'd like to be quicker. You should have a template you can easily duplicate, so that you have basic general attributes and abilities finished as soon as you put in the needed numbers. The best about making quick NPCs, is that Paizo has released a book on them. With that follows that they are also easily found on [http://www.d20pfsrd.com/bestiary/npc-s D20pfsrd] and in the [http://paizo.com/pathfinderRPG/prd/npcCodex/appendix.html PRD]. You might want to link them on your character sheet, or simply copy what's there. You still want to make a basic character, though. Add attributes like HP and AC at least. If you often choose to advance your NPCs/monsters, you should also add the changing statististics to put in macros, like ability scores, to hit and saves. Often you will benefit from having stats like perception, sense motive and attack easily at hand. This would be easily done with macros. This way you don't have to search, type and add every time you are about to use them. And if you have created some NPCs, you can always simply copy them, and link them to a new name. If you have a generic bartender, or even a generic commoner level 1, you can quickly copy it and rename it, so that you can link your newfound token to it. This helps on consistency and make it very quick to engage an unprepared battle.<br />
Personally I'd recommend to use at least HP, AC, the ability modifiers, BAB, low and high base save (most NPC aren't multiclassed),as well as macros like attack including to hit and damage, use /gmroll to gather all saves in one macro (here you would need to manually add which ones have high and low saves as base, each time you create a new NPC), initiative and maybe even perception/sense motive. But with premade attributes, the macros will do them selves, except from saves, as soon as you put in all the numbers on the attributes.<br />
<br />
Some NPCs you'd want your players to be able to write notes on. If you give the players edit permission on the character sheets you've created, they also get to see all their attributes and abilities, so you might consider to put NPCs that the players are interessted in, in a handout. Then you can add the Bio & Info in the text and copy the picture, and allow the characters to edit the handout. <br />
<br />
===Monsters===<br />
Monsters is very much like the NPCs, and they are also easily found on [http://www.d20pfsrd.com/bestiary D20pfsrd] and the [[http://www.paizo.com/pathfinderRPG/prd/ PRD]. And they are also often easier to control, as you yourself decide what lives in the nearby aera, and in that case also need only to prepare those you know are present. As with NPCs, you'd like to have HP and AC, at least, in the attributes, and a text on the bio or GM notes, so that you can keep all the intricate intel there. But often it's a good idea to add macros to the monsters, both so you learn them better, and to make the interactions quicker. It also makes you remember their qualities better, since they are on the list.<br />
Having the monsters ready will also make you search less when you get into an encounter. Since you just need to find them by search, and drag the entries in the list over to the map, if you have prepared a token on the character sheet,m which you should when you create the monster.<br />
<br />
===Handouts===<br />
Handouts on the other hand, stand out from the others. This is when you want to give your players some intel, and often want to push it to them. This can on the other hand be different from only: "You find a note, here". It could as well be a concept picture of a bar, a picture of a challenge, to make everyone visualize the same thing. It might also be a plain text, that you want to show them, and they will always be able to find back (as you give them permission to watch). It may be loot, which when the players have decided who shall have it, you can give permission to that player only. The strenght of handouts would be the ability to push it into the face of the players, and the ability to delegate permission on it. If any players doesn't have permission to see (or edit) the handout when you show to players, they won't see it either.<br />
<br />
===Player and Campaign Organizing===<br />
There's also other ways to use the handouts. In example you can make a handout called "Player Equipment", with players always allowed to see and edit. This would then serve as equipment the players share, and they might also add their personal gear there, labeled, but often it's easier to have personal gear on their own character sheet. You should also consider a "Player Journal"-handout in the same manner, where the players (or you) can summerize each session.<br />
You might also want to build your campaign into the handouts, so that you don't need to sit and switch to a PDF or whatever you use, all the time. This can be done in one gigantic handout or spread across like you want it. With many parts, tags would also be equally imortant here, as in all the other cases mentioned.<br />
<br />
[[Category:Guides]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T05:45:12Z<p>243061: /* Roll Modifiers */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: <pre>/roll 1d20+5 to hit</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: <pre>/roll 1d8+1+2d6 Damage with Sneak Attack</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: <pre>/gmroll 1d100</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
''*The above box will be Yellow in roll20''<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: <pre>/roll 1d20+5 Roll for Initiative</pre><br />
<br />
What you see in the chat:<br />
<br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: <pre>/roll 2d10+2d6[crit]+5 Critical Hit!</pre><br />
<br />
What you see in the chat:<br />
<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box around it. If there's a crit failure, it's highlighting in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<br />
<br />
Type in:<br />
<pre>/em is filled with [[3d6]] points of anger!</pre><br />
<br />
<div class="diceroller">'''THE GM''' is filled with <code>13</code> points of anger!</div><br />
''*the above box will be orange instead of blue in roll20''<br /><br />
<br />
<br />
Type in:<br />
<pre>/roll [[2d6]]d6</pre><br />
<br />
<div class="diceroller">'''THE GM''' <code>rolling |'''5'''|d6</code><br /><br />
<br />
<code>( '''<big>1</big>''' + '''<big>4</big>''' + '''<big>3</big>''' + '''<big>2</big>''' + '''<big>1</big>''' )</code><br /><br />
=<code><big>'''11'''</big></code></div><br />
''*instead of the |5| the number will be the returned value of the dice in the <code>[[]]</code> number in a yellow box. If you hover over the box it will show the roll''<br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. <br /><br /><br />
<br />
Type in:<br /><br />
<pre>?{TEXT DISPLAYED}</pre><br />
<br />
If the above command is entered in the roll20 chat a query box will appear with "TEXT DISPLAYED" in it, asking for an input. Any thing typed in to the following box will be returned threw the roll20 chat.<br /><br />
''*If you type another command it will execute it threw the chat in lue of text. (/roll 1d20 will roll a die, /me will emote...etc)''<br /><br />
<br />
Type in:<br /><br />
<pre>/roll ?{NUMBER OF DICE|5}d20</pre><br />
<br />
As above a query box appears requesting "NUMBER OF DICE". The return box will already have the number following the <code>|</code> inputed as the default number, in this case 5. The number returned will be the number of dice rolled<br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3. <br />
<br />
Type in:<br />
<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
Will return<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 5+3</code><br /><br />
<code> 5+3</code><br /><br />
=<code>8</code></div><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<pre>/roll 4d6!</pre><br />
<div class="diceroller"><code>rolling 4d6!</code><br /><br />
<code>('''<big>6</big>'''+<big>1</big>+<big>1</big>+'''<big>6</big>'''+<big>3</big>+<big>5</big>)</code><br /><br />
=<code>'''<big>22</big>'''</code></div><br />
<br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll five d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<pre>/roll {5d6!!}>8 </pre><br />
<div class="diceroller"><code>rolling {4d6!!}>8</code><br /><br />
<code>{(<big>2</big>+<big>'''9'''</big>+<big>3</big>+<big>'''8'''</big>)}</code><br /><br />
=<code>'''<big>2 Successes</big>'''</code></div><br />
<br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a <code>p</code> after the exclamation mark. So for example to roll five d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<pre>/roll 5d6!p<br />
</pre><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<pre>/roll {5d6}>5 </pre><br />
<div class="diceroller"><code>rolling {4d6!!}>8</code><br /><br />
<code>{(<big>3</big>+<big>'''5'''</big>+<big>3</big>+<big>'''6'''</big>)}</code><br /><br />
=<code>'''<big>2 Successes</big>'''</code></div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>=3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T05:38:40Z<p>243061: /* Target Number (Successes) */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: <pre>/roll 1d20+5 to hit</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: <pre>/roll 1d8+1+2d6 Damage with Sneak Attack</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: <pre>/gmroll 1d100</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
''*The above box will be Yellow in roll20''<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: <pre>/roll 1d20+5 Roll for Initiative</pre><br />
<br />
What you see in the chat:<br />
<br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: <pre>/roll 2d10+2d6[crit]+5 Critical Hit!</pre><br />
<br />
What you see in the chat:<br />
<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box around it. If there's a crit failure, it's highlighting in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<br />
<br />
Type in:<br />
<pre>/em is filled with [[3d6]] points of anger!</pre><br />
<br />
<div class="diceroller">'''THE GM''' is filled with <code>13</code> points of anger!</div><br />
''*the above box will be orange instead of blue in roll20''<br /><br />
<br />
<br />
Type in:<br />
<pre>/roll [[2d6]]d6</pre><br />
<br />
<div class="diceroller">'''THE GM''' <code>rolling |'''5'''|d6</code><br /><br />
<br />
<code>( '''<big>1</big>''' + '''<big>4</big>''' + '''<big>3</big>''' + '''<big>2</big>''' + '''<big>1</big>''' )</code><br /><br />
=<code><big>'''11'''</big></code></div><br />
''*instead of the |5| the number will be the returned value of the dice in the <code>[[]]</code> number in a yellow box. If you hover over the box it will show the roll''<br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. <br /><br /><br />
<br />
Type in:<br /><br />
<pre>?{TEXT DISPLAYED}</pre><br />
<br />
If the above command is entered in the roll20 chat a query box will appear with "TEXT DISPLAYED" in it, asking for an input. Any thing typed in to the following box will be returned threw the roll20 chat.<br /><br />
''*If you type another command it will execute it threw the chat in lue of text. (/roll 1d20 will roll a die, /me will emote...etc)''<br /><br />
<br />
Type in:<br /><br />
<pre>/roll ?{NUMBER OF DICE|5}d20</pre><br />
<br />
As above a query box appears requesting "NUMBER OF DICE". The return box will already have the number following the <code>|</code> inputed as the default number, in this case 5. The number returned will be the number of dice rolled<br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3. <br />
<br />
Type in:<br />
<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
Will return<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 5+3</code><br /><br />
<code> 5+3</code><br /><br />
=<code>8</code></div><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<pre>/roll 4d6!</pre><br />
<div class="diceroller"><code>rolling 4d6!</code><br /><br />
<code>('''<big>6</big>'''+<big>1</big>+<big>1</big>+'''<big>6</big>'''+<big>3</big>+<big>5</big>)</code><br /><br />
=<code>'''<big>22</big>'''</code></div><br />
<br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll five d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<pre>/roll {5d6!!}>8 </pre><br />
<div class="diceroller"><code>rolling {4d6!!}>8</code><br /><br />
<code>{(<big>2</big>+<big>'''9'''</big>+<big>3</big>+<big>'''8'''</big>)}</code><br /><br />
=<code>'''<big>2 Successes</big>'''</code></div><br />
<br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a <code>p</code> after the exclamation mark. So for example to roll five d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<pre>/roll 5d6!p<br />
</pre><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<pre>/roll {5d6}>5 </pre><br />
<div class="diceroller"><code>rolling {4d6!!}>8</code><br /><br />
<code>{(<big>3</big>+<big>'''5'''</big>+<big>3</big>+<big>'''6'''</big>)}</code><br /><br />
=<code>'''<big>2 Successes</big>'''</code></div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T05:36:20Z<p>243061: /* Exploding Dice */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: <pre>/roll 1d20+5 to hit</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: <pre>/roll 1d8+1+2d6 Damage with Sneak Attack</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: <pre>/gmroll 1d100</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
''*The above box will be Yellow in roll20''<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: <pre>/roll 1d20+5 Roll for Initiative</pre><br />
<br />
What you see in the chat:<br />
<br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: <pre>/roll 2d10+2d6[crit]+5 Critical Hit!</pre><br />
<br />
What you see in the chat:<br />
<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box around it. If there's a crit failure, it's highlighting in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<br />
<br />
Type in:<br />
<pre>/em is filled with [[3d6]] points of anger!</pre><br />
<br />
<div class="diceroller">'''THE GM''' is filled with <code>13</code> points of anger!</div><br />
''*the above box will be orange instead of blue in roll20''<br /><br />
<br />
<br />
Type in:<br />
<pre>/roll [[2d6]]d6</pre><br />
<br />
<div class="diceroller">'''THE GM''' <code>rolling |'''5'''|d6</code><br /><br />
<br />
<code>( '''<big>1</big>''' + '''<big>4</big>''' + '''<big>3</big>''' + '''<big>2</big>''' + '''<big>1</big>''' )</code><br /><br />
=<code><big>'''11'''</big></code></div><br />
''*instead of the |5| the number will be the returned value of the dice in the <code>[[]]</code> number in a yellow box. If you hover over the box it will show the roll''<br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. <br /><br /><br />
<br />
Type in:<br /><br />
<pre>?{TEXT DISPLAYED}</pre><br />
<br />
If the above command is entered in the roll20 chat a query box will appear with "TEXT DISPLAYED" in it, asking for an input. Any thing typed in to the following box will be returned threw the roll20 chat.<br /><br />
''*If you type another command it will execute it threw the chat in lue of text. (/roll 1d20 will roll a die, /me will emote...etc)''<br /><br />
<br />
Type in:<br /><br />
<pre>/roll ?{NUMBER OF DICE|5}d20</pre><br />
<br />
As above a query box appears requesting "NUMBER OF DICE". The return box will already have the number following the <code>|</code> inputed as the default number, in this case 5. The number returned will be the number of dice rolled<br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3. <br />
<br />
Type in:<br />
<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
Will return<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 5+3</code><br /><br />
<code> 5+3</code><br /><br />
=<code>8</code></div><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<pre>/roll 4d6!</pre><br />
<div class="diceroller"><code>rolling 4d6!</code><br /><br />
<code>('''<big>6</big>'''+<big>1</big>+<big>1</big>+'''<big>6</big>'''+<big>3</big>+<big>5</big>)</code><br /><br />
=<code>'''<big>22</big>'''</code></div><br />
<br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll five d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<pre>/roll {5d6!!}>8 </pre><br />
<div class="diceroller"><code>rolling {4d6!!}>8</code><br /><br />
<code>{(<big>2</big>+<big>'''9'''</big>+<big>3</big>+<big>'''8'''</big>)}</code><br /><br />
=<code>'''<big>2 Successes</big>'''</code></div><br />
<br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a <code>p</code> after the exclamation mark. So for example to roll five d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<pre>/roll 5d6!p<br />
</pre><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T05:19:45Z<p>243061: /* Math-Only Rolls */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: <pre>/roll 1d20+5 to hit</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: <pre>/roll 1d8+1+2d6 Damage with Sneak Attack</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: <pre>/gmroll 1d100</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
''*The above box will be Yellow in roll20''<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: <pre>/roll 1d20+5 Roll for Initiative</pre><br />
<br />
What you see in the chat:<br />
<br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: <pre>/roll 2d10+2d6[crit]+5 Critical Hit!</pre><br />
<br />
What you see in the chat:<br />
<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box around it. If there's a crit failure, it's highlighting in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<br />
<br />
Type in:<br />
<pre>/em is filled with [[3d6]] points of anger!</pre><br />
<br />
<div class="diceroller">'''THE GM''' is filled with <code>13</code> points of anger!</div><br />
''*the above box will be orange instead of blue in roll20''<br /><br />
<br />
<br />
Type in:<br />
<pre>/roll [[2d6]]d6</pre><br />
<br />
<div class="diceroller">'''THE GM''' <code>rolling |'''5'''|d6</code><br /><br />
<br />
<code>( '''<big>1</big>''' + '''<big>4</big>''' + '''<big>3</big>''' + '''<big>2</big>''' + '''<big>1</big>''' )</code><br /><br />
=<code><big>'''11'''</big></code></div><br />
''*instead of the |5| the number will be the returned value of the dice in the <code>[[]]</code> number in a yellow box. If you hover over the box it will show the roll''<br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. <br /><br /><br />
<br />
Type in:<br /><br />
<pre>?{TEXT DISPLAYED}</pre><br />
<br />
If the above command is entered in the roll20 chat a query box will appear with "TEXT DISPLAYED" in it, asking for an input. Any thing typed in to the following box will be returned threw the roll20 chat.<br /><br />
''*If you type another command it will execute it threw the chat in lue of text. (/roll 1d20 will roll a die, /me will emote...etc)''<br /><br />
<br />
Type in:<br /><br />
<pre>/roll ?{NUMBER OF DICE|5}d20</pre><br />
<br />
As above a query box appears requesting "NUMBER OF DICE". The return box will already have the number following the <code>|</code> inputed as the default number, in this case 5. The number returned will be the number of dice rolled<br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3. <br />
<br />
Type in:<br />
<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
Will return<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 5+3</code><br /><br />
<code> 5+3</code><br /><br />
=<code>8</code></div><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T05:14:13Z<p>243061: /* Including Additional Information */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: <pre>/roll 1d20+5 to hit</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: <pre>/roll 1d8+1+2d6 Damage with Sneak Attack</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: <pre>/gmroll 1d100</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
''*The above box will be Yellow in roll20''<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: <pre>/roll 1d20+5 Roll for Initiative</pre><br />
<br />
What you see in the chat:<br />
<br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: <pre>/roll 2d10+2d6[crit]+5 Critical Hit!</pre><br />
<br />
What you see in the chat:<br />
<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box around it. If there's a crit failure, it's highlighting in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<br />
<br />
Type in:<br />
<pre>/em is filled with [[3d6]] points of anger!</pre><br />
<br />
<div class="diceroller">'''THE GM''' is filled with <code>13</code> points of anger!</div><br />
''*the above box will be orange instead of blue in roll20''<br /><br />
<br />
<br />
Type in:<br />
<pre>/roll [[2d6]]d6</pre><br />
<br />
<div class="diceroller">'''THE GM''' <code>rolling |'''5'''|d6</code><br /><br />
<br />
<code>( '''<big>1</big>''' + '''<big>4</big>''' + '''<big>3</big>''' + '''<big>2</big>''' + '''<big>1</big>''' )</code><br /><br />
=<code><big>'''11'''</big></code></div><br />
''*instead of the |5| the number will be the returned value of the dice in the <code>[[]]</code> number in a yellow box. If you hover over the box it will show the roll''<br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. <br /><br /><br />
<br />
Type in:<br /><br />
<pre>?{TEXT DISPLAYED}</pre><br />
<br />
If the above command is entered in the roll20 chat a query box will appear with "TEXT DISPLAYED" in it, asking for an input. Any thing typed in to the following box will be returned threw the roll20 chat.<br /><br />
''*If you type another command it will execute it threw the chat in lue of text. (/roll 1d20 will roll a die, /me will emote...etc)''<br /><br />
<br />
Type in:<br /><br />
<pre>/roll ?{NUMBER OF DICE|5}d20</pre><br />
<br />
As above a query box appears requesting "NUMBER OF DICE". The return box will already have the number following the <code>|</code> inputed as the default number, in this case 5. The number returned will be the number of dice rolled<br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T05:12:39Z<p>243061: /* How to Roll Dice */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: <pre>/roll 1d20+5 to hit</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: <pre>/roll 1d8+1+2d6 Damage with Sneak Attack</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: <pre>/gmroll 1d100</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
''*The above box will be Yellow in roll20''<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: <pre>/roll 1d20+5 Roll for Initiative</pre><br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: <pre>/roll 2d10+2d6[crit]+5 Critical Hit!</pre><br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box around it. If there's a crit failure, it's highlighting in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<br />
<br />
Type in:<br />
<pre>/em is filled with [[3d6]] points of anger!</pre><br />
<br />
<div class="diceroller">'''THE GM''' is filled with <code>13</code> points of anger!</div><br />
''*the above box will be orange instead of blue in roll20''<br /><br />
<br />
<br />
Type in:<br />
<pre>/roll [[2d6]]d6</pre><br />
<br />
<div class="diceroller">'''THE GM''' <code>rolling |'''5'''|d6</code><br /><br />
<br />
<code>( '''<big>1</big>''' + '''<big>4</big>''' + '''<big>3</big>''' + '''<big>2</big>''' + '''<big>1</big>''' )</code><br /><br />
=<code><big>'''11'''</big></code></div><br />
''*instead of the |5| the number will be the returned value of the dice in the <code>[[]]</code> number in a yellow box. If you hover over the box it will show the roll''<br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. <br /><br /><br />
<br />
Type in:<br /><br />
<pre>?{TEXT DISPLAYED}</pre><br />
<br />
If the above command is entered in the roll20 chat a query box will appear with "TEXT DISPLAYED" in it, asking for an input. Any thing typed in to the following box will be returned threw the roll20 chat.<br /><br />
''*If you type another command it will execute it threw the chat in lue of text. (/roll 1d20 will roll a die, /me will emote...etc)''<br /><br />
<br />
Type in:<br /><br />
<pre>/roll ?{NUMBER OF DICE|5}d20</pre><br />
<br />
As above a query box appears requesting "NUMBER OF DICE". The return box will already have the number following the <code>|</code> inputed as the default number, in this case 5. The number returned will be the number of dice rolled<br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T05:11:54Z<p>243061: /* Rolling in Secret */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: /roll 1d20+5 to hit<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: /roll 1d8+1+2d6 Damage with Sneak Attack<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: <pre>/gmroll 1d100</pre><br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
''*The above box will be Yellow in roll20''<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: <pre>/roll 1d20+5 Roll for Initiative</pre><br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: <pre>/roll 2d10+2d6[crit]+5 Critical Hit!</pre><br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box around it. If there's a crit failure, it's highlighting in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<br />
<br />
Type in:<br />
<pre>/em is filled with [[3d6]] points of anger!</pre><br />
<br />
<div class="diceroller">'''THE GM''' is filled with <code>13</code> points of anger!</div><br />
''*the above box will be orange instead of blue in roll20''<br /><br />
<br />
<br />
Type in:<br />
<pre>/roll [[2d6]]d6</pre><br />
<br />
<div class="diceroller">'''THE GM''' <code>rolling |'''5'''|d6</code><br /><br />
<br />
<code>( '''<big>1</big>''' + '''<big>4</big>''' + '''<big>3</big>''' + '''<big>2</big>''' + '''<big>1</big>''' )</code><br /><br />
=<code><big>'''11'''</big></code></div><br />
''*instead of the |5| the number will be the returned value of the dice in the <code>[[]]</code> number in a yellow box. If you hover over the box it will show the roll''<br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. <br /><br /><br />
<br />
Type in:<br /><br />
<pre>?{TEXT DISPLAYED}</pre><br />
<br />
If the above command is entered in the roll20 chat a query box will appear with "TEXT DISPLAYED" in it, asking for an input. Any thing typed in to the following box will be returned threw the roll20 chat.<br /><br />
''*If you type another command it will execute it threw the chat in lue of text. (/roll 1d20 will roll a die, /me will emote...etc)''<br /><br />
<br />
Type in:<br /><br />
<pre>/roll ?{NUMBER OF DICE|5}d20</pre><br />
<br />
As above a query box appears requesting "NUMBER OF DICE". The return box will already have the number following the <code>|</code> inputed as the default number, in this case 5. The number returned will be the number of dice rolled<br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T05:11:28Z<p>243061: /* Including Additional Information */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: /roll 1d20+5 to hit<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: /roll 1d8+1+2d6 Damage with Sneak Attack<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: /gmroll 1d100<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
''*The above box will be Yellow in roll20''<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: <pre>/roll 1d20+5 Roll for Initiative</pre><br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: <pre>/roll 2d10+2d6[crit]+5 Critical Hit!</pre><br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box around it. If there's a crit failure, it's highlighting in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<br />
<br />
Type in:<br />
<pre>/em is filled with [[3d6]] points of anger!</pre><br />
<br />
<div class="diceroller">'''THE GM''' is filled with <code>13</code> points of anger!</div><br />
''*the above box will be orange instead of blue in roll20''<br /><br />
<br />
<br />
Type in:<br />
<pre>/roll [[2d6]]d6</pre><br />
<br />
<div class="diceroller">'''THE GM''' <code>rolling |'''5'''|d6</code><br /><br />
<br />
<code>( '''<big>1</big>''' + '''<big>4</big>''' + '''<big>3</big>''' + '''<big>2</big>''' + '''<big>1</big>''' )</code><br /><br />
=<code><big>'''11'''</big></code></div><br />
''*instead of the |5| the number will be the returned value of the dice in the <code>[[]]</code> number in a yellow box. If you hover over the box it will show the roll''<br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. <br /><br /><br />
<br />
Type in:<br /><br />
<pre>?{TEXT DISPLAYED}</pre><br />
<br />
If the above command is entered in the roll20 chat a query box will appear with "TEXT DISPLAYED" in it, asking for an input. Any thing typed in to the following box will be returned threw the roll20 chat.<br /><br />
''*If you type another command it will execute it threw the chat in lue of text. (/roll 1d20 will roll a die, /me will emote...etc)''<br /><br />
<br />
Type in:<br /><br />
<pre>/roll ?{NUMBER OF DICE|5}d20</pre><br />
<br />
As above a query box appears requesting "NUMBER OF DICE". The return box will already have the number following the <code>|</code> inputed as the default number, in this case 5. The number returned will be the number of dice rolled<br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T05:10:41Z<p>243061: /* Inline Dice Rolls */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: /roll 1d20+5 to hit<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: /roll 1d8+1+2d6 Damage with Sneak Attack<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: /gmroll 1d100<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
''*The above box will be Yellow in roll20''<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: /roll 1d20+5 Roll for Initiative<br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: /roll 2d10+2d6[crit]+5 Critical Hit!<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box around it. If there's a crit failure, it's highlighting in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<br />
<br />
Type in:<br />
<pre>/em is filled with [[3d6]] points of anger!</pre><br />
<br />
<div class="diceroller">'''THE GM''' is filled with <code>13</code> points of anger!</div><br />
''*the above box will be orange instead of blue in roll20''<br /><br />
<br />
<br />
Type in:<br />
<pre>/roll [[2d6]]d6</pre><br />
<br />
<div class="diceroller">'''THE GM''' <code>rolling |'''5'''|d6</code><br /><br />
<br />
<code>( '''<big>1</big>''' + '''<big>4</big>''' + '''<big>3</big>''' + '''<big>2</big>''' + '''<big>1</big>''' )</code><br /><br />
=<code><big>'''11'''</big></code></div><br />
''*instead of the |5| the number will be the returned value of the dice in the <code>[[]]</code> number in a yellow box. If you hover over the box it will show the roll''<br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. <br /><br /><br />
<br />
Type in:<br /><br />
<pre>?{TEXT DISPLAYED}</pre><br />
<br />
If the above command is entered in the roll20 chat a query box will appear with "TEXT DISPLAYED" in it, asking for an input. Any thing typed in to the following box will be returned threw the roll20 chat.<br /><br />
''*If you type another command it will execute it threw the chat in lue of text. (/roll 1d20 will roll a die, /me will emote...etc)''<br /><br />
<br />
Type in:<br /><br />
<pre>/roll ?{NUMBER OF DICE|5}d20</pre><br />
<br />
As above a query box appears requesting "NUMBER OF DICE". The return box will already have the number following the <code>|</code> inputed as the default number, in this case 5. The number returned will be the number of dice rolled<br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T05:05:51Z<p>243061: /* Roll Queries */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: /roll 1d20+5 to hit<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: /roll 1d8+1+2d6 Damage with Sneak Attack<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: /gmroll 1d100<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
''*The above box will be Yellow in roll20''<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: /roll 1d20+5 Roll for Initiative<br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: /roll 2d10+2d6[crit]+5 Critical Hit!<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box around it. If there's a crit failure, it's highlighting in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<br />
<br />
Type in:<br />
<nowiki>/em is filled with [[3d6]] points of anger!</nowiki><br />
<br />
<div class="diceroller">'''THE GM''' is filled with 13 points of anger!</div><br />
''*the above box will be orange instead of blue in roll20''<br /><br />
<br />
<br />
Type in:<br />
<nowiki>/roll [[2d6]]d6</nowiki><br />
<br />
<div class="diceroller">'''THE GM''' <code>rolling |'''5'''|d6</code><br /><br />
<br />
<code>( '''<big>1</big>''' + '''<big>4</big>''' + '''<big>3</big>''' + '''<big>2</big>''' + '''<big>1</big>''' )</code><br /><br />
=<code><big>'''11'''</big></code></div><br />
''*instead of the |5| the number will be the number in a yellow box. If you hover over the box it will show the roll''<br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. <br /><br /><br />
<br />
Type in:<br /><br />
<pre>?{TEXT DISPLAYED}</pre><br />
<br />
If the above command is entered in the roll20 chat a query box will appear with "TEXT DISPLAYED" in it, asking for an input. Any thing typed in to the following box will be returned threw the roll20 chat.<br /><br />
''*If you type another command it will execute it threw the chat in lue of text. (/roll 1d20 will roll a die, /me will emote...etc)''<br /><br />
<br />
Type in:<br /><br />
<pre>/roll ?{NUMBER OF DICE|5}d20</pre><br />
<br />
As above a query box appears requesting "NUMBER OF DICE". The return box will already have the number following the <code>|</code> inputed as the default number, in this case 5. The number returned will be the number of dice rolled<br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T04:15:58Z<p>243061: /* Inline Dice Rolls */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: /roll 1d20+5 to hit<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: /roll 1d8+1+2d6 Damage with Sneak Attack<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: /gmroll 1d100<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
''*The above box will be Yellow in roll20''<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: /roll 1d20+5 Roll for Initiative<br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: /roll 2d10+2d6[crit]+5 Critical Hit!<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box around it. If there's a crit failure, it's highlighting in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<br />
<br />
Type in:<br />
<nowiki>/em is filled with [[3d6]] points of anger!</nowiki><br />
<br />
<div class="diceroller">'''THE GM''' is filled with 13 points of anger!</div><br />
''*the above box will be orange instead of blue in roll20''<br /><br />
<br />
<br />
Type in:<br />
<nowiki>/roll [[2d6]]d6</nowiki><br />
<br />
<div class="diceroller">'''THE GM''' <code>rolling |'''5'''|d6</code><br /><br />
<br />
<code>( '''<big>1</big>''' + '''<big>4</big>''' + '''<big>3</big>''' + '''<big>2</big>''' + '''<big>1</big>''' )</code><br /><br />
=<code><big>'''11'''</big></code></div><br />
''*instead of the |5| the number will be the number in a yellow box. If you hover over the box it will show the roll''<br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. The syntax for a roll query is:<br />
<br />
<pre data-language="javascript"><br />
?{Prompt Message}<br />
//Example:<br />
/roll ?{Number of Dice}d20<br />
//You can also include a default value:<br />
/roll ?{Number of Dice|1}d20<br />
// 1 would be the default<br />
</pre><br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T04:14:22Z<p>243061: /* Rolling in Secret */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: /roll 1d20+5 to hit<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: /roll 1d8+1+2d6 Damage with Sneak Attack<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: /gmroll 1d100<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
''*The above box will be Yellow in roll20''<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: /roll 1d20+5 Roll for Initiative<br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: /roll 2d10+2d6[crit]+5 Critical Hit!<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box around it. If there's a crit failure, it's highlighting in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<br />
<br />
Type in:<br />
<nowiki>/em is filled with [[3d6]] points of anger!</nowiki><br />
<br />
<div class="diceroller">'''THE GM''' is filled with 13 points of anger!</div><br />
''*the above box will be orange instead of blue in roll20''<br /><br />
Type in:<br />
<nowiki>/roll [[2d6]]d6</nowiki><br />
<br />
<div class="diceroller">'''THE GM''' <code>rolling |'''5'''|d6</code><br /><br />
<br />
<code>( '''<big>1</big>''' + '''<big>4</big>''' + '''<big>3</big>''' + '''<big>2</big>''' + '''<big>1</big>''' )</code><br /><br />
=<code><big>'''11'''</big></code></div><br />
''*instead of the |5| the number will be the number in a yellow box. If you hover over the box it will show the roll''<br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. The syntax for a roll query is:<br />
<br />
<pre data-language="javascript"><br />
?{Prompt Message}<br />
//Example:<br />
/roll ?{Number of Dice}d20<br />
//You can also include a default value:<br />
/roll ?{Number of Dice|1}d20<br />
// 1 would be the default<br />
</pre><br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T04:13:57Z<p>243061: /* Rolling in Secret */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: /roll 1d20+5 to hit<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: /roll 1d8+1+2d6 Damage with Sneak Attack<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: /gmroll 1d20+5 to hit<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
''*The above box will be Yellow in roll20''<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: /roll 1d20+5 Roll for Initiative<br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: /roll 2d10+2d6[crit]+5 Critical Hit!<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box around it. If there's a crit failure, it's highlighting in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<br />
<br />
Type in:<br />
<nowiki>/em is filled with [[3d6]] points of anger!</nowiki><br />
<br />
<div class="diceroller">'''THE GM''' is filled with 13 points of anger!</div><br />
''*the above box will be orange instead of blue in roll20''<br /><br />
Type in:<br />
<nowiki>/roll [[2d6]]d6</nowiki><br />
<br />
<div class="diceroller">'''THE GM''' <code>rolling |'''5'''|d6</code><br /><br />
<br />
<code>( '''<big>1</big>''' + '''<big>4</big>''' + '''<big>3</big>''' + '''<big>2</big>''' + '''<big>1</big>''' )</code><br /><br />
=<code><big>'''11'''</big></code></div><br />
''*instead of the |5| the number will be the number in a yellow box. If you hover over the box it will show the roll''<br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. The syntax for a roll query is:<br />
<br />
<pre data-language="javascript"><br />
?{Prompt Message}<br />
//Example:<br />
/roll ?{Number of Dice}d20<br />
//You can also include a default value:<br />
/roll ?{Number of Dice|1}d20<br />
// 1 would be the default<br />
</pre><br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T04:12:04Z<p>243061: /* Inline Dice Rolls */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: /roll 1d20+5 to hit<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: /roll 1d8+1+2d6 Damage with Sneak Attack<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: /gmroll 1d20+5 to hit<br />
<br />
What you see in the chat:''but it would be in a yellow box''<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: /roll 1d20+5 Roll for Initiative<br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: /roll 2d10+2d6[crit]+5 Critical Hit!<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box around it. If there's a crit failure, it's highlighting in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<br />
<br />
Type in:<br />
<nowiki>/em is filled with [[3d6]] points of anger!</nowiki><br />
<br />
<div class="diceroller">'''THE GM''' is filled with 13 points of anger!</div><br />
''*the above box will be orange instead of blue in roll20''<br /><br />
Type in:<br />
<nowiki>/roll [[2d6]]d6</nowiki><br />
<br />
<div class="diceroller">'''THE GM''' <code>rolling |'''5'''|d6</code><br /><br />
<br />
<code>( '''<big>1</big>''' + '''<big>4</big>''' + '''<big>3</big>''' + '''<big>2</big>''' + '''<big>1</big>''' )</code><br /><br />
=<code><big>'''11'''</big></code></div><br />
''*instead of the |5| the number will be the number in a yellow box. If you hover over the box it will show the roll''<br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. The syntax for a roll query is:<br />
<br />
<pre data-language="javascript"><br />
?{Prompt Message}<br />
//Example:<br />
/roll ?{Number of Dice}d20<br />
//You can also include a default value:<br />
/roll ?{Number of Dice|1}d20<br />
// 1 would be the default<br />
</pre><br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T03:24:42Z<p>243061: /* Including Additional Information */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: /roll 1d20+5 to hit<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: /roll 1d8+1+2d6 Damage with Sneak Attack<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: /gmroll 1d20+5 to hit<br />
<br />
What you see in the chat:''but it would be in a yellow box''<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: /roll 1d20+5 Roll for Initiative<br />
<div class="diceroller"> '''THE GM (GM):'''<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: /roll 2d10+2d6[crit]+5 Critical Hit!<br />
<div class="diceroller">'''THE GM (GM):'''<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box. If there's a crit failure, it's highlighted in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<pre data-language="javascript"><br />
/em Riley is filled with [[3d6]] points of anger!<br />
/roll [[2d6]]d5<br />
</pre><br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. The syntax for a roll query is:<br />
<br />
<pre data-language="javascript"><br />
?{Prompt Message}<br />
//Example:<br />
/roll ?{Number of Dice}d20<br />
//You can also include a default value:<br />
/roll ?{Number of Dice|1}d20<br />
// 1 would be the default<br />
</pre><br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T03:20:25Z<p>243061: /* Including Additional Information */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: /roll 1d20+5 to hit<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: /roll 1d8+1+2d6 Damage with Sneak Attack<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: /gmroll 1d20+5 to hit<br />
<br />
What you see in the chat:''but it would be in a yellow box''<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
Type in: /roll 1d20+5 Roll for Initiative<br />
<div class="diceroller"><br />
<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code></div><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
Type in: /roll 2d10+2d6[crit]+5 Critical Hit!<br />
<div class="diceroller"><br />
<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code></div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box. If there's a crit failure, it's highlighted in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<pre data-language="javascript"><br />
/em Riley is filled with [[3d6]] points of anger!<br />
/roll [[2d6]]d5<br />
</pre><br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. The syntax for a roll query is:<br />
<br />
<pre data-language="javascript"><br />
?{Prompt Message}<br />
//Example:<br />
/roll ?{Number of Dice}d20<br />
//You can also include a default value:<br />
/roll ?{Number of Dice|1}d20<br />
// 1 would be the default<br />
</pre><br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T03:18:33Z<p>243061: /* Rolling in Secret */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: /roll 1d20+5 to hit<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: /roll 1d8+1+2d6 Damage with Sneak Attack<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
Type in: /gmroll 1d20+5 to hit<br />
<br />
What you see in the chat:''but it would be in a yellow box''<br />
<div class='diceroller'><br />
<code>(To GM)rolling 1d100</code> <br /><br />
<code>( '''7''' )</code><br /><br />
=<code>7</code><br />
</div><br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
<div class="diceroller"><br />
/roll 1d20+5 Roll for Initiative</div><br />
<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
<div class="diceroller"><br />
/roll 2d10+2d6[crit]+5 Critical Hit!</div><br />
<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box. If there's a crit failure, it's highlighted in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<pre data-language="javascript"><br />
/em Riley is filled with [[3d6]] points of anger!<br />
/roll [[2d6]]d5<br />
</pre><br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. The syntax for a roll query is:<br />
<br />
<pre data-language="javascript"><br />
?{Prompt Message}<br />
//Example:<br />
/roll ?{Number of Dice}d20<br />
//You can also include a default value:<br />
/roll ?{Number of Dice|1}d20<br />
// 1 would be the default<br />
</pre><br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T03:10:38Z<p>243061: /* How to Roll Dice */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
Type in: /roll 1d20+5 to hit<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d20+5 to hit</code> <br /><br />
<code>( '''10''' )+5</code><br /><br />
=<code>15</code><br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
Type in: /roll 1d8+1+2d6 Damage with Sneak Attack<br />
<br />
What you see in the chat:<br />
<div class='diceroller'><br />
'''THE GM (GM):''' <code>rolling 1d8+1+2d6 Damage with Sneak Attack</code> <br /><br />
<code>( '''3''' )+1+( '''2''' + '''4''' )</code><br /><br />
=<code>10</code><br />
</div><br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
<div class="diceroller"><br />
/roll 1d20+5 Roll for Initiative</div><br />
<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
<div class="diceroller"><br />
/roll 2d10+2d6[crit]+5 Critical Hit!</div><br />
<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box. If there's a crit failure, it's highlighted in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<pre data-language="javascript"><br />
/em Riley is filled with [[3d6]] points of anger!<br />
/roll [[2d6]]d5<br />
</pre><br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. The syntax for a roll query is:<br />
<br />
<pre data-language="javascript"><br />
?{Prompt Message}<br />
//Example:<br />
/roll ?{Number of Dice}d20<br />
//You can also include a default value:<br />
/roll ?{Number of Dice|1}d20<br />
// 1 would be the default<br />
</pre><br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T02:53:32Z<p>243061: /* Including Additional Information */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
<div class='diceroller'><br />
/roll 1d20+5<br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
<div class="diceroller"><br />
/roll 1d20+5 Roll for Initiative</div><br />
<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code><br />
<br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
<div class="diceroller"><br />
/roll 2d10+2d6[crit]+5 Critical Hit!</div><br />
<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box. If there's a crit failure, it's highlighted in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<pre data-language="javascript"><br />
/em Riley is filled with [[3d6]] points of anger!<br />
/roll [[2d6]]d5<br />
</pre><br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. The syntax for a roll query is:<br />
<br />
<pre data-language="javascript"><br />
?{Prompt Message}<br />
//Example:<br />
/roll ?{Number of Dice}d20<br />
//You can also include a default value:<br />
/roll ?{Number of Dice|1}d20<br />
// 1 would be the default<br />
</pre><br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Dice_ReferenceDice Reference2013-10-05T02:48:12Z<p>243061: /* Including Additional Information */</p>
<hr />
<div>Roll20 features support for a wide array of dice mechanics. On this page we've compiled a list of all of the different types of dice rolls you can perform. Each type also has an interactive example box where you can make actual rolls using the same roll system that's built in to Roll20 -- a great way to experiment and check to make sure we can support your role playing game system of choice. Don't see a dice mechanic your game system needs, or think something is done incorrectly? [mailto:team@roll20.net Get in touch and let us know!]<br />
<br />
{{mbox | text = Want to skip straight to the 'nitty-gritty'? Check out the [[Dice_Reference#Roll20 Dice Specification|Dice Specification]] for the really advanced stuff!}}<br />
<br />
<br />
== How to Roll Dice ==<br />
<br />
Rolling dice in Roll20 is easy. Just type the <code>/roll</code> command into the text chat box, followed by a formula. In most cases, the formula is the same as the one that's printed in your game's instructions. For example, you might know that to roll an attack roll you need to roll a &quot;D20 plus your attack modifier&quot;. In Roll20, you would just type <code>/roll d20+5</code>. If you hit and you need to roll 3d6+2 damage, you would just type <code>/roll 3d6+2</code>. Finally, you can also string multiple rolls together. If you have an attack that does two types of damage, you might do <code>/roll 2d6+5 + d8</code>.<br />
<br />
<div class='diceroller'><br />
/roll 1d20+5<br />
</div><br />
<br />
After the roll is performed, you'll see the results of the roll in the text chat area. Notice that for each group of dice that were rolled, there will be a group of numbers in parentheses, representing the result of each individual dice that was rolled. (The number sits on an outline of the dice type rolled, and this outline is in the same color as the square of color in the dice-roller's player portrait in the Player Area.) You'll also see the total of all the dice values plus modifiers to the right of the equal sign.<br />
<br />
== Rolling in Secret ==<br />
<br />
By default, any rolls that you make are seen by everyone in the game with you (including all players). If you want to roll in secret, you can use the <code>/gmroll</code> command to perform a roll that only the GM and the original player who made the roll can see. So if you're the GM, doing a <code>/gmroll</code> will only be visible to you. It's a great way to perform skill checks in secret.<br />
<br />
== Including Additional Information ==<br />
<br />
You can also include non-formula text in your roll to indicate what that roll is for. For example, when rolling for initiative you might enter <code>/roll 1d20+5 Roll for Initiative</code>. The extra text won't affect your roll in any way, but it's included in the chat log so that others can see what you're rolling for. It's entirely optional to do this, by the way, but some GMs find it helps keep everything organized a little better.<br />
<br />
<div class="diceroller"><br />
/roll 1d20+5 Roll for Initiative<br /><br /><br />
<code>rolling 1d20+5 Roll for Initiative</code><br /><br />
<code>(8)+5</code><br /><br />
=<code>13</code><br />
</div><br />
<br />
If you want to include any numbers, parentheses, or <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, or <code>%</code> in your additional text, you can preface it with a <code>\</code> to separate the formula from the text and keep the roller from getting confused. So for example you can do <code>/roll 1d20+5 \ +5 Roll for Initiative</code>.<br />
<br />
If you want to include additional comments before the end of the roll (we call them &quot;inline labels&quot;), use square brackets. For example, <code>/roll 2d20+5[Fire Damage] + 3d6+5[Ice Damage]</code>. When these comments are applied directly after a die roll they show up as tool-tips on the dice:<br />
<br />
<div class="diceroller"><br />
/roll 2d10+2d6[crit]+5 Critical Hit!<br /><br /><br />
<code>rolling 2d10+2d6[crit]+5 Critical Hit!</code><br /><br />
<code>(6+5)+(2+6)+5</code><br /><br />
=<code>24</code><br />
</div><br />
<br />
== Inline Dice Rolls ==<br />
<br />
If you want a more compact roll representation, you can take advantage of inline dice rolls. Inline rolls are just like regular rolls, with the following exceptions:<br />
<br />
* You can use them in any chat message, not just a roll. For example, you can do a regular chat message, an emote, or a whisper, with an inline roll included.<br />
* They are evaluated completely before any /roll commands, so you can use them as "random variables" in your rolls.<br />
* You will only see the result of the total roll, and you can hover over the result to see the individual dice rolls.<br />
* If an inline roll contains a crit success, it will be highlighted with a green box. If there's a crit failure, it's highlighted in red. If it has both (because there was more than one roll), 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 rolls themselves for crits/fumbles.<br />
<br />
<br />
To do an inline roll, just include two brackets in any chat message or roll, like so:<br />
<br />
<pre data-language="javascript"><br />
/em Riley is filled with [[3d6]] points of anger!<br />
/roll [[2d6]]d5<br />
</pre><br />
<br />
== Roll Queries ==<br />
<br />
Sometimes you may have a roll (or a macro) which you want to change every time it is rolled. For example, you may want to roll a variable number of dice, or add a different modifier onto the roll each time you perform the action. Roll Queries allow you to prompt whoever is performing the roll to fill in a value when the roll is made. The syntax for a roll query is:<br />
<br />
<pre data-language="javascript"><br />
?{Prompt Message}<br />
//Example:<br />
/roll ?{Number of Dice}d20<br />
//You can also include a default value:<br />
/roll ?{Number of Dice|1}d20<br />
// 1 would be the default<br />
</pre><br />
<br />
You can use Roll Queries in rolls, macros, abilities, emotes, whispers -- pretty much anywhere in the app.<br />
<br />
== Math-Only Rolls ==<br />
You can do math-only rolls by adding a math expression after the roll command.<br />
<br />
For example, if you want Roll20 to do a simple addition like 5 <code>+</code> 3, you'd enter the following:<br />
<pre data-language="javascript">/roll 5+3</pre><br />
<br />
Or if you want to do this in an inline roll you'd use:<br />
<pre data-language="javascript">[[5+3]]</pre><br />
<br />
== Exploding Dice ==<br />
<br />
Roll20 supports exploding dice -- you may also know it as &quot;rule of 6&quot;, &quot;rule of 10s&quot;, or &quot;acing&quot; depending on your game system. With exploding dice, if you roll the maximum number on the dice (a 6 with a d6, a 10 with a d10, etc.) you get to re-roll again and add the additional roll to your total for that roll. If the additional roll is also a maximum number, you get to keep rolling!<br />
<br />
To perform a roll with exploding dice, just add an exclamation point after the number of sides in the formula. For example, <code>/roll 3d6!</code> would roll 3 d6 dice with exploding re-rolls. You can also define the exploding point for the dice using the greater-than and less-than symbols. For example, <code>/roll 3d6!&gt;4</code> would explode on any dice greater-than or equal-to 4. <code>/roll 3d6!3</code> would explode only if a 3 is rolled.<br />
<br />
<div class='diceroller'><br />
/roll 10d6!<br />
</div><br />
<br />
'''Compounding Exploding Dice (Shadowrun-Style Exploding Dice)'''<br />
<br />
Shadowrun (and some other systems) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. So for example to roll 5 d6's, you would do <code>/roll 5d6!!</code>. A common Shadowrun roll would be exploding dice compared to a target number, for example <code>/roll {5d6!!}&gt;8</code> <em>(notice the use of the brackets to show that we don't mean &quot;explode on anything greater than 8&quot;, but rather &quot;explode on 6's compounding, then compare to 8 for successes)</em>. Even though the target number (8) is higher than the possible roll from a single dice, with the compounding exploding rolls a single roll can be infinitely high!<br />
<br />
<div class='diceroller'><br />
/roll {5d6!!}&gt;8<br />
</div><br />
<br />
'''Penetrating Exploding Dice (Hackmaster-Style Exploding Dice)'''<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. So for example to roll 5 d6's, you would do <code>/roll 5d6!p</code>.<br />
<br />
<div class='diceroller'><br />
/roll 5d6!p<br />
</div><br />
<br />
== Drop/Keep ==<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number of the lowest rolls, or keep only a certain number of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively.<br />
<br />
For example, you might roll 8 d100 dice and only be allowed to keep the top 4 rolls. In Roll20 this would be expressed with <code>/roll 8d100k4</code>. When Roll20 prints the output from that roll, you'll see each individual d100's rolled value, and all but the top 4 rolls will be greyed out. Roll20 will then give you the total of the top 4 rolls. Doing a roll to drop the 3 lowest rolls would be very similar: <code>/roll 8d100d3</code>. Again, the value of each dice rolled will be displayed, with the 3 lowest rolls greyed out.<br />
<br />
<div class='diceroller'><br />
/roll 8d100d3<br />
</div><br />
<br />
The <code>d</code> and <code>k</code> commands are shortcuts for the full <code>dl</code> and <code>kh</code> commands. If you need to drop the highest dice use <code>dh</code> and if you need to keep the lowest dice use <code>kl</code>. For example <code>/roll 8d100dh3</code> would drop the highest three rolls and keep the lowest 5 and <code>/roll 8d100kl3</code> would keep the lowest three rolls and drop the highest 5.<br />
<br />
== Target Number (Successes) ==<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead. Roll20 uses the greater-than symbol <code>&gt;</code> to indicate when the roll is greater-than or equal-to <code>&gt;=</code> the target number. The less-than symbol <code>&lt;</code> is used to indicate when the roll is less-than or equal-to <code>&lt;=</code> the target number.<br />
<br />
For example, you might be performing an action that requires a target number of 3, and you get to roll 3 d6's to see how many successes you have. In Roll20, you would do <code>/roll 3d6&gt;3</code>. Note the inclusion of the greater-than symbol to indicate that this is a target roll versus 3. Roll20 will show you each dice that was rolled, and then tell you the number of dice with a value of 3 or greater (note that ties with the target number count as a success!). You can also roll less-than target numbers, for example <code>/roll 10d6&lt;4</code>, which would give you a success for each dice rolled that is equal to 4 or less.<br />
<br />
You can also add modifiers onto your target rolls, and the modifier will be added to <em>each individual dice roll</em> before it is compared to the target number. However, if you're going to do so, it's recommended that you use a group just to make sure the parser fully understands what you want to do. So, <code>/roll {3d6+1}&lt;3</code> would roll 3 d6 dice, and for each dice roll add on 1, then compare it versus the target number of 3.<br />
<br />
<div class='diceroller'><br />
/roll 3d6&gt;3<br />
</div><br />
<br />
== Rerolling Dice ==<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored.<br />
<br />
To use reroll, just do <code>/roll 2d8r&lt;2</code>. Roll20 will roll 2 d8 and reroll any 1s or 2s, dropping the original die value. If reroll for a specific value is needed the comparison operator can be left off. <code>/roll 2d8r8</code> will reroll any 8s. &gt; and &lt; can be used as comparisons and the r suffix can be specified multiple times. <code>/roll 2d8r1r3r5r7</code> would roll 2d8 and re-roll any odd number.<br />
<br />
<div class='diceroller'><br />
/roll 2d8r&lt;2<br />
</div><br />
<br />
== FATE Dice ==<br />
<br />
Roll20 also supports FATE dice (used for FATE, FUDGE, and other systems). Roll20 accurately simulates FATE dice as 6-sided dice in which two sides are 0, two sides are +1, and two sides are -1.<br />
<br />
To roll 4 FATE dice, just do <code>/roll 4dF</code>. Roll20 will show you the result of each individual FATE dice roll, then give you the total of all the dice rolls added up together. You can also add a modifier onto the total, with <code>/roll 4dF+1</code>.<br />
<br />
<div class='diceroller'><br />
/roll 4dF<br />
</div><br />
<br />
== Rounding Rolls ==<br />
<br />
You may want to use rounding in your roll formulas to emulate mechanics such as "half a level, rounded down to the nearest level." Roll20 provides two functions to accomplish this: <code>floor()</code>, which will always round the number down (e.g. 5.7 becomes 5), and <code>ceil()</code> which will always round the number up (e.g. 5.1 becomes 6). You can use these functions almost anywhere in your roll formulas (around a single math expression, groups of math expressions, or even the entire roll). For example:<br />
<br />
<div class='diceroller'><br />
/roll floor(7/2) + 2d6<br />
</div><br />
<br />
== Grouping Rolls ==<br />
<br />
Sometimes you may want to perform a series of rolls, and then compare each roll to a common check (like a success roll). Roll20 provides a &quot;grouped rolls&quot; functionality for this purpose. For example, you can roll two different pools of dice, then keep the highest dice roll across any of the pools:<br />
<br />
<div class="diceroller"><br />
/roll {4d6+3d8}kh1<br />
</div><br />
<br />
If you separate the rolls inside the group with a comma, then we'll sum each individual dice expression in the group before applying any modifiers. For example, if we change the above example to use a comma, instead of keeping the highest single roll, it will instead keep the highest group total:<br />
<br />
<div class="diceroller"><br />
/roll {4d6,3d8}kh1<br />
</div><br />
<br />
This is needed in games based on the Savage Worlds system, where important characters roll a "wild die" in parallel with their main die and choose the highest roll. <br />
<br />
Grouped rolls can be a very powerful features in Roll20. See more detail about them in the full dice specification below.<br />
<br />
<hr /><br />
<br />
<div class='alert'><br />
Below you'll find the entire Roll20 dice engine specification. This is the &quot;advanced&quot; documentation. If you're looking to do something totally crazy with Roll20 dice, this is a great place to see if we can support it.<br />
</div><br />
<br />
== Roll To Initiative ==<br />
To add a roll directly into Roll20's Turn Track (Rolling for Initiative), you'll need to incorporate a &quot;roll option&quot;. A roll option is a special Roll20 flag that you can set anywhere in a roll to tell the roll system you'd like to do special things with the roll. For adding an initiative number to the turn track, you'll first need to select the token you wish to roll for and use this formula:<br />
<br />
<code>/roll 1d20 + 5 &{tracker}</code><br />
<br />
The &{} part is where you put your options for the roll, and the "tracker" option is what says &quot;Show the results of this roll, but also use the result as the value in the turn tracker.&quot; If the token that you have selected doesn't already have a turn in the turn order, one will be added. If it already has at least one turn, all current turns will be updated with the new value.<br />
<br />
= Roll20 Dice Specification =<br />
<br />
== Order of Operations ==<br />
While the Roll20 dice engine does support basic math and functions such as floor() and ceil(), it is first and foremost a dice engine, and so it has its own order of operations. This means that putting parentheses inside of your dice formula will not always affect the outcome of the roll (for example, you can't force a variable to be interpreted before a macro). Here is the general order of operations:<br />
<br />
# Abilities are expanded (meaning the definition of the ability is placed in the formula anywhere that ability appears).<br />
# Macros are expanded, including nested macros up to 99 levels deep.<br />
# Variables are substituted<br />
# Roll queries are executed (the player making the roll is asked to provide a value for each query, and that value is substituted in where the roll query appears in the formula)<br />
# Inline rolls are executed, and the overall result of the inline roll is substituted in wherever the inline roll appeared in the formula.<br />
# The remaining roll is executed: first, dice are rolled for any dice (e.g. "2d6" is rolled; including any special dice such as dropped or exploding), then the result of that roll is substituted into the formula. Next, floor() and ceil() functions are executed. Finally, the entire remaining formula is evaluated, including observing proper math order of operations (parentheses first, then multiplication/division, then addition/subtraction).<br />
<br />
== Types Of Dice ==<br />
<br />
Roll20 supports more than just your standard polyhedrons when rolling dice, below are the available die types you can use in your games.<br />
<br />
=== Basic Roll <code>NdX</code> ===<br />
<br />
Rolls '''N''' traditional (almost, you can have any number of sides that you want) dice with '''X''' sides per die. '''N''' must be greater than or equal to 0 and '''X''' must be greater than or equal to 1.<br />
<br />
=== Fate/Fudge Roll <code>NdF</code> ===<br />
<br />
Rolls '''N''' Fate/Fudge dice. These dice have three sides with values of -1, 0, and 1.<br />
<br />
=== Computed Dice Roll <code>(N+Y)dX</code>/<code>Nd(X+Y)</code> ===<br />
<br />
Computes the number of dice to roll or the number of sides on the dice based on the mathematical expression in the parentheses. Dice computation can be used with both Basic and Fate dice.<br />
<br />
== Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of dice rolls. Each modifier states which '''Types Of Dice''' it can be applied to in parentheses after the modifier name. Rolls can have multiple modifiers applied to a single roll to allow for complex dice expressions.<br />
<br />
* '''B''' - Basic Roll<br />
* '''F''' - Fate/Fudge Roll<br />
<br />
Many modifiers compare each die to a target number to decided if the modifier action should be applied. We'll call this a '''Compare Point''' or '''CP''' for short in the roll modifiers below. A Compare Point consists of an optional compare operation <code>&lt;</code>,<code>=</code>,<code>&gt;</code> and a target number. If the operation is not specified <code>=</code> is assumed and for most modifiers the entire Compare Point can be left off for the default behavior.<br />
<br />
* Example Compare Points<br />
* <code>3</code> - If the roll is equal to 3<br />
* <code>&gt;2</code> - If the roll is greater than or equal to 2<br />
* <code>&lt;18</code> - If the roll is less than or equal to 18<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
Normally when you perform a roll, Roll20 reports back the total value of all the dice rolled, plus any modifiers. Some game systems, though, work by rolling a set of dice versus a target number, and then adding up the total number of successes instead.<br />
<br />
* Example Success Checks<br />
* <code>3d6&gt;3</code> - Roll 3 d6's and count one success for each roll of 3 or higher<br />
* <code>10d6&lt;4</code> - Roll 10 d6's and count one success for each roll of 4 or less<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Some systems build on success checks by also including failures. Failure checks only work when a success check is already being done and each failure subtracts one from the total number of successes.<br />
<br />
* Example Failure Checks<br />
* <code>3d6&gt;3f1</code> - Roll 3 d6's and count one success for each roll of 3 or higher and one failure for each 1<br />
* <code>10d6&lt;4f&gt;5</code> - Roll 10 d6's and count one success for each roll of 4 or less and one failure for each roll of 5 or more<br />
<br />
=== Exploding Dice (B,F) <code>!CP</code> ===<br />
<br />
Exploding dice, also known as &quot;rule of 6&quot; or &quot;rule of 10s&quot; depending on your gaming system, rolls an additional die if the maximum is rolled. If the additional roll is also the maximum number the additional rolls keep on going! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Exploding Dice<br />
* <code>3d6!</code> - Rolls 3d6 and explodes every time a 6 is rolled<br />
* <code>3d6!&gt;5</code> - Rolls 3d6 and explodes every time a 5 or 6 is rolled<br />
<br />
=== Compounding Dice (B,F) <code>!!CP</code> ===<br />
<br />
Shadowrun (and some other systems, such as 7th Sea and L5R) use a special style of exploding dice where the the additional rolls for each dice are added together as a single &quot;roll&quot;. To do this, just use two exclamation marks instead of one. With the compounding exploding rolls a single roll can be infinitely high! The Compare Point can be specified to change the exploding trigger.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!!</code> - Rolls 5d6 and compound every time a 6 is rolled<br />
* <code>5d6!!5</code> - Rolls 5d6 and compound every time a 5 is rolled, 6's will be treated as a normal roll<br />
<br />
=== Penetrating Dice (B,F) <code>!pCP</code> ===<br />
<br />
HackMaster (and some other systems) use a special style of exploding dice where the additional rolls for each dice have 1 subtracted from the roll. To do this, add a p after the exclamation mark. A die can penetrate multiple times but the modifier is only ever -1 to each additional die.<br />
<br />
* Example Compounding Dice<br />
* <code>5d6!p</code> - Rolls 5d6 and explode with a -1 modifier every time a 6 is rolled<br />
* <code>5d6!p&gt;5</code> - Rolls 5d6 and explode with a -1 modifier every time a 5 or higher is rolled.<br />
<br />
=== Keep / Drop Dice (B,F) <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
Some game systems ask you to roll a large number of dice, and then either drop a certain number ('''N''') of the lowest rolls, or keep only a certain number ('''N''') of the highest rolls. Roll20 supports this type of roll through the <code>d</code> and <code>k</code> commands, respectively. The optional <code>h</code>/<code>l</code> parameter can either be <code>h</code> to keep or drop the highest '''N''' dice or <code>l</code> to keep or drop the lowest '''N''' dice. If not specified when keeping rolls the high rolls will be kept and when dropping rolls the low rolls will be dropped.<br />
<br />
* Example Keep Rolls<br />
* <code>8d100k4</code> - Roll 8 d100's and keep the four largest rolls.<br />
* <code>8d100kl4</code> - Roll 8 d100's and keep the four smallest rolls.<br />
* Example Drop Rolls<br />
* <code>8d100d4</code> - Roll 8 d100's and drop the four smallest rolls.<br />
* <code>8d100dh4</code> - Roll 8 d100's and drop the four largest rolls.<br />
<br />
=== Rerolling Dice (B,F) <code>rCP</code> ===<br />
<br />
Several systems require that certain dice be reroll, for example brutal weapons in D&amp;D 4e require any 1s or 2s to be re-rolled and the orignal die value ignored. The reroll modifier can be specified multiple times to allow rerolling at multiple Compare Points<br />
<br />
* Example Rerolls<br />
* <code>2d10r&lt;2</code> - Roll 2 d10's and reroll any time a 2 or lower is rolled<br />
* <code>8d6r</code> - Roll 8 d6's and reroll any time a 1 is rolled<br />
* <code>8d6r2r4r6</code> - Roll 8 d6's and reroll any time a 2, 4, or 6 is rolled<br />
<br />
=== Sorting Dice (B,F) <code>sa</code>/<code>sd</code> ===<br />
<br />
You may want to see your results in either ascending or descending order. The sorting modifier does just this. The order parameter is optional and specifies the order to sort with <code>a</code> for ascending and <code>d</code> for descending. Sorting defaults to ascending if order is not specified.<br />
<br />
* Example Rerolls<br />
* <code>8d6s</code> - Roll 8 d6's and sort the results in ascending order<br />
* <code>8d6sd</code> - Roll 8 d6's and sort the results in descending order<br />
<br />
==== Order of Operations for Modifiers ====<br />
<br />
Modifiers are applied in the following order:<br />
<br />
* Exploding, Compounding, Penetrating, Rerolls<br />
* These are applied while the dice are still rolling. imagine that you roll some exploding 6d6 on your table and the instant one of them settles as a 6 another die is rolled<br />
* Keep, Drop, Success, Failure, Sorting<br />
* These are applied after all of the dice have &quot;settled&quot; and all of the result values are known.<br />
<br />
== Grouped Rolls ==<br />
<br />
Mutliple rolls can be perfomed within a group via curly braces using a comma to seperate the sub-roll expressions <code>{3d6+3d4+5, 2d8+4}</code>. Grouped Rolls have their own set of Group Modifiers which perform actions across the whole group.<br />
<br />
== Grouped Roll Modifiers ==<br />
<br />
Modfiers that can change the behavior or outcome of grouped rolls. Grouped Rolls can have multiple modifiers applied to a group roll to allow for complex dice expressions.<br />
<br />
=== Keep / Drop <code>khN</code>/<code>klN</code>/<code>dhN</code>/<code>dlN</code> ===<br />
<br />
To apply a keep or drop modifier across multiple types of dice wrap the roll in a group. With a single Sub-Roll in the group the keep/drop operation is applied across all rolls. To choose the best or worse roll expression multiple sub-groups can be used. In this case the keep/drop operation is applied to the final result of each subgroup.<br />
<br />
* Single Sub-Roll Keep Example<br />
* <code>{4d6+3d8}k4</code> - Roll 4 d6's and 3 d8's, out of those 7 dice the highest 4 are kept and summed up.<br />
* Multiple Sub-Roll Drop Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}d1</code> - Roll each of the three sub-roll expressions and total them up. Drop the sub-roll expression with the lowest total and sum the other two totals as the result.<br />
<br />
=== Target Number / Successes (B,F) - <code>CP</code> ===<br />
<br />
The same concept as when using on Dice Rolls but with different behavor for a group. For a Grouped Roll with a single sub-roll expression the success check is done after the remaining math expressions have been totaled into each roll. Single sub-roll groups are also useful when doing a success check on a roll that has another Compare Point enabled modifer. For a Grouped Roll with a multiple sub-roll expression the success check is applied to the esult of each sub-roll expression.<br />
<br />
* Single Sub-Roll Success Example<br />
* <code>{3d20+5}&gt;21</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more.<br />
* <code>{2d6!}&gt;4</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater.<br />
* Multiple Sub-Roll Success Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more.<br />
<br />
=== Failures (B,F) - <code>fCP</code> ===<br />
<br />
Failure checks on groups work just like success checks.<br />
<br />
* Single Sub-Roll Failure Example<br />
* <code>{3d20+5}&gt;21f&lt;10</code> - Roll 3 d20's, for each roll add 5 and then count a success for each result of 21 or more and count a failure for each result of 10 or less.<br />
* <code>{2d6!}&gt;4f1</code> - Roll 2d6 exploding and count a success for each roll of 4 or greater and a failure for each roll of 1.<br />
* Multiple Sub-Roll Failure Example<br />
* <code>{4d6+2d8, 3d20+3, 5d10+1}&gt;40f&lt;10</code> - Roll each of the three sub-roll expression and total them up. Count one success for each sub-roll total of 40 or more and one failure for each sub-roll total of 10 or less.<br />
<br />
[[Category:Docs]]</div>243061https://wiki.roll20.net/Creating_Marketplace_AssetsCreating Marketplace Assets2013-10-05T02:15:47Z<p>243061: /* Dimensions */</p>
<hr />
<div>When creating assets for the Roll20 Marketplace, there are certain guidelines that you should follow in order to provide the best experience for the end-user. While you are free to create your assets using different specifications than those listed here, keep in mind that doing so can lead to degraded performance (and unhappy customers). If you have any questions about creating Marketplace assets, please don't hesitate to [mailto:team@roll20.net contact us].<br />
<br />
== DPI: Image "Density" ==<br />
<br />
The first thing to tackle is making sure that you are working with the proper image density setting. This is a setting that is '''different''' than the dimensions of the image. For Roll20 assets, it should always be set to 72 DPI (also known as "72 Pixels/Inch"). In Photoshop, you can access this setting while creating a new image:<br />
<br />
[[File:Photoshop_Settings.png]]<br />
<br />
You can also access the same setting for an existing image under the "Image => Image Size" menu in the application menu.<br />
<br />
== Dimensions ==<br />
<br />
The other consideration to ponder is the size of the image (labeled "Dimensions" in the screenshot above), and the image format to use. Here are our recommendations for each:<br />
<br />
* '''Tokens''': 280x280 pixels in PNG format, regardless of the "in-game" size of the token. At this image size, the token could be as large as 4x4 squares in-game without any issues, and will support zooming in -- and it will look good on the Marketplace listings page, as well. Do be sure, however, that your tokens are still recognizable/"look good" at smaller sizes (e.g. 70x70 pixels). Note that tokens should "fill" the square without any excess padding, and feature a drop-shadow or other outline to make them easy to distinguish from background elements. For a great example of this in practice, see [https://marketplace.roll20.net/browse/set/61/max-attack-3-monsters-iii].<br />
<br />
* '''Maps''': 140x140 pixels per "square" in JPG format. So if the map is intended to be a 20 square x 20 square room, the map image should be 2800x2800 pixels. If your map is going to be larger than 30x30 squares (4200x4200 pixels), you may want to consider offering one "full" map, and then several different "sub-maps" that can be pieced together in the app to make the full map -- this can improve performance for the end-user.<br />
<br />
* '''Map Tiles''': 140x140 pixels per "square" in JPG format, unless it is an "object" such as furniture or decorations that will sit on top of other tiles, in which case use PNG. Only use PNG when necessary -- it places a much heavier burden on the processing of the end-user's system than JPG. For multi-square (or "room") tiles, you will want to experiment to make sure that any grid lines line up once placed in Roll20. If each of your tiles is only one "square" in-game, then you don't need to worry about this. ''Note:'' Map tiles are the hardest assets to create correctly, so for your first set you may want to try and create tokens or full-scale maps.<br />
<br />
== Putting It All Together ==<br />
<br />
Once you've created your assets, we strongly recommend that you take the time to upload them to Roll20 yourself, and play around with them in-game. How do they look at different zoom levels? For maps and map tiles, how do tokens look placed on top of them? How hard is the map/tile to line up to the grid? Taking the extra time to do this testing will not only help you create better assets, it will help you avoid many common pitfalls such as creating tokens that look good at large resolutions but are unusable in-game.<br />
<br />
Finally, contact [mailto:nolan@roll20.net Nolan] with your finalized assets for further instructions on how to upload them to the Marketplace. We'll also want you to create a "banner" for your set, which is 512x512 pixels and is used as the set's "advertisement" on the site.</div>243061