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

Comparing Against a Negative Number

[...other stuff...] {[[1d20}]],-1}>[[-1]] [...other stuff...] returns: Expected [0-9] but \"-\" found. As long as my right-side comparison is >= 0, the HTML macro works. But it the comparison drops below 0, it dumps on the "-" sign. Note this works in the User Macro on the sheet's 3rd tab, but it does not work in the character sheet. Here's the full inline macro if you're interested. Everything works except as described above. <button type="roll" style="height: 18px; text-align: right;" name="roll_attack" value="&{template:default} {{name=Agility Task Roll}}{{Base Difficulty/Target#: [[@{task_level}]]/[[@{task_level}*3]]}}{{Mod Difficulty/Target#:  [[(@{task_level}+@{task_mod})]]/[[@{task_level} * 3 + @{task_mod} * 3 + @{target_adjustment}]]}}{{Agility Total: [[ @{agility_bonus} + @{agility} ]]}}{{Final Target Number: [[ @{task_level} [Task Level] * 3 + @{task_mod} [Task Mod] * 3 + @{target_adjustment} - (@{agility_bonus} + @{agility}) ]]}}{{?{Task Type|Normal,Normal Task Roll [[ 1t[[[ {[[1d20|Advantage,Task Roll with Advantage [[ 1t[[[ {[[2d20kh1|Disadvantage,Task Roll at Disadvantage [[ 1t[[[ {[[2d20kl1}]],-1}>[[@{task_level} [Task Level] * 3 + @{task_mod} [Task Mod] * 3 + @{target_adjustment} - (@{agility_bonus} + @{agility}) ]] ]]] ]]}}{{Roll: $[[6]]}}"></button>
1659128868
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm, interesting issue. You could reverse the comparison. Here's a simple example: [[{-1,100}<[[1d20]] ]]
1659149481
GiGs
Pro
Sheet Author
API Scripter
There was a similar problem with Rolltemplate helper functions which was recognised as a bug. You should probably raise this in the bug forum.
I reworked my plan to utilize {0, [[-X]]}kh1. What a annoying workaround. And I'll head to the bug forum now. Thanks, y'all!