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 doesn't seem to know where dropdown starts/stops

I am having an issue where I'm trying to make a macro that does some simple math based on the tarot card I am drawing and whether it is inverted. In short, if I draw a tarot card 1-10 and it is right side up, I want it to do an equation of: 21 - # of card. If I draw a tarot card 1-10 and it is upside down, I want it to do the equation of: # of card. This is what I have: ?{Inverse?|No,[[21 - ?{Card Amount?}]] |Yes,[[?{Card Amount?}]] } So it SHOULD have a dropdown of yes or no, and depending on that answer, it should ask what number card I have and either return that number, or subtract it from 21. Technically I shouldn't HAVE to make this macro as it's a very simple logic to follow in my head, however it'd be nice to make it into a working macro so the presentation of the data to my DM isn't just my verbal confirmation of what I rolled. What I am getting instead of the yes/no dropdown is this: which is problematic. How do I fix this to make it do what I am intending it to do? It seems like such an easy problem yet I've been messing with it for an hour.
1609965589

Edited 1609965604
Jordan C.
Pro
API Scripter
You have nested queries which you can read more about in the wiki here . You would need to escape the right curly braces in the queries inside of the main query so here is what you would need - ?{Inverse?|No,[[21 - ?{Card Amount?}]] |Yes,[[?{Card Amount?}]] }
Thank you so much! Nested Queries are a little hard for me to wrap my head around so I apologize for taking your time. I'm glad you were able to help me, though!
1609966157

Edited 1609966181
Jordan C.
Pro
API Scripter
No need to apologize! That's what the forum is for.  The wiki is decent at explaining it, but if it helps any the main thing you want to do is make sure the outer most query is not terminated by something else inside of it. In your case, the query thought the right curly brace from the first card amount question was where you wanted it to end resulting in this as the first answer: No,[[21 - ?{Card Amount? Going by that, you can usually tell that is the character following "Amount?" is the culprit so that would be the one that needs escaping. (repeat the process for the next nested query, etc.) It helps a lot to copy paste the macro code into a text editor to see everything at once as well once they get larger.