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

Using Table Calls in Query

1614194371

Edited 1614195057
Hey all! I'm trying to use a Table Call command as part of a macro's query. Currently, it looks like this: ?{Choose Option: | Option1, /roll {1t[Opposed-Table]}<6} | Option2, /roll {1t[Opposed-Table]+2} | } The goal is to have the first option be a table call to my Opposed-Table, with other options following afterwards. However, when testing the macro, rather than the first choice in the dropdown being "Option1", there's only one choice, listed as "Option1, /roll {1t[Opposed-Table]}<6}". I need to keep the table call in brackets, since I need it to return characters that support mathematical operations. Since it's missing the ending right curly bracket in the broken option output, I tried adding another, but the problem still persists beyond that. Further, when running "/roll {1t[Opposed-Table]}<6}" as the only choice in the macro, it works out just fine. How can I isolate the "/roll {1t[Opposed-Table]}" so that my query only displays "Option1, Option2, etc" as my query choices? Thanks in advance! EDIT: When setting the table call as Option2 or beyond and using the command "/roll {1t[Opposed-Table]}<6}", it displays, the name correctly, but doesn't roll - rather, it outputs: /roll {1t[Opposed-Table] }
1614195297

Edited 1614195335
Andreas J.
Forum Champion
Sheet Author
Translator
Do something like: /roll ?{Choose Option:|Option 1, 1t[Opposed-Table] |Option2, 1t[Opposed-Table]+2} You're adding extra brackets that messes up things, and linebreaks also causes problems. How the syntax works: <a href="https://wiki.roll20.net/Complete_Guide_to_Macros_%26_Rolls#Roll_Queries" rel="nofollow">https://wiki.roll20.net/Complete_Guide_to_Macros_%26_Rolls#Roll_Queries</a> <a href="https://wiki.roll20.net/Complete_Guide_to_Macros_%26_Rolls#Roll_Table" rel="nofollow">https://wiki.roll20.net/Complete_Guide_to_Macros_%26_Rolls#Roll_Table</a>
As I mentioned, the brackets are necessary, since I need to compare the result of&nbsp;the Opposed-Table call to another value, using the Compare Values functionality (i.e.,&nbsp; /roll {1t[Opposed-Table]}&lt;6}), and that's the only way I've found for the value returned by the table call to be usable by that function.
1614196921
Andreas J.
Forum Champion
Sheet Author
Translator
then try html replacements <a href="https://wiki.roll20.net/Complete_Guide_to_Macros_%26_Rolls#HTML_replacement" rel="nofollow">https://wiki.roll20.net/Complete_Guide_to_Macros_%26_Rolls#HTML_replacement</a>
1614200443
GiGs
Pro
Sheet Author
API Scripter
Andreas is correct. This is a problem with roll20 and queries: Queries end with the first } encountered, and the way you do rolls you need } inside the query. The only way to solve this is to replace each } inside the query, but not the one at the end. Note: If you later add attribute references, like @{selected|strength} the } in those must be left alone.
1614200639
GiGs
Pro
Sheet Author
API Scripter
You have a couple more issues with your code. On this line Option1, /roll {1t[Opposed-Table]}&lt;6} | you have a space after the comma. Everything after the comma is sent to chat, including that space. But for /roll commands, the / must be the first item on the line. So the roll command wont work. Remove that space. Also you have one { and two }, so that line would fail anyway. It should be Option1,/roll {1t[Opposed-Table]}&lt;6 | (and use a html replacement to replace the }).