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 .
×

Is it possible to use a query as a value in a macro?

I'm trying to use this in an inline roll in a macro, but it's not working. The box pops up just fine, and I can enter a number, but it won't take the number. ?{Injuries} I've even tried ?{Injuries|0} to no avail. Am I doing something wrong or is this not possible?
1558852613
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Can you post the whole macro? There are too many possibilities why this may not be working as intended.
1558854114

Edited 1558854268
[[41+(@{target|Source|level|current}-@{target|Target|level|current})*2+floor(1-((@{target|Target|HitPoints|current}-@{target|Target|HitPoints|max}/2)/@{target|Target|HitPoints|max})*60))+?{Injuries}*5+?{Status Effects?}*10]] The macro completes successfully and displays the proper value (When Injuries and Status Effects both =0), but no matter what I put into the Injuries and Status Effects boxes, neither of those values affect the result. I can put 0 or 100 in Injuries and the result doesn't change. The 41 is calibration to make the result equal the external calculator I was using (that was tedious to swap to over and over to manually enter values)
1558930343
vÍnce
Pro
Sheet Author
Maybe try adding additional inline rolls within the macro to separate the attribute rolls and the query. [[ [[ 41 + (@{target|Source|level|current} - @{target|Target|level|current})*2 + floor(1-((@{target|Target|HitPoints|current} - @{target|Target|HitPoints|max}/2)/@{target|Target|HitPoints|max})*60)) ]] + [[ ?{Injuries?|0}*5 + ?{Status Effects?|0}*10 ]] ]]
1558963689

Edited 1558963706
I don't know why that works and the other way didn't, but thank you, it works.
1558982000
vÍnce
Pro
Sheet Author
Fevix said: I don't know why that works and the other way didn't, but thank you, it works. I'm guessing it has something to do with the order of operations , but I'm really not sure. ;-(  Usually I try and isolate my macros into sub-sections using nested inline rolls to make it easier to discern what each roll/modifier is.  You might also consider adding inline labels  to help when hovering over your results in chat.  Cheers