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

Stat rolling macro - beyond the basics

Hey all,

I've been trying to figure out a question I was asked and thought would be pretty straightforward. Turns out it's not (for me).

Goal: Roll stats on Roll20, with the 6 resulting numbers sorted. The rasberry seed in my Wisdom tooth is that 9 dice should be rolled, with the 6 highest being kept.

In my trials and searches I've discovered some things (grouping among them).

This will accomplish something similar by just rolling 6 dice and keeping the highest 3 out of each rolled set.

/r [[4d6kh3]][[4d6kh3]][[4d6kh3]][[4d6kh3]][[4d6kh3]][[4d6kh3]]

I can also roll 3d6 X 9 and drop the lowest 3 by doing this (using the grouping I discovered):

/r {3d6,3d6,3d6,3d6,3d6,3d6,3d6,3d6,3d6}dl3

 It can be altered slightly to keep the highest 6. But adding another modifier on the group throws an error.

I know it's possible to put more than one group modifier on rolls, as something like

/r 9d6kh6sa

works perfectly fine to roll 3 d6 and both keep the highest 6 and sort ascending

If I make the original into inline rolls to prettify the output a bit like this:

/r [[3d6]],[[3d6]],[[3d6]],[[3d6]],[[3d6]],[[3d6]],[[3d6]],[[3d6]],[[3d6]]

I then lose the ability to group them - and sort/drop - as far as I can tell.

Can anyone put me out of my misery? Am I missing something key here, or should I walk away?

As always, pointers or helpful input appreciated.


M

June 16 (5 years ago)

Edited June 16 (5 years ago)
Oosh
Sheet Author
API Scripter

I think the sorting only works on individual die rolls, like some other operators.

The default template will automatically sort your rows numerically but only for static numbers, I've not found a way to get it to sort rolls (beyond manually reentering them). See GiGs' post for info on that, but it won't do exactly what you're asking - he's got a screenshot of a typical default template stats roll though, with only 6 stats I'm not sure how essential the sorting is!

Another option would be to use the initiative tracker, which has a sort option. This would require selecting or targeting 6 tokens though, to get 6 values on there, and then clicking again for the tracker sort.


Stay hopeful though, one of the clever people here might know how to trick the roller into making this work.

Oosh,

Thanks for the input. I’ll have a look and keep fingers crossed, thanks!