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

Adding Dices to Roll

Is there a way to actually add dices to a certain dice pool in a macro without using the API? For example, I need to roll an amount of dice equals to the sum of two different numbers that can be inputted by the player. Something like this:  /em attacks! No. of Successes: [[ ?{Atribute1|0}+?{Atribute2|1}d?{Die Size|1d8,8|1d10,10|1d12,12}+?{Modifier|0}s>?{Difficulty|8}]] The idea is that you can input both Atribute1 and Atribute2, they'll be added to reach a number of dices that will be rolled according with the die size selected and added to a modifier. Each of those dices will be compared to the difficulty set and the resulting roll in the chat will show how many dices plus modifiers reached the difficulty. I actually was able to do this roll using two macros, one for the size of the dice pool, another for the rest of  the roll, like this: #dicepool macro: [[?{Atribute1|0}+?{Atribute2|1}]] /em attacks! No. of Successes: [[ [[ #dicepool ]]d?{Die Size|1d8,8|1d10,10|1d12,12}+?{Modifier|0}s>?{Difficulty|8}]] The only thing is that, while using this method does makes the rolls the way I want, the resulting chat message would show the total of all dices rolled, not the amount of successes reached between each dice. I know it's a confusing concept, and I'm sorry if I couldn't be more eloquent, as English isn't my first language. Thanks for your time.
1453901774

Edited 1453901894
[[ (?{1st Attribute|1} + ?{2nd Attribute|1})d?{Die|1d8,8|1d10,10|1d12,12} + ?{Modifier|0}s>?{Difficulty|8} ]]
Thanks for the reply, HoneyBadger! Well, using parenthesis, I can reach the same results of adding a second macro: While it rolls just as I want it to, it still overrides the conditional success. For example, if I roll a fixed amount of dice, it'd show like this: No. of Successes: 1 [Rolling {2d8s+2}>8={(4+6)+2}] If I use the sampled code to do the same roll, it shows like this: No. of Successes: 12 [Rolling {(1+1)d8s+2}>8={(4+6)+2}] And I'd want the first example with the adding operation before rolling. As you can see, the second kind of macro adds the modifier only once, but I don't think it actually matters to the success testing, as the first one works as expected (adding 2 to 6 before comparing, in this case).
1453903847
Lithl
Pro
Sheet Author
API Scripter
There is no means in the dice engine to add a modifier to each of a variable number of dice, and then compare each of those totals to a difficulty.
Ah, I see what I did wrong now. Number of Successes: [[{(1+1)d6+0}>1]] Just replace the numbers with your roll queries.
Brian said: There is no means in the dice engine to add a modifier to each of a variable number of dice, and then compare each of those totals to a difficulty. It sure looks like this one is working that way.
Thanks for both answers! HoneyBadger, now it worked perfectly! Thanks for the help, I wasn't aware of the use of parenthesis for this kind of operations and, with this structure you've written, it worked as a charm. Brian, as far as my testing goes, this code actually does what I meant to do! This was the rolls resulted from the updated code: No. of Successes: 1 [ Rolling {(2+1)d8s+2}>8 = {(1+5+7)+2} ] No. of Successes: 4 [ Rolling {(3+1)d8s+2}>8 = {(6+7+7+8)+2} ] As you can see, it adds +2 to each rolled dice and for those that reach 8, it marks a success. The only success in the first roll was 7+2=9, while each dice in the second roll, plus 2, reaches 8. Just as I wanted to. Thanks for your help and have a nice day!
You could also do d8scf0cs100 to prevent the green, red, and blue highlight around the inline rolls.