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

use twice a roll

1623423874
Divers
Pro
Sheet Author
I have a custom Character Sheet, and I wish I use roll twice. The system is inspired from Degenesis. I want to roll some d6, and count: number of rolls >=4; as successes [numbers of rolls >=6] /2; as critical hits As I have seen in some posts here, I guess I have to go through an API. I have a custom roll template, roll buttons attached to skills. And I don't know where to begin...
1623424194

Edited 1623424208
Divers
Pro
Sheet Author
I will take inspiration from the wiki, and from The Aaron once again :-) <a href="https://wiki.roll20.net/Button#API" rel="nofollow">https://wiki.roll20.net/Button#API</a> <a href="https://github.com/Roll20/roll20-api-scripts/tree/master/WildDice" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/tree/master/WildDice</a> I will post a solution here if I find one.
1623508903
GiGs
Pro
Sheet Author
API Scripter
Just checking on this bit: [numbers of rolls &gt;=6] /2; as critical hits Do you count the number of 6s then halve it? If so, you will have to use an API script. But if you don't halve it, you can do this without an API script.
1623520065

Edited 1623520137
Divers
Pro
Sheet Author
I am&nbsp; not yet completely decided. I expect counting the 6s would roll too many critical success. How would you do this without an API script? Here is my roll which sends "result" to the rolle template. {{result=[[[[@{valeur_competence}+@{itemBonus}+@{modificateur}]]d6&gt;4]]}} I whish I send as well {{result=[[[[@{valeur_competence}+@{itemBonus}+@{modificateur}]]d6&gt;6]]}} But on the same roll.
1623522688
GiGs
Pro
Sheet Author
API Scripter
You use a trick with failure group roll ( on the wiki here ). You can count successes, and count failures. So if you treat rolls of 6 as successes, and count rolls of 1-3 are failures, then add the number of dice you get the right answer. Like so: {{result=[[ {[[@{valeur_competence}+@{itemBonus}+@{modificateur}]]d6}&gt;6&lt;3 + [[@{valeur_competence}+@{itemBonus}+@{modificateur}]] ]]}} or {{result=[[ {(@{valeur_competence}+@{itemBonus}+@{modificateur})d6}&gt;6f&lt;3 + (@{valeur_competence}+@{itemBonus}+@{modificateur})]]}} Both methods work, it just depends how you want the output to look. Imagine you roll 6 dice, and get 1,2,3,4,5,6: Under the rolling-at-table method, &nbsp;&nbsp;&nbsp;&nbsp;you get 3 rolls of 4 or higher, and 1 at 6, giving you 3 +1&nbsp; = 4 successes. Under the failure-calculation method above, you get &nbsp;&nbsp;&nbsp;&nbsp;3 failures, 1 success, and 6 extra successes, which comes to -3 +1 +6 = 4 successes. Same result, by a slightly more convoluted method.
1623523390
timmaugh
Pro
API Scripter
You could do this with a meta script, using tools already available... Plugger has a plugin to get the dice from a roll that match a set of values... In your case, anything over 6. In this case, you'd need Plugger, ZeroFrame (with libInline), and SelectManager. It starts as an API call, but then you process the roll and dump everything out to a roll template using ZF's {&amp;simple} construct. If you're interested in that, I can post an example when I get to my computer later.
1623591036
Divers
Pro
Sheet Author
Thanks GIGs, I will test that :-) timmaugh I am interested in that solution as well. It seems simple to implement.
1623624697
timmaugh
Pro
API Scripter
Here is a basic example with Plugger, ZeroFrame (w/ libInline), SelectManager, and MathOps. These are all meta-scripts. I used MathOps to handle dividing the number of 6s by 2 and have it formatted the same as the Successes. You could do that part as a deferred inline roll (I'll show that in a minute), but then it would display as an inline roll, where the Successes would look like a flat number. So, first example: !&amp;{template:default}{{name=Example Plugger}}{{Base Roll=[[14d10]]}}{{Successes={&amp;eval}getDiceByVal($[[0]] &gt;=4 included count){&amp;/eval}}}{{Criticals={&amp;math floor({&amp;eval}getDiceByVal($[[0]] &gt;=6 included count){&amp;/eval}/2)}}}{&amp;simple} Or, with a deferred inline roll (this would negate the need for MathOps): !&amp;{template:default}{{name=Example Plugger}}{{Base Roll=[[14d10]]}}{{Successes={&amp;eval}getDiceByVal($[[0]] &gt;=4 included count){&amp;/eval}}}{{Criticals=[\][\]floor({&amp;eval}getDiceByVal($[[0]] &gt;=6 included count){&amp;/eval}/2)\]\]}}{&amp;simple} You can see how the Criticals line reports as an inline roll, in this case... when the only reason there was a "roll" there was to accomplish the math. In any case, the important thing to remember is that the getDiceByVal() plugin wants a roll marker to let it know what roll to look at. We feed it $[[0]] because that is the first roll Roll20 will create. Obviously, your example would be pulling attributes from the character sheet, but the principle is the same. Let me know if this doesn't make it clear enough, or if you still need help.
1623682914
Divers
Pro
Sheet Author
Awesome !! That works great ! AND moreover I understand ;-) Thanks a lot. I will modify it to fit my needs (roll template, skill value to get...)