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

Display result value of multiple dice

April 29 (5 years ago)
GiovanniNatale
Sheet Author

Hello , 

I make some specifics actions on my roll dice and I display it. It is ok . 

How to roll ask number of dice separatly ? 

Exemple : ?number d42   ( in hmtl? )  And display only value and no sum ? ( with my template?)


A way to specify They must have different value each other? 


Thanks

April 29 (5 years ago)
GiGs
Pro
Sheet Author
API Scripter
[[?{Number?|1}d?{Die Size?|6}]]

will prompt you twice for the number of dice, then the size of those dice. If you just want the number of dice, you can do

[[?{Number?|1}d6]]

This will ask for the number of d6; just change the 6 to whatever you need it to be.

April 29 (5 years ago)
GiovanniNatale
Sheet Author

Yes, thanks for this part . 

But if I ask for 2 dices 42 , the dice result is  , for exemple 70. 

How can I make , in my template 

foreach dice 

 display value 

end for each 



and more, is there a way to specified that dices result must be different ( no possible having 35 two Times for exemple ) 

April 29 (5 years ago)
Kraynic
Pro
Sheet Author

You would have to use /r instead of an inline roll, but you might try something like sorting dice.  It will still sum them, but will show all the dice rolled individually.

/r ?{Number?|1}d?{Die Size?|6}s

The s is for sorting ascending, and you can sort descending with sd.

I'm not aware of a way to avoid rolling any duplicate numbers, but I haven't looked for one.  If you haven't already, you might want to check out the dice reference page:

https://wiki.roll20.net/Dice_Reference

April 29 (5 years ago)
GiGs
Pro
Sheet Author
API Scripter


GiovanniNatale said:

Yes, thanks for this part . 

But if I ask for 2 dices 42 , the dice result is  , for exemple 70. 

How can I make , in my template 

foreach dice 

 display value 

end for each 



and more, is there a way to specified that dices result must be different ( no possible having 35 two Times for exemple ) 

Sorry, I misread your request (and didnt realise you were rolling d42).

With standard dice rolls:

  • You cant display both the individual dice rolls and the total, without using the /roll method. But the /roll method always displays the sum.
  • There is no way to guarantee that both dice will be separate.

A custom API script could do what you want, but would have to be created.

Another alternative would be to use a card deck. Create a deck with 42 images, and deal 2 cards to people who are rolling. The cards will show different numbers.

April 29 (5 years ago)
GiovanniNatale
Sheet Author

I have a custom roll template : 


<!-- jet de blattes -->

<rolltemplate class="sheet-rolltemplate-blattes">

<!-- blattes: proportion --  3 noires, 18 blanches, 12 bleues, 6 vertes, 3 rouges -->

<div style="height:35px">

        <span class="template-value">

                    {{#rollLess() roll 3}} 

                        <div class="sheet-circle sheet-circle-black"></div><!-- 3 noires -->

                    {{/rollLess() roll 3}} 

                    {{#rollBetween() roll 4 21}}

                        <div class="sheet-circle sheet-circle-gray"></div> <!--18 blanches-->

                    {{/rollBetween() roll 4 21}}  

                    {{#rollBetween() roll 22 33}}

                        <div class="sheet-circle sheet-circle-blue"></div> <!--12 bleues-->

                    {{/rollBetween() roll 22 33}} 

                    {{#rollBetween() roll 34 39}}

                        <div class="sheet-circle sheet-circle-green"></div> <!--6 vertes -->

                    {{/rollBetween() roll 34 39}} 

                    {{#rollGreater() roll 40}} 

                        <div class="sheet-circle sheet-circle-red"></div> <!--3 rouges-->

                    {{/rollGreater() roll 40}} 

                </span>

    </div>


</rolltemplate>


But as you said , The roll keyword give me the sum of all dices... an idea ?