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

quick question on macro order of operations.

I am familiar with PEDMAS, but when I try to use the below macro it does not output correctly. !power --name|Damage Calculator --Total:|[[floor(?{damage|0}-?{Damage Reduction|0}*?{Damage Type})]] so the above has the issue where it multiplies the damage reduction by what ever you put in the damage type. I understand why it's doing that. and presents it on a power card. I tried this: !power --name|Damage Calculator --Total:|[[floor((?{damage|0}-?{Damage Reduction|0})*(?{Damage Type}))]] and it outputs the number correctly But Does not output a powercard. why would the small change between the two cause that?
1499269410
The Aaron
Pro
API Scripter
I have no idea, but check the javascript console when you execute it.  Using a Roll Query has a bug that causes any errors from an inline roll to be printed to the error console, rather than the chat.
javascript console.... that's the API output console correct? if it is, no error appears there.
1499270026
The Aaron
Pro
API Scripter
No, the browser Javascript Console.  Usually accessed via the Developer Tools.  In Chrome, you can find it under View->Developer->Javascript Console.
hmm, I think I'm looking at the correct thing, but I am not seeing any errors.
1499273389
The Aaron
Pro
API Scripter
Probably you need to add a default case: !power --name|Damage Calculator --Total:|[[floor((?{damage|0}-?{Damage Reduction|0})*(?{Damage Type |0 }))]]
ahh I see. Thanks alot The Aaron! That works perfectly!
1499274296
The Aaron
Pro
API Scripter
Cheers!  Happy Rolling!