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 help : Sum kept dice that are above a certain number

1473636422

Edited 1473774069
Hi, I'm playing on Legend of the Five Ring (1st edition), and i'm stuck with a macro i would like to do. Just to explain the rule i'm trying to set with macro : When i do a damage roll on a beast with armor, on the dice i kept from the role, i substract all the dice that are equal or lower than the value of the beast's armor. exemple : Fighting a beast with armor 6. I hit with 6d10!!k3.   My macro so far does : /roll {5d10!!k2-1}>?{armor|6}    or in this case /roll {5d10!!k2-1}>7. I put the -1 on all dice roll so i dont have to put the +1 on the armor value (i tried to do a +1 on the armor part but it kept failing) because the superior is an equal or superior.  What i'm interested in is just having the result (not the number of success) of the dice kept that meets the requirement : Being strictly over the armor value. Thank you for your attention.
1473657275

Edited 1473657319
Andrew C
Marketplace Creator
API seems to be only path to do this. (other than just dropping all the results into a list and manually doing it).
1473662483
Tetsuo
Forum Champion
 Are you rolling the same number of dice each time? 
No i'm not rolling the same amount of dice each time. But i could if i do a custom macro for each player, who mostly do the same attack roll (you can had an extra dice and keep and extra in a few circonstances). Yeah i thought i might have to use Ifs and such to make it work, too bad then :s
Is this close to what you're looking for? /r {[[ 6d10!!k2 ]] + 0d0}>[[ ?{armor|6} + 1]]
1473773536

Edited 1473774234
Silvyre said: Is this close to what you're looking for? /r {[[ 6d10!!k2 ]] + 0d0}>[[ ?{armor|6} + 1]] I think you made a mistake in you position of {  } because when i cc the text in chat it doesnt work. It says it roled the dice, but nothing in chat. After some tests i found a version that works : /r [[{ 6d10!!k2 + 0d0}]]>[[ ?{armor|6} + 1]] Then I tried this a more compact version which doesnt the same apparently.  /r [[6d10!!k2]] > [[{?{armor|6} + 1}]] and the macro worked, but its still the expected results. With 6d10!!k2 there is a good chance i will have the 2 kept dices higher then 6, but when it doesnt it still sums up the two dice, even if one or the two doesnt meet the requirement, and that's not what i wanted. The problem is to sum up the kept dices ONLY for those that are strictly above the armor value. I like the first version which at least tells me how many from the dice kept are good to keep, so we just have to sum the value visually or in a second chat command. The two way i saw this problem solved is : -sort all the dices that meet the requirement then keep the amount of dice we want to sum it (in our test case we keep 2). -keep the 2 higher dices, sort the dices that meet the requirement then sum it. Thanks again for the answer! It helped :) edit : quick question for Silvyre, what are the marker you use to put your macro that way in your answer?
Okay, thanks for explaining the mechanic. There unfortunately does not exist a Compare Point-based dice mechanic for keeping/dropping rolls. You could, however, make things a bit easier by using  Critical Success and Fumble Points and Sorting Dice . For example: /r 6d10!!k2cs>10cf<[[ ?{Armor|6} + 1 ]]sd what are the marker you use to put your macro that way in your answer? Are you referring to the forum's Code formatting? It's an option from the post editor's toolbar (click the ¶ symbol).
1473817878
The Aaron
Pro
API Scripter
See:&nbsp;<a href="https://wiki.roll20.net/Forum_Posting" rel="nofollow">https://wiki.roll20.net/Forum_Posting</a>