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

Weird problem with simple algorithms

1543821896

Edited 1543822067
Richard T.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
It was reported to me that some of my combat rollers weren't including penalties from wounds and fatigue. So I took a quick look at the roller and all the numbers show up... they just aren't being calculated.  This is what's showing up when I hover.  It's picking up the -5 modifier at the end but its not reflected in the result.  Additionally, the problem is only showing up in my combat rollers and not in my standard skill rollers.  When I compare the two bits of code...  Combat Roll {{attack= [[@{Atk} + 1d10 + @{wound_total} + @{Fatigue} + ?{Attack_Modifiers}]] }} Ability Roll {{result0=[[ 1d10 + @{Ability_Score} + @{Ability_Puissant} + @{Ability_Characteristic} + @{wound_total} + @{Fatigue} + (?{Circumstantial|0})]]}} ... am I missing something?  If you need to crack open the full sheet, here's the  github link
1543831068

Edited 1543831550
Andreas J.
Forum Champion
Sheet Author
Translator
Could it be that the '+-5' isnt valid for counting? In the stealth example, does the '+-2' still register while the '+-5' doesn't? Edit:  I noticed you have a trailing plus sign in the first example, that one is probably smart to remove or something. In the second ecample jou at least have a number after the last plus sign. Edit2:  in the first example you should probably make the Attack modifier query default to zero just to be on the safe side, your second example at least does so.
1543849768
GiGs
Pro
Sheet Author
API Scripter
+-2 and similar calculations should work, and it looks like they do work in the second example. Andreas might be right about the default value for the circumstantial attack query. I'd try setting that. Also the attack template doesnt have a space after the [[, which shouldnt matter but I've seen oddities with spaces in roll20 in macros before, so i always leave a space between the [[ and ]], like so: {{attack= [[ @{Atk} + 1d10 + @{wound_total} + @{Fatigue} + ?{Attack_Modifiers|0} ]] }}
1543859482
Richard T.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
Thanks guys, turns out its the lack of a default value on the query-modifiers, its somehow eating the other numbers (?)
1543860873
GiGs
Pro
Sheet Author
API Scripter
Good to know! Its probably due to people clicking enter without entering a number, and the non-numerical entry (even if its empty) messes the calculation up.