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

Drop down for number of dice and what type of die?

<a href="https://wiki.roll20.net/Complete_Guide_to_Macros_%26_Rolls" rel="nofollow">https://wiki.roll20.net/Complete_Guide_to_Macros_%26_Rolls</a> I found this page, it's very useful but I'm having a hard time understanding it. I have a learning disability that messes with my ability to comprehend stuff with too many symbols (like math or code). My brain just locks up. I have been trying to figure it out, and I think the answer is there, but I'm not sure, cause I'm just having too hard a time understanding it. What I want to do is make it so that I can put in an attack (in the DnD 5e attacks section on the sheet) or a macro if absolutely necessary, a clicky. You click it, and it asks you how many dice you want to roll (up to 6) and which type of dice to roll (d4, d6, d8, d10, d12). Can anyone help me out? I would be most appreciative.
1628151725

Edited 1628151757
Maïlare
Pro
Sheet Author
API Scripter
Hello, For a macro you can use : /r&nbsp;?{Number of dices}d?{Type of dice} or [[?{Number of dices}d?{Type of dice}]] And if you want to display the result of the macro with a template, you can use : &amp;{template:default} {{name=Dice roll}} {{Roll=[[?{Number of dices}d?{Type of dices}]]}} An example : <a href="https://nsm09.casimages.com/img/2021/08/05//21080510303526049317518413.png" rel="nofollow">https://nsm09.casimages.com/img/2021/08/05//21080510303526049317518413.png</a>
Maïlare said: Hello, For a macro you can use : /r&nbsp;?{Number of dices}d?{Type of dice} or [[?{Number of dices}d?{Type of dice}]] And if you want to display the result of the macro with a template, you can use : &amp;{template:default} {{name=Dice roll}} {{Roll=[[?{Number of dices}d?{Type of dices}]]}} An example : <a href="https://nsm09.casimages.com/img/2021/08/05//21080510303526049317518413.png" rel="nofollow">https://nsm09.casimages.com/img/2021/08/05//21080510303526049317518413.png</a> Thank you, this is useful. Is there a way to make them drop down selections instead of needing to manually enter them?
1628152574
Maïlare
Pro
Sheet Author
API Scripter
Rachel said: Maïlare said: Hello, For a macro you can use : /r&nbsp;?{Number of dices}d?{Type of dice} or [[?{Number of dices}d?{Type of dice}]] And if you want to display the result of the macro with a template, you can use : &amp;{template:default} {{name=Dice roll}} {{Roll=[[?{Number of dices}d?{Type of dices}]]}} An example : <a href="https://nsm09.casimages.com/img/2021/08/05//21080510303526049317518413.png" rel="nofollow">https://nsm09.casimages.com/img/2021/08/05//21080510303526049317518413.png</a> Thank you, this is useful. Is there a way to make them drop down selections instead of needing to manually enter them? Yes but it's not very useful because it makes some problems to calculate. If you begin with the macros it will be very difficult to apllicate.
1628152903

Edited 1628265146
I use this macro which I think would work for you. You specify if the roll is public or private (whispered to the gm) and then you specify the number of dice you want to roll and what type of die. ?{Roll|Public, |Private,/w gm} Rolling ?{Roll|Public, |Private,/w gm} Rolling ?{Number|1|2|3|4|5|6|7|8|9|10}?{Type|D20|D4|D6|D8|D10|D12|D100}: [[ ?{Number}?{Type} ]]
1628153796
Maïlare
Pro
Sheet Author
API Scripter
Sam B. said: I use this macro which I think would work for you. You specify if the roll is public or private (whispered to the gm) and then you specify the number of dice you want to roll and what type of die. ?{Roll|Public, |Private,/w gm} Rolling ?{Number|1}?{Type|D20|D4|D6|D8|D10|D12|D100}: [[ ?{Number}?{Type} ]] It's a good idea. I haven't see the roll macro as this. Thanks for the tip.
1628156187
GiGs
Pro
Sheet Author
API Scripter
If you want the number of dice to be a dropdown too, you can change this ?{Number|1} to this ?{Number|1|2|3|4|5|6|7|8|9|10} Just separate each entry with a |, and end with a }
1628182052
timmaugh
Forum Champion
API Scripter
Also, since you say you have a finite set of choices the players can choose from, you could get the number of queries down to just one by including every combination. Since the query is posed to the player before inline rolls are calculated, you can but the double brackets of the roll query on the outside, and the query can just be the full number and sort of dice: [[?{Choose Roll|1d4|2d4|3d4|4d4|5d4|6d4|1d6|2d6|3d6|4d6|5d6|6d6|1d8|2d8|3d8|4d8|5d8|6d8|1d10|2d10|3d10|4d10|5d10|6d10|1d12|2d12|312|4d12|5d12|6d12}]]
GiGs said: If you want the number of dice to be a dropdown too, you can change this ?{Number|1} to this ?{Number|1|2|3|4|5|6|7|8|9|10} Just separate each entry with a |, and end with a } This is really what I needed, thank you :) Also I was trying to put it in a template like the user above mentioned but I can't figure out how to do that.
1628195396

Edited 1628195434
timmaugh
Forum Champion
API Scripter
Here you go: &amp;{template:default}?{Number|1|2|3|4|5|6}?{Type|D4|D6|D8|D10|D12|D20} {{name=Rachel's Proof of Concept}}{{Roll=[[ ?{Number}?{Type} ]]}} That uses GiGs suggestion for solving your dropdown need (for the number of dice) in a template called "Rachel's Proof of Concept". I reordered the dice to be in ascending order (d4 =&gt; d20), and removed the d100. Mailare had the d20 first, I think in expectation that you would most often be rolling d20s and not the other sorts. If that's what you want, then you can just move it to the start of the list. (And the d100 was removed because you only listed dice up to d20... but obviously that can be added back in, too).
timmaugh said: Here you go: &amp;{template:default}?{Number|1|2|3|4|5|6}?{Type|D4|D6|D8|D10|D12|D20} {{name=Rachel's Proof of Concept}}{{Roll=[[ ?{Number}?{Type} ]]}} That uses GiGs suggestion for solving your dropdown need (for the number of dice) in a template called "Rachel's Proof of Concept". I reordered the dice to be in ascending order (d4 =&gt; d20), and removed the d100. Mailare had the d20 first, I think in expectation that you would most often be rolling d20s and not the other sorts. If that's what you want, then you can just move it to the start of the list. (And the d100 was removed because you only listed dice up to d20... but obviously that can be added back in, too). I genuinely appreciate it, thank you.