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 Abilities in Roll Querries

I'm working to migrate my 3.5 local group to Roll20 after some scheduling issues. I'd like to try and "flatten" some of the skills and spells down to fewer buttons, but the abilities don't seem to trigger from within a roll querry. ?{Which Spell?|Message,%Message |Daze,%Daze } Gives me a drop down menu to select spells but only prints "%Message". I'd like to create an ability for each spell and then another ability to group them under spell level. Any insight into this issue would be much appreciated.
1567953640

Edited 1567953726
GiGs
Pro
Sheet Author
API Scripter
This should be a sticky, it comes up so often. You are running into the html replacement error described here:&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> If you have a macro like this: ?{Which Spell?|Message,%Message |Daze,%Daze } roll20 does several things when running that. The very first thing is to expand any macro or ability calls and replace them in the text, So if %Daze contained&nbsp; /roll 1d20+@{daze} the macro above will become ?{Which Spell?|Message,%Message |Daze, /roll 1d20+@{daze} } and if %Message contains ?{Enter message to print out} the macro will become ?{Which Spell?|Message,?{Enter message to print out} |Daze,/roll 1d20+@{daze}} Once that's done, roll20 will try to run the macro. And at this point it will hit a snag. Roll20 doesnt recognise nested queries, so will end at the first } it encounters. Which means, all it actually runs is this: ?{Which Spell?|Message,?{Enter message to print out} And this is not a working macro, so it fails. You have only two options when trying to create macros like this: 1) forget calling other macros from your query. Instead, copy the contents of each macro into the query, and then go through the article i linked above, and figure out which characters you need to replace with a html entity, to get it to work. If you macros are complex, you will lose hours and a lot of hair trying to get it working. You might even succeed, Crazier things have happened. Sometimes. 2) use a chat menu instead of a dropdown query, as described here:&nbsp; <a href="https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones/?pageforid=5927072#post-5927072" rel="nofollow">https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones/?pageforid=5927072#post-5927072</a> I strongly encourage the latter. You can keep using your existing macros and abilities, you just print a handy set of buttons to chat and click the one you need to use.
You can't call abilities/macros from within a query;&nbsp; the interpreter doesn't translate that deep.&nbsp; In order for this to work you would have to replace %message, %daze, etc.&nbsp; with the actual macro text of the abilities. (Using HTML replacements for }} | , etc).
1567954571
GiGs
Pro
Sheet Author
API Scripter
MarkOfTheDragon said: You can't call abilities/macros from within a query;&nbsp; the interpreter doesn't translate that deep.&nbsp; In order for this to work you would have to replace %message, %daze, etc.&nbsp; with the actual macro text of the abilities. (Using HTML replacements for }} | , etc). Actually you can call them within a query, it's just very likely that you'll hit a problem, so it's a good idea to avoid it and build your queries independently.
GiGs said: This should be a sticky, it comes up so often. You are running into the html replacement error described here:&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> If you have a macro like this: ?{Which Spell?|Message,%Message |Daze,%Daze } roll20 does several things when running that. The very first thing is to expand any macro or ability calls and replace them in the text, So if %Daze contained&nbsp; /roll 1d20+@{daze} the macro above will become ?{Which Spell?|Message,%Message |Daze, /roll 1d20+@{daze} } and if %Message contains ?{Enter message to print out} the macro will become ?{Which Spell?|Message,?{Enter message to print out} |Daze,/roll 1d20+@{daze}} Once that's done, roll20 will try to run the macro. And at this point it will hit a snag. Roll20 doesnt recognise nested queries, so will end at the first } it encounters. Which means, all it actually runs is this: ?{Which Spell?|Message,?{Enter message to print out} And this is not a working macro, so it fails. You have only two options when trying to create macros like this: 1) forget calling other macros from your query. Instead, copy the contents of each macro into the query, and then go through the article i linked above, and figure out which characters you need to replace with a html entity, to get it to work. If you macros are complex, you will lose hours and a lot of hair trying to get it working. You might even succeed, Crazier things have happened. Sometimes. 2) use a chat menu instead of a dropdown query, as described here:&nbsp; <a href="https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones/?pageforid=5927072#post-5927072" rel="nofollow">https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones/?pageforid=5927072#post-5927072</a> I strongly encourage the latter. You can keep using your existing macros and abilities, you just print a handy set of buttons to chat and click the one you need to use. Awesome thank you so much I'll look into using chat buttons to slim everything down. So far I've just been using the google doc I found here on the forums for macro's, only just getting into writing my own.