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

New Roll Query Dropdown ends early on paired braces.

1437671848
Diana P
Pro
Sheet Author
The new roll query dropdown does not respect paired braces ( { } ) and ends early if they are used in a value. I am trying to use the roll query drop-downs to populate roll templates. If I put the query inside the roll template section, the query works as expected but I have to enter the value multiple times to set several sections of the template. &{template:default} {{name=Test Name }} {{ ?{Resistance?|Fortitude , Fortitude check:= [[1d20 +8 ]]|Reflex , Reflex check:= [[1d20 + 6 ]] |Will , Will check:=  [[1d20 +13 ]] } }}  {{notes=?{Resistance Note?|Fortitude, Immune to all poisons|Reflex, (None)|Will, +4 vs fey spell-like abilities; +2 vs enchantment spells/effects; immune to sleep effects} }} If I try to use the query to build the template as such: &{template:default} {{name=Test Name }} ?{Resistance?|Fortitude , {{Fortitude check:= [[1d20 +8 ]] }} {{notes= Immune to all poisons }} |Reflex , {{Reflex check:= [[1d20 + 6 ]] }} |Will , {{Will check:=  [[1d20 +13 ]] }} {{notes= +4 vs fey spell-like abilities; +2 vs enchantment spells/effects; immune to sleep effects }} } The query does not function as a drop-down and ends on the first closing brace even though it is paired with an open brace inside the roll query value.  The value given in the input box for this example is:  Fortitude , {{Fortitude check:= [[1d20 +8 ]] I understand that this might not be a case which was considered in programming the drop-down, but it would be more intuitive if it would parse through the braces and end on the actual closing brace for the query instead of on the first closing brace it finds. Thank you.
1437673573

Edited 1437673872
Wes
Pro
Sheet Author
I just came here as well to post about this, The same issue happens when using the &{tracker} function. Here is my use case: &{template:5eDefault} {{ability=1}} {{title=Dexterity}} {{subheader=@{Walin Silverthistle|character_name} }} {{subheaderright=?{Ability|Initiative|Initiative w/Advantage} }} {{rollname=?{Ability} }} {{roll=?{Rolling|Initiative,[[ 1d20 + @{selected|initiative_overall} [Initiative Mod] &{tracker}; ]]|Initiative w/Advantage,[[ 2d20kh1 + @{selected|initiative_overall} [Initiative Mod] &{tracker} ]] } }} AND THEN.... I got it to Work by replacing the Internal Braces with HTML Entities: &{template:5eDefault} {{ability=1}} {{title=Dexterity}} {{subheader=@{Walin Silverthistle|character_name} }} {{subheaderright=?{Ability|Initiative|Initiative w/Advantage} }} {{rollname=?{Ability} }} {{roll=?{Rolling|Initiative,[[ 1d20 + @{selected|initiative_overall} [Initiative Mod] & { tracker } ]]|Initiative w/Advantage,[[ 2d20kh1 + @{selected|initiative_overall} [Initiative Mod] & { tracker } ]] } }} Not sure if this is standard fair for the majority of Roll20 macro builders though. Edit: LOL I should have realized the code block would eat my Entities! The Internal Braces around tracker & '& # 123;'  tracker '& # 125;'
1437674818

Edited 1437675366
Diana P
Pro
Sheet Author
Ah.  I didn't consider that that might work.  Sure makes the macro look weird and not very readable though.  Thank you for the work-around. edit: Though it didn't work when I saved it as a general macro (on the My Settings tab); the html entity codes get translated back to the braces which then breaks the query parse.  So still an issue, unfortunately.
1437679388

Edited 1437679511
Wes
Pro
Sheet Author
Ahh I see Diana, you were building them into the General Macros.  I was using them in token actions.
1437753729

Edited 1437753736
Riley D.
Roll20 Team
This isn't really a new bug...we didn't change the way that the parser worked for Roll Queries (it's always been "dumb" and would have ended on the first closing curly-brace it found). My guess is no one had a reason to want to use anything that complicated inside of them before the new feature came out? Anywho, I'll add this to the list to look at, but it would require re-writing the parser so it probably wont be able to happen until the next major sprint. Thanks!
1437754897
Diana P
Pro
Sheet Author
Thank you Riley,  I appreciate it.
1437755201
Kryx
Pro
Sheet Author
API Scripter
Not allowing curly brackets basically makes this feature unusable for sheets. :(
Well... rather than thinking of what it Can't do, focus on what it CAN do. It's new functionality than what we had, and queries were never able to replace template formatting anyway. &{template:5eDefault} {{ability=1}} {{title=Save Check}} {{Roll= [[ 1d20 + ?{Save: | Strength, @{strength} | Dexterity, @{Dex} | <etc>    ]]   }} You can use it to select which Knowledge or Skill Check you want to use...  Casting at higher levels... Normal/Advantage/Disadvantage,  Attack modifiers like ColossalKiller or Sneak Attack, etc., etc.
1437766638
Kryx
Pro
Sheet Author
API Scripter
Ah, I see the problem that Diana is presenting now. I thought what you put above wasn't working Mark, but it's the more advanced case of passing params to the roll template.
1437769319
Diana P
Pro
Sheet Author
Yes.  What I was trying is much more advanced than one would usually expect for a query since I can't really expect my players to type something like {{Fortitude check:= [[1d20 +@{fortitude} ]] }} {{notes= Immune to all poisons }} into the input box :D  Heck, I wouldn't expect *me* to type something like that into the query box! That being said, my select-the-save macro *does* work with Wes' html entity code workaround *if* I don't use a General Macro (My Settings) and/or don't try to hardcode it into a character sheet.  It does work as an attribute or an ability on a character sheet and you can even substitute back in the @{fortitude} and @{character_name} settings properly (presumably because those get substituted in the macro before the query gets called). I would prefer to be able to use it without the work-around so I can potentially code it into the character sheets etc.  But I know that re-writing a parser isn't a small fix.  Riley letting me know he can look at it but probably not til the next big update does let me know that it could be worthwhile to see how far I can push with the work-around in the mean time to get the macros working how I want to; if I have 4 months to wait, that's 4 months I might be able to get some cool macros going and it will be easy to "fix" them when Riley gets the parser 'fixed'. Hmm... I spend hours and hours coding character sheets so I have all the information available... and then more hours writing macros so I don't have to open the character sheets while we play.   I might be doing something wrong here... :D  Ah well.  Back to see if I can get that all-in-one weapon macro sorted out.......
1438778322
Kryx
Pro
Sheet Author
API Scripter
Diana - the query thing will work if you replace the & symbols with & amp ; I'm doing this now on my shaped sheet to incorporate a button to allow the user to select individual abilities to roll a save for. See&nbsp; <a href="https://app.roll20.net/forum/post/2159164/post-you" rel="nofollow">https://app.roll20.net/forum/post/2159164/post-you</a>... for specifics
1438794630
Diana P
Pro
Sheet Author
Yeah, I figured that out last night right before I gave up for the night. :)&nbsp; Was pleased to see it only required one layer of nested html entities so far; unknown yet if that will hold true if the sheet gets merged into github and then copied to live; the sheet I'm working on is custom so it won't get pushed to GitHub in it's current state anyway. Still can't get another thing working the way I want, but that's not a part of this.
Riley D. said: This isn't really a new bug...we didn't change the way that the parser worked for Roll Queries (it's always been "dumb" and would have ended on the first closing curly-brace it found). My guess is no one had a reason to want to use anything that complicated inside of them before the new feature came out? Anywho, I'll add this to the list to look at, but it would require re-writing the parser so it probably wont be able to happen until the next major sprint. Thanks! Would it be easier to change macros so you can put the query inside the macro call? So rather than having, ?{Title|Name1, Macro1|Name2, Macro2} you'd have %{character|?{Title|Name1| Name of macro1|Name2|Name of Macro2}.
1439305632
Kryx
Pro
Sheet Author
API Scripter
Not to push my luck after getting single quotes in roll queries(!!!!!), but it would be amazing if double brackets were allowed as well. HTML entities work in some cases, but not in others. Plus they feel really dirty.