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

Nested Macros within Math Conditional

1568078116

Edited 1568079157
I'm trying to convert some of the tables I commonly use into macros. One of them is the Mob Attack table from the DMG. I currently have a macro that queries the armor and attack bonuses and calculates the d20 roll needed to hit. I then want to compare it in order to find how many attackers are needed to hit. I'm using the Conditional Statements from the Useful Macros wiki page to get the marginal increase, then adding them together. When I replace the "x" with my macro (#Mob-Value), it crashes Roll20. I thought it might be the end curly brackets but I can't figure out how to make it all work. This is what my (crashing) macro looks like now: [[{{#Mob-Value ,0}>1}*(1) +{{#Mob-Value ,0}>6}*(1) +{{#Mob-Value ,0}>13}*(1) +{{#Mob-Value ,0}>15}*(1) +{{#Mob-Value ,0}>17}*(1) +{{#Mob-Value ,0}>19}*(5) +{{#Mob-Value ,0}>20}*(10)]] For completion, the Mob-Value macro is: [[?{Armor Class?} - ?{Hit Bonus?}]] Edit: Experimenting, I know it's something with having the double brackets in the Mob-Value macro because if I make it a single query with no math, it works fine. Also, having a "buffer macro" which is called instead of Mob-Value and contains just #Mob-Value, it works with the Mob-Value macro as it is above.
1568133412
GiGs
Pro
Sheet Author
API Scripter
Looks like you're hitting the Advanced Queries issue. Try changing your Mob-Value macro to   [[?{Armor Class?}- ?{Hit Bonus?}]] This will probably make it stop working as an independent macro, but if it works for your big macro above, you can copy that into the macro every where you have the #Mob-Value call. Though in reflextion, it will probably prompt you for armour class and hit bonus for every copy of it. So not sure how well it'll work.