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

Simple Dice Macro

I want make a "simple" macro for all dices..... BUUUT i want it inclue all DICE CHOICE FIRST after it another CHOICE for the quantity of DICES and after a CHOICE for put a bonus. I dont want push nothing from the sheets... Maybe is kinda newb for people but i really new in this sorry.... For Now i figure it: &{template:default} {{name=Rolls}} {{  ?{Choice You Dice|  D20, GM Rolls [[d20]]|  D12, GM Rolls [[d12]]|  D10, GM Rolls [[d10]]|  D8, GM Rolls [[d8]]|  D6, GM Rolls [[d6]]|  D4, GM Rolls [[d4]]| }  }}
1677866479

Edited 1677866714
Gauss
Forum Champion
You want to choose the number, type of dice and a bonus? Here is what you need: &{template:default} {{name=Rolls}} {{Diceroll=[[?{Number of dice}d ?{Size of dice|D20,20|D12,12|D10,10|D8,8|D6,6|D4,4}  + ?{bonus}]] }} If you want to have the size of the dice be the first query here you go:  &{template:default} {{name=Rolls}}  ?{Size of dice|D20,20|D12,12|D10,10|D8,8|D6,6|D4,4}  {{Diceroll=[[?{Number of dice}d?{Size of dice|D20,20|D12,12|D10,10|D8,8|D6,6|D4,4} + ?{bonus}]] }}
1677873623

Edited 1677873661
Kraynic
Pro
Sheet Author
That could be streamlined a little bit as well.  This variation makes the dice size display right before Diceroll.  I also added a default number of dice (1), and bonus (0).  You should change those to whatever the most common answer is in your game, because with a default answer you can simply hit enter to go to the next step instead of needing to type in an answer.  This example moves the d in between the number of dice and dice size in Gauss' example into the size of dice answer so that you get that as part of the roll type by moving the first query into the roll template.  The second instance of the query doesn't need any of the answers, because it will automatically use whatever the answer was from the first instance. &{template:default} {{name=Rolls}} {{?{Size of dice|D20,d20|D12,d12|D10,d10|D8,d8|D6,d6|D4,d4} Diceroll=[[?{Number of dice|1}?{Size of dice} + ?{bonus|0}]] }} One note is that I have used a lower case d here.  It works for me in a test game with an upper case D for the size of dice answers.  I am posting the lower case version because I remember someone having trouble with a macro with the upper case, but don't remember whether it had to do with mod/api interaction or what.  So I left this example lower case just in case it ended up being important in your game.
Oow thx guys this is exactly what i looking for...Really thx for the fast and EXPLAIN what is going on with the code... Really thx for the help Gauss and Kraynic !!!