Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Macro request to turn a roll of a 1 into a 2

Hello all! I did't see this in the Wiki -sorry if I missed it. How can I make a macro similar to "/roll 2d8" but have it treat 1s as 2s?
[[ 2d8ro<1 ]] Corrected: [[ {1d8ro<1 } + { 1d8ro<1 } ]] if you want to re-roll 1s on EITHER d8. Just [[ 2d8ro<1 ]] if it's reroll once for BOTH d8 combined
Thanks Mark but I don't want to reroll a 1. I want it to change a 1 into a 2. Is this possible by use of a macro? If not, no biggie.
1422338697

Edited 1422338753
The Aaron
Pro
API Scripter
@Mark: Statistically, that's not the same as treating a 2 as a one. 1d8ro&lt;1 means you have the following possible rolls: 234567812345678. That's a 6.66% chance of a 1 and a 13.33% chance for each of the others. 1d8 where 1 is treated as 2 has the following possible values: 22345678. that's a 25% chance of a 2, and a 12.5% chance for each of the others. The way to handle this in Roll20 is by creating a Rollable Table with the values 2345678, where each is weighted as 1, except for 2, which is weighted 2. That's actually precisely why I created this script: <a href="https://app.roll20.net/forum/post/950142/script-we" rel="nofollow">https://app.roll20.net/forum/post/950142/script-we</a>... Anyway, that will give you the correct statistically distribution of results.
1422339288

Edited 1422339325
The Aaron
Roll20 Production Team
API Scripter
Another option would be something like (note the use of the d1 so that both terms in { } are dice): [[ ({1d8,2d1}kh1) + ({1d8,2d1}kh1) ]] However, I don't like having to duplicate that whole expression ever time I want to add another die. Rollable Tables can be rolled multiple times and you get a nice sum: [[ 8t[d8min2] ]]
Aaron, I see that once I install your script, I could use commands such as "/r 8t[d12min8]". What would be the command for rolling a d6 but treating 1 as 2s? (I didn't see the pattern in your example command to figure that out...)
1422339756
The Aaron
Pro
API Scripter
That script just automated creating the tables. You type this: !weighted-die 8 2 and it would make a table named d8min2, which you'd roll as: /r 2t[d8min2] or [[ 2t[d8min2] ]]
What does the "2t" in the command do? Also, it looks as if that command is rolling a d8 and then subtracting 2 from it. Is this the case?
1422340872
The Aaron
Pro
API Scripter
2 is the number of things to roll, like in 2d8. t tells it to roll a table. t[ ] is the table selector. d8min2 is the table name. So, it's saying "roll 2 times on the table named d8min2" If you go into the decks and tables tab, you should see a table named d8min2, which has 7 rows, the first of which is 2 with a weight of 2, then 3,4,5,6,7,8 each with a weight of 1.
Thank you Aaron. That helps a lot.
1422378501
The Aaron
Pro
API Scripter
No worries! =D