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

Macro debug help please

So, here's the macro in question. @{who-combat} Result: [[1d20 + @{bonus} + ?{Defensive Attack? -5 Accuracy, +5 Defense|No, 0|Yes, ?{Modifier? 1-5}} + ?{Power Attack? -5 Accuracy, +5 Damage|No, 0|Yes, ?{Modifier? 1-5}}]] The goal is to make it so I can choose if I'm using normal, Defensive, or Power Attack, and then letting me choose how steep the modifier is (from -1 to -5 for the Attack roll in this case). Problem is, I get this as the output: Kevin Barnet's Result: 1d20 + 6 + 0} + -5 = (9)+6+0 (which for the record equals 15) This only happens if I try to make it a Power Attack. Defensive Attack works properly. I have tried removing a bracket from Defensive Attack, but then I cant set modifiers for it and it bugs the rest in the opposite way :/ It's completely ignoring the modifier for Power Attacks. Help? Also, is it possible to make it add "Power Attack" or "Defensive Attack" to the output?
1507551386
Ziechael
Forum Champion
Sheet Author
API Scripter
You are running into the nested query issue, the first } seen by the query effectively ends it (unless it is part of an attribute call). Check out the  wiki for details and feel free to ask any further questions here as it is a mighty mountain to climb... although once you get started the pitons known at the community will get you to the summit!
Well, that at least fixed the stupid bug :/ No way to do the last part of my question, is there?
Adran06 said: Well, that at least fixed the stupid bug :/ No way to do the last part of my question, is there? AFAIK not without adding a second roll query at the end asking the same question or with API.
1507561717

Edited 1507561845
Ziechael
Forum Champion
Sheet Author
API Scripter
Sorry didn't see the second question, this will add a label to that part of the roll when you hover over the result (the tool tip)... also as it stands if you do both a defensive and power attack it would use the same modifier for both, assuming these can be different you'll need to change the query name: @{who-combat} Result: [[1d20 + @{bonus} + ?{Defensive Attack? -5 Accuracy, +5 Defense|No, 0|Yes, ?{DA Modifier? 1-5} [Defensive Attack]} + ?{Power Attack? -5 Accuracy, +5 Damage|No, 0|Yes, ?{PA Modifier? 1-5} [Power Attack]}]]
Ziechael said: Sorry didn't see the second question, this will add a label to that part of the roll when you hover over the result (the tool tip): @{who-combat} Result: [[1d20 + @{bonus} + ?{Defensive Attack? -5 Accuracy, +5 Defense|No, 0|Yes, ?{Modifier? 1-5} [Defensive Attack]} + ?{Power Attack? -5 Accuracy, +5 Damage|No, 0|Yes, ?{Modifier? 1-5} [Power Attack]}]] That is awesome. Thanks for the help!