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

rollBetween doesn't trigger

1595287763
Marco M.
KS Backer
Sheet Author
API Scripter
Compendium Curator
So I'm using pug to generate the sheet code (because I have inherited the sheet and because it's honestly easier to code), now I have a problem with the roll template and I don't understand what happened. I've been asked to use a d100, the system is  1d100 roll below, and the critical/fumbles are matching numbers (01,11,22,33,44,55,...), for simplicity I just decided to do something like  if dice==1     crit if 2<=dice<=10     success if dice==11     crit if 12<=dice<=21     success ... The real code looks like this: {{#rollTotal() dice 1}} <div class="sheet-template-row"><span class="inlinerollresult">Critical</span></div> {{/rollTotal() dice 1}} {{#rollBetween() dice 2 10}} <div class="sheet-template-row"><span class="inlinerollresult">Success</span></div> {{/rollBetween() dice 2 10}} {{#rollTotal() dice 11}} <div class="sheet-template-row"><span class="inlinerollresult">Critical</span></div> {{/rollTotal() dice 11}} {{#rollBetween() dice 12 21}} <div class="sheet-template-row"><span class="inlinerollresult">Success</span></div> {{/rollBetween() dice 12 21}} Now, what I don't understand is why the roll always get all the critical, but it fails to recognize all the roll between. Any idea what the problem could be?
1595288385
Marco M.
KS Backer
Sheet Author
API Scripter
Compendium Curator
Found the problem: /rollBetween() dice don't leave double space, I leave it here in case someone else could find it useful
1595305627
GiGs
Pro
Sheet Author
API Scripter
Thanks for posting the solution. Its handy to know.