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

Imput and Keep Highest

I am wanting to NdX and keep the highest, but I want to be able to tell it the values for number of dice and the dice size. Here is what I tried: {?{Ones}d?{diceSize},2}kh1 But I keep getting the error "Cannot mix sum and M rolls in a roll group" any suggestions?
1562720701

Edited 1562720730
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Assuming I understand correctly, try this: [[?{Ones}d?{diceSize}kh1]]
1562724876

Edited 1562724938
GiGs
Pro
Sheet Author
API Scripter
I think your expression is missing a set of curly brackets, Keith. [[{?{Ones}d?{diceSize}}kh1]] Sans, if you want to set a default, you can use [[{?{Ones|1}d?{diceSize|6}}kh1]] If you want to see the dice rolls /roll {?{Ones}d?{diceSize}}kh1
1562727973
The Aaron
Roll20 Production Team
API Scripter
Actually, I think Keith is right, though I didn't try it. He's doing: [[XdYkh1]] that's "keep the highest 1 number on X dice of size Y" what you wrote was: [[ {XdY}kh1 ]] Which is "keep the highest sum from the group of dice expressions containing a single entry: XdY" which would be the same as just: [[XdY]]
1562729667

Edited 1562729758
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I tested before I posted. If I don't, I tend to wind up forgetting something basic. I do admit that I might not have understood the purpose of the expression though. The ",2" in the formula threw me.
1562766785
GiGs
Pro
Sheet Author
API Scripter
I stand corrected! I forgot you don't need the { } around it here, I'm so ysed to using kh as group rolls. Aaron, the version I did does work, it only operates like a group when you have mutliple roll expressions. For single rolls like this case, it does work as a keep highest roll. So, Sans, the expressions I posted above do work, but you can also simplify them by removing one set of { }, like /roll ?{Ones}d?{diceSize}kh1 as Keith originally posted. Oops!
1562771284
The Aaron
Roll20 Production Team
API Scripter
Interesting!  I'd count that group syntax working differently on a group of one as a bug, but I suppose it would be the only way to get a keep highest on a homogeneous group of die sizes. Wonder if this works: [[ {3d8+5d6}kh1 ]]
1562772291
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That keeps the highest of all of the dice, regardless of die size.
1562772929

Edited 1562772997
GiGs
Pro
Sheet Author
API Scripter
Yes, you need a comma in there to count as a separate group. for example [[ {3d8+5d6, 2d10+5d8}kh1 ]] will sum up each of the two groups separated by a comma, and report the highest group.
1562773067
The Aaron
Roll20 Production Team
API Scripter
keithcurtis said: That keeps the highest of all of the dice, regardless of die size. Cool, that's what I was conjecturing it would do, based on GiGs's response.