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

Roll template to show number of dice from Dice prompt?

1588203633
Eric
Sheet Author
Hi all, Working on my character sheet and roll templates, what I am trying to achieve is to have my roll template show the number of dice that the player enters into the popup dice prompt. For example, the value of my roll button is ... value='&{template:skill} {{skill_name=melee}} {{character_name=@{character_name}}} {{successes=[[?{Dice|2}d20sacs<@{Melee_Focus}cf20<[[@{Agility}+@{Melee_Expertise}]]]]}}{{num_dice={???}}}' I use the ?{Dice|2} to prompt for number of dice to roll.  Then I want to get that number back so I can show it in my template. Is this possible? I have as a non-working example the "num_dice" variable that would represent the value passed to the template. I believe this is possible if I were to code an API script to watch for the roll results, but I'm looking for a sheet-contained solution. Thanks! 
1588204531
GiGs
Pro
Sheet Author
API Scripter
You dont need the API for this. Just type ?{Dice} like so: {{num_dice=[[?{Dice}]]}} You can reuse a query, and if the name is spelt exactly, the same value will be used.
1588209487
Eric
Sheet Author
Awesome. Thank you!