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

Aiming for Drop down query, is forcing freehand query

Hey there, sorry for all the busy looking pictures, theyre here for evidence. Im attempting to make a nested query, drop down style, but for some reason its forcing it into a freehand and I dont understand why, as a previous macro I made this EXACT same way, but with only 2 options, works just fine. Any idea whats going wrong here? Such an odd issue.
Please post the macros, not just screenshots. 
First issue I see is that you're not using braced macro calls - so testing this as it is doesn't resolve the call, just posts the unresolved call into chat (which might be fine, depending on where you want to use the macro). But if you do add the braces, the full macro resolves inside the query, which then breaks the query because the template contains a right brace that completes the query before it should. Depending on how exactly you want to use this, there's a few ways around the issue - given more information, I could help more. EDIT: I misremembered how collections macros work
The Macros, as requested by Jarren ?{Which Perk?|Pure as Bronze,#Pure-as-Bronze |Chain,#Chain |Technique 70 Feline Felled,#Technique-70-Feline-Felled |Myst Call,#Myst-Call } &{template:default} {{name=@{selected|Token_Name}}} {{ Pure as Bronze Level I - Hunt, Bronzen Excellence - Generate a bronze glowing aura around your body. While maintaining Concentration on this Spell, Spells that are cast on you are also reflected back on their caster. Every turn you spend your Subaction to maintain Concentration on this Spell, you must also spend 8 NRG }} All the additional mentioned macros follow the same template of this one above, but with different text
Tuo said: First issue I see is that you're not using braced macro calls - so testing this as it is doesn't resolve the call, just posts the unresolved call into chat (which might be fine, depending on where you want to use the macro). But if you do add the braces, the full macro resolves inside the query, which then breaks the query because the template contains a right brace that completes the query before it should. Depending on how exactly you want to use this, there's a few ways around the issue - given more information, I could help more. Im not great with any pseudo-code language stuff, so im just aiming for simple stuff, I just want the player to be able to select one of the macros from a dropdown list, then have that macro paste its text in a pretty format into chat
Alright, so looking back at this, there's simpler way to do this - don't have the whole template in the called macros, instead, just the text content. &{template:default} {{name=@{selected|Token_Name}}} {{?{Which Perk?|Pure as Bronze,#Pure-as-Bronze |Chain,#Chain |Technique 70 Feline Felled,#Technique-70-Feline-Felled |Myst Call,#Myst-Call } }} And then reduce &{template:default} {{name=@{selected|Token_Name}}} {{ Pure as Bronze Level I - Hunt, Bronzen Excellence - Generate a bronze glowing aura around your body. While maintaining Concentration on this Spell, Spells that are cast on you are also reflected back on their caster. Every turn you spend your Subaction to maintain Concentration on this Spell, you must also spend 8 NRG }} to Pure as Bronze Level I - Hunt, Bronzen Excellence - Generate a bronze glowing aura around your body. While maintaining Concentration on this Spell,  Spells that are cast on you are also reflected back on their caster. Every turn you spend your Subaction to maintain Concentration on this Spell, you must also spend 8 NRG You must replace the commas with  ,, else the query breaks. Do this with all the individual macros, and it should work.
Tuo said: Alright, so looking back at this, there's simpler way to do this - don't have the whole template in the called macros, instead, just the text content. &{template:default} {{name=@{selected|Token_Name}}} {{?{Which Perk?|Pure as Bronze,#Pure-as-Bronze |Chain,#Chain |Technique 70 Feline Felled,#Technique-70-Feline-Felled |Myst Call,#Myst-Call } }} And then reduce &{template:default} {{name=@{selected|Token_Name}}} {{ Pure as Bronze Level I - Hunt, Bronzen Excellence - Generate a bronze glowing aura around your body. While maintaining Concentration on this Spell, Spells that are cast on you are also reflected back on their caster. Every turn you spend your Subaction to maintain Concentration on this Spell, you must also spend 8 NRG }} to Pure as Bronze Level I - Hunt, Bronzen Excellence - Generate a bronze glowing aura around your body. While maintaining Concentration on this Spell,  Spells that are cast on you are also reflected back on their caster. Every turn you spend your Subaction to maintain Concentration on this Spell, you must also spend 8 NRG You must replace the commas with  ,, else the query breaks. Do this with all the individual macros, and it should work. Ahhhhh i see, right I do recall reading something about some special characters messing up queries. For future use, to you know where I might find a list of all the faulty special characters and their replacement codes?
Geggrald G. said: Ahhhhh i see, right I do recall reading something about some special characters messing up queries. For future use, to you know where I might find a list of all the faulty special characters and their replacement codes? <a href="https://wiki.roll20.net/HTML_Entities" rel="nofollow">https://wiki.roll20.net/HTML_Entities</a> &nbsp;has some of the common trouble-makers - for queries, it's the symbols queries themselves use for their syntax, so braces, pipes and commas can cause problems. But, attribute calls, ability calls and macro calls are resolved before queries, so for example @{attribute} doesn't need html replacements, because it resolves before the query - but if whatever the call brings up has problem characters, those need to be replaced.
The problem is that macros are parsed before queries . ?{Which Perk?|Pure as Bronze,#Pure-as-Bronze |Chain,#Chain |Technique 70 Feline Felled,#Technique-70-Feline-Felled |Myst Call,#Myst-Call } Roll20 reads from left to right, so as soon as it gets to here: ?{Which Perk?|Pure as Bronze,#Pure-as-Bronze |Chain,#Chain&nbsp; It replaces #Chain with the contents of the #Chain macro and the query becomes this: ?{Which Perk?|Pure as Bronze,#Pure-as-Bronze |Chain,&amp;{template:default} As soon as it sees a closing brace, it ends the query. The best approach is to use a&nbsp; chat menu &nbsp;instead. Geggrald G. said: Ahhhhh i see, right I do recall reading something about some special characters messing up queries. For future use, to you know where I might find a list of all the faulty special characters and their replacement codes? You can read about which characters cause nesting issues here . But basically there are three: vertical pipes '|', commas ',', and closing braces '}'.