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

Dice rolling question.

1591587650
Senjak
Pro
Sheet Author
Hello! If I type "/roll 3d6k2+5" I can see all of the dice being rolled along with which ones were kept and which ones were dropped.  I also get the total of the roll plus the modifier. Is there a way to do that in a macro that shows the dice in the same way? I've been able to get there part of the way with: &{template:default} {{name=3d6 roll}} {{ Total: [[ [[1d6]] + [[1d6]] + [[1d6]] +?{Modifier|0} ]]            (Dice Rolled $[[0]], $[[1]], $[[2]]) (Modifier ?{Modifier})}} But I haven't figured out a syntax that works if I want to roll 3 dice and keep 2 then add the modifier. Some way to pop all the dice values into a variable that can be used later?  Or am I trying to do something beyond the capabilities of the software? Thanks! Senjak
1591589176

Edited 1591589367
Oosh
Sheet Author
API Scripter
Never mind me, I'm silly. Time to step away from the keyboard. 3d6 roll total is [[ [[3d6kh2]] + ?{Modifier|0} ]], modifier was ?{Modifier}. $[[0]] <===mouse over for dice rolls And mouse over the $[[0]] output to see the what the three rolls were. But if you try to keep the [[3d6]] the kh2 is going to operate on the total rather than the 3 rolls, and break. I'm assuming it's trivial to solve with the API though.
1591589233
GiGs
Pro
Sheet Author
API Scripter
This will let you keep the 2 highest, using the format you gave above: &{template:default} {{name=3d6 roll}} {{ Total: [[ {[[1d6]], [[1d6]], [[1d6]]}kh2 +?{Modifier|0} ]] (Dice Rolled $[[0]], $[[1]], $[[2]]) (Modifier ?{Modifier})}} This version puts the dice in a better layout, i think: &{template:default} {{name=3d6 roll}} {{ Total= [[ {[[1d6]], [[1d6]], [[1d6]]}kh2 +?{Modifier|0} ]]}} {{Dice Rolled=$[[0]], $[[1]], $[[2]]}} {{Modifier=**?{Modifier}**}}
1591589386
GiGs
Pro
Sheet Author
API Scripter
*offers Oosh another hat*
1591589674

Edited 1591589976
Oosh
Sheet Author
API Scripter
Well I'm certainly not lacking fibre in my diet! In my defence, I was actually thinking it was the same problem as I had here .... but it's not because it's a fixed number of rolls. Off to the hat buffet! I'm regretting putting that link in now... do I need to leave room for a second hat?
1591592750
Senjak
Pro
Sheet Author
Thank you!
1591593987
GiGs
Pro
Sheet Author
API Scripter
You're welcome :) Oosh said: Well I'm certainly not lacking fibre in my diet! In my defence, I was actually thinking it was the same problem as I had here .... but it's not because it's a fixed number of rolls. Off to the hat buffet! I'm regretting putting that link in now... do I need to leave room for a second hat? Lol. I hadnt seen that reply. Enjoy your buffet :)