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 .
×

Macro query

I have a fairly simple macro /r {?{Number of Dice}d20+4}>?{MinToSucceed} My quick question is it is possible to somehow add another line that takes the number of outputted successes and roll something else? /r {{SUCCESSES}d6+2} Or something like that?
1598955494
GiGs
Pro
Sheet Author
API Scripter
It's almost possible, but very complex, using the Reusing Rolls trick from the Stupid Tricks thread. Here's what it looks like: &{template:default} [[[[{[[{?{Number of Dice}d20+4}>?{MinToSucceed}]],0}kh1]]d6+2]] {{success=$[[0]]}} {{damage=$[[2]]}} The problem is the +2 part. Even if you get 0 success on the "attack" roll, the second roll will always show 2 damage.
1598960111
Oosh
Sheet Author
API Scripter
I feel like there must be a way around that limitation, but it hasn't come to me yet.
1598960530

Edited 1598960548
GiGs
Pro
Sheet Author
API Scripter
Yeah, I puzzled over that for a bit too, and havent been able to come up with one. The problem is the first inline roll has a dice roll, and you need to make the presence of the +2 dependent on the result of the dice roll. But you cant use the same dice roll twice in the same roll. 
1598960959
Oosh
Sheet Author
API Scripter
Oooooh, close! &{template:default} [[{ceil( [[[[{[[{?{Number of Dice}d20+4}>?{MinToSucceed}]],0}kh1]]d6]] /100)*4,4}kl1]] {{success=$[[0]]}} {{damage=$[[2]] + $[[3]] }}
1599000912

Edited 1599001042
Thanks for the replies all I, in the end, just split it into 2 macros: /roll {?{Number of Attacks?}d20s+4}>?{Target AC?} and /roll ?{Successes}d6+[[(2+@{player|pb})*?{Successes}]]+?{Number of crits?}d6 Could you guess it was for managing D&D5e necromancer hordes? There are a few edge cases where it breaks, and I've yet to go to the trouble of adv/disadv, but it's functional enough.
1599004820
GiGs
Pro
Sheet Author
API Scripter
That is a much simpler way to do it, and simpler is often better!