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

I want to know how many times I got a specific number when I rolled the dice.

1645633734

Edited 1645635715
I want to know how many times I got a specific number when I rolled the dice. The game I play is when I use d6 dice and the number below the target is valid. If you get 1, you'll get an additional point for every number you get. For example If it's 5d6s <4 [1,1,3,4,6] 1, 1, 3, and 4 are successful dice, and two dice with 1 are given an additional damage each, so the total damage should be 6. I looked up the explosion dice, but I think it's a little different because it's not rolling the dice again, but adding one point of damage unconditionally. Is there a way to count only the specific values of the dice through api?
1645639071
Finderski
Pro
Sheet Author
Compendium Curator
Probably, but if you're working with a custom character sheet, you can set up the sheet to do it without an API script by using Custom Roll Parsing.
1645642546

Edited 1645642679
GiGs
Pro
Sheet Author
API Scripter
If I understand correctly, you can do this without the API. Look up failure points . If your mechanic works with 3 different values: failed rolls are worth 0, succesful rolls are worth 1 point, and rolls of 1 give 2 points, you can do it using failure points. The dice roll isnt obvious, but it would be something like this: /roll ?{how many dice|1}d6<1f>5 + ?{how many dice} This method is broken into two steps: first you get -1 point for each die over 4, 0 points fior dice below 4, and 1 point for rolls of 1. Then you add the number of dice rolled, means you get +1 on each die. Together this means you get 0 if rolling above 4, 1 for rolls of 2-4, and 2 for rolls of 1. That sounds like the roll you want. If you want the roll to be a bit prettier, you can use the default roll template: &{template:default} {{name=Name of Roll}} {{roll=[[?{how many dice|1}d6<1f>5 + ?{how many dice}]]}} You can of course do more with the API - look up the ScriptCards script, that's great for custom rolls of all types.
1645658814

Edited 1645659572
Oh, failure dice works. Thank you so much. I thought I should save the number of dice with 1 using api and add it up later, but there was a much easier way. But after testing it, /r 6d6<1f>5+6 If the dice is, If 1, 3, 4, 5, 6 came out, It needs to be calculated as a success, but I think only the numbers except 5 are checked. Can it be used not as big or the same, but only as excess? I can get the target and add 1 from the macro. There's no problem, but I'm curious.
1645663135
GiGs
Pro
Sheet Author
API Scripter
In roll20, the > symbol is the same as >= in normal math. So >5 means numbers of 5 or greater.