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 .
×
May your rolls be chill this holiday season!
Create a free account

rollBetween() Registering False Criticals

I'm using rollBetween() to check for critical hits for a Pathfinder subsystem. The problem is that it appears to be falsely registering criticals based on the total of the roll, and not just the d20 itself. Here's the code snippets in question: <button title="Weapon attack and damage roll" class="sheet-text-button" type="roll" name="roll_weapon-attack" value="&{template:weapon-attack} {{weaponName=@{weapon-name}}} {{charName=@{character_name}}} {{attack=[[1d20 + @{weapon-attack-bonus} + @{weapon-attack-misc}]]}} {{critConfirm=[[1d20 + @{weapon-attack-bonus} + @{weapon-attack-misc}]]}} {{critRange=[[@{weapon-crit}]]}} {{critMultiplier=@{weapon-crit-multiplier}}} {{damage=[[@{weapon-damage}]]}} {{weaponType=@{weapon-type}}} {{weaponRange=@{weapon-range}}} {{weaponSpecial=@{weapon-special}}}"></button> {{#^rollBetween() attack critRange 20}} The wiki explicitly states that "All helper functions will only check the first inline roll found in a property." Am I doing something wrong here?
RollBetween checks the total of the roll.  So if you roll 1d20+10, that +10 is included in the result.  I ran into this problem when designing a 3.5E weapon attack button.  My attack button uses {{attackRoll=[[1d20cs>[[@{critrange}-1]]+@{attackbonus}]]}}.  I also pass in {{nat20=[[20+@{attackbonus}]]}}as a value so I can check for nat20's using #^rollLess() attackRoll nat20.
Pretty clever solution, Charles. I implemented your approach but changed the nat20 property to accommodate critical ranges by replacing the static 20 with my critical range variable. Works beautifully. Thanks!