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

Help with a Macro

Can someone help me write a macro for a d6 dice mechanic. This is what I have so far: /em @{selected|token_name} attacks and rolls [[?{Rank|0}d6+?{Bonus Dice}+?{Modifiers|0}]] This lets me select a token, which find's the token's name and allows the user to type in three variables (rank, which is the amount of d6s, the amount of bonus dice, and any modifiers. Now what I want to do is drop the lowest d6's equal to the number of bonus dice. Can I use the same Bonus Dice that was input twice somehow? Not sure if I'm being clear. Thanks ahead of time for any help on this.
1412925024

Edited 1412925129
Gauss
Forum Champion
Here you go: [[{?{Rank|0}d6}dl?{Bonus Dice}+?{Bonus Dice}+?{Modifiers|0}]] I am assuming that "Bonus Dice" is a number rather than additional dice to be rolled. If it is additional dice then you would need: [[{?{Rank|0}d6}dl?{Bonus Dice|0}+?{Bonus Dice|0}d6+?{Modifiers|0}]]
1412928726
Finderski
Pro
Sheet Author
Compendium Curator
Shouldn't Rank default to 1 rather than 0? Can a person roll 0d6 and have bonus and modifiers and succeed? If so, what's the point of rolling at all? Just a thought...and I don't know the dice mechanic, so 0d6 may be completely valid.
GV You right. It does make more sense to default to 1d6 and not 0d6. Thanks Gauss, that almost looks right to me, but maybe I wasn't explaining the mechanic clearly or maybe I'm not understanding the math. Is there a way to drop the number of bonus dice (number of dice, not result) from the total rank + bonus dice. So if I have 4 ranks, thats 4d6, and 2 bonus dice, that's 2d6. I would have 6d6 and the drop the 2 lowest dice (the number of bonus dice). Btw - this is A Song of Ice and Fire Dice mechanic.
1412959337
Finderski
Pro
Sheet Author
Compendium Curator
Then all you need to do is put all the dice (Rank + Bonus) inside a curly brace and end that with dl?{Bonus|0} (the same as the Bonus query). Like this: [[{?{Rank|1}d6+?{Bonus|0}d6}dl?{Bonus|0}+?{Modifier|0}]] I think that works. It seemed to work for me. Because the Bonus query is the same in both instances, it only gets asked once and uses the same value.
Nice. Thanks guys!
1412970285
Lithl
Pro
Sheet Author
API Scripter
{(?{Rank|1}+?{Bonus|0})d6}dl?{Bonus}+?{Modifier|0} should also work, adding Rank and Bonus to determine the number of d6s, rather than Rank d6s plus Bonus d6s. should come out the same.
1412977371

Edited 1412977395
Gauss
Forum Champion
Brian , you cannot sum up the number of dice without using an inline roll to sum them up. Brackets wont work. Example: /r {1+1}d6 will come up as "2" and not roll "2d6". To roll "2d6" it would have to be /r [[1+1]]d6. Ari , G V.'s approach will work.
1412980381

Edited 1412980387
Lithl
Pro
Sheet Author
API Scripter
Gauss, /r {1+1}d6 doesn't work, but /r (1+1)d6 does. It also rounds the result, so /r (1.23+1.45)d6 would roll 3 dice.
1412980761
Gauss
Forum Champion
Doh, I misread your macro Brian, my bad. :)