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

[HELP] Nested Query Problem

1469875620

Edited 1469875723
Finderski
Pro
Sheet Author
Compendium Curator
I'm trying to a nested roll query and seem to be having some problems. Working on a mechanic where the modifiers are dice—you can either add dice or subtract dice from your roll. I want a query that asks if you need to add or subtract dice and the answers in the drop down menu are: Neither (end of of query and proceed with roll), Add dice (generates another query with a drop down menu), and Subtract dice (generates another query with a drop down menu). The problem I'm running into is that the values of the nested queries are roll template calls. I know to use } to close the curly braces, but that still doesn't seem to be working.  When I remove the roll template call and change them to straight up roll calls (i.e. [[1d10]]) things work flawlessly, but as soon as I put the template structure back in, it falls apart.  Is it not possible to do this, or is there another trick I need besides replacing the problematic characters? Here's the code I have for the macro currently: ?{Add or Subtract Dice?|Neither,0|Add,?{ Add how many? | +1 , {{st5=[[1d10]]}}| +2 ,{st4=[[1d10]]}}{{st5=[[1d10]]}} | +3 , {{st3=[[1d10]]}}{{st4=[[1d10]]}}{{st5=[[1d10]]}} | +4 , {{st2=[[1d10]]}}{{st3=[[1d10]]}}{{st4=[[1d10]]}}{{st5=[[1d10]]}} | +5 , {{st1=[1d10]]}}{{st2=[[1d10]]}}{{st3=[[1d10]]}}{{st4=[[1d10]]}}{{st5=[[1d10]]}}}|Subtract,?{ Subtract how many? | -1 , {{st1=[0]]}} | -2 , {{st1=[0]]}}{{st2=[[0]]}} | -3 , {{st1=[0]]}}{{st2=[[0]]}}{{st3=[[0]]}} | -4 , {{st1=[0]]}}{{st2=[[0]]}}{{st3=[[0]]}}{{st4=[[0]]}} | -5 , {{st1=[0]]}}{{st2=[[0]]}}{{st3=[[0]]}}{{st4=[[0]]}}{{st5=[[0]]}}}} In an effort to make it easier to read, I bolded each drown down item (though not the value) and italicized the pipe (|) and comma (,) that precedes and follows the drop down item (separating the label from the value) Is what I'm trying to do even possible?  EDIT:  Looks like when the question posted it converted the ampersand pound 124; and the ampersand pound 44; to the normal characters...so, just know that I have the correct in my query. :-/
1469892922

Edited 1469893139
Silvyre
Forum Champion
Reformatted for visibility (without HTML entities): ?{Add or Subtract Dice?| Neither, 0 | Add, ?{Add how many?|   +1, {{st5=[[1d10]]}} |   +2, {st4=[[1d10]]}} {{st5=[[1d10]]}} |   +3, {{st3=[[1d10]]}} {{st4=[[1d10]]}} {{st5=[[1d10]]}} |   +4, {{st2=[[1d10]]}} {{st3=[[1d10]]}} {{st4=[[1d10]]}} {{st5=[[1d10]]}} |   +5, {{st1=[1d10]]}} {{st2=[[1d10]]}} {{st3=[[1d10]]}} {{st4=[[1d10]]}} {{st5=[[1d10]]}}     } | Subtract, ?{Subtract how many?|   -1, {{st1=[0]]}} |   -2, {{st1=[0]]}} {{st2=[[0]]}} |   -3, {{st1=[0]]}} {{st2=[[0]]}} {{st3=[[0]]}} |   -4, {{st1=[0]]}} {{st2=[[0]]}} {{st3=[[0]]}} {{st4=[[0]]}} |   -5, {{st1=[0]]}} {{st2=[[0]]}} {{st3=[[0]]}} {{st4=[[0]]}} {{st5=[[0]]}}   } } I see a few issues with the above macro: The first instance of the st4 property is missing a { The inline rolls within the st1 properties within the 'Subtract how many?' Query are missing a [ If you still have issues with your macro after fixing these issues, I suggest reposting the edited macro with the entity placement visible .
1469909176

Edited 1469909314
Finderski
Pro
Sheet Author
Compendium Curator
Those actually should have been there...but here's what I have... Add Dice Query (unmodified): ?{Add how many?|+1,{{r10=[[1d10]]}}|+2,{{r10=[[1d10]]}}{{r5=[[1d10]]}}|+3,{{r10=[[1d10]]}}{{r5=[[1d10]]}}{{r9=[[1d10]]}}|+4,{{r10=[[1d10]]}}{{r5=[[1d10]]}}{{r9=[[1d10]]}}{{r4=[[1d10]]}}|+5,{{r10=[[1d10]]}}{{r5=[[1d10]]}}{{r9=[[1d10]]}}{{r4=[[1d10]]}}{{r8=[[1d10]]}}} Subtract Dice Query (unmodified): ?{Subtract how many?|-1,{{r1=[[0]]}}|-2,{{r1=[[0]]}}{{r6=[[0]]}}|-3,{{r1=[[0]]}}{{r6=[[0]]}}{{r2=[[0]]}}|-4,{{r1=[[0]]}}{{r6=[[0]]}}{{r2=[[0]]}}{{r7=[[0]]}}|-5,{{r1=[[0]]}}{{r6=[[0]]}}{{r2=[[0]]}}{{r7=[[0]]}}{{r3=[[0]]}}} Combined Add Dice and Subtract Dice query (unmodified): ?{Add or Subtract Dice?|Neither|Add,?{Add how many?|+1,{{r10=[[1d10]]}}|+2,{{r10=[[1d10]]}}{{r5=[[1d10]]}}|+3,{{r10=[[1d10]]}}{{r5=[[1d10]]}}{{r9=[[1d10]]}}|+4,{{r10=[[1d10]]}}{{r5=[[1d10]]}}{{r9=[[1d10]]}}{{r4=[[1d10]]}}|+5,{{r10=[[1d10]]}}{{r5=[[1d10]]}}{{r9=[[1d10]]}}{{r4=[[1d10]]}}{{r8=[[1d10]]}}}|Subtract,?{Subtract how many?|-1,{{r1=[[0]]}}|-2,{{r1=[[0]]}}{{r6=[[0]]}}|-3,{{r1=[[0]]}}{{r6=[[0]]}}{{r2=[[0]]}}|-4,{{r1=[[0]]}}{{r6=[[0]]}}{{r2=[[0]]}}{{r7=[[0]]}}|-5,{{r1=[[0]]}}{{r6=[[0]]}}{{r2=[[0]]}}{{r7=[[0]]}}{{r3=[[0]]}}}} And because dealing with all the HTML entities  in a forum post makes my head swim when I have to do triple blocking (because the query requires double blocking already) I'm going to explain how I Find/Replace... Basic Combined Query Structure: ?{Add or Subtract Dice?|Neither|Add,<Add Query>|Subtract,<Subtract Query>} Then, for the the Add and Subtract Queries, I: replace } with } replace , with , replace | with | replace & with & I sure hope this comes out with clarity, because I'm about to just give up. :-p Either way, it sort of works now (since I started replacing the & with the &)...the dropdown shows properly: But if I select either Add or Subtract, the additional query doesn't present itself. Oh—and by the way...both the add and subtract queries function properly by themselves...it's just when I combine them into one query that I have the problem.
1469919467

Edited 1469919829
Silvyre
Forum Champion
Finderski said: Then, for the the Add and Subtract Queries, I: replace & with & At the 'level of nesting' which the Add and Subtract Queries are present on, only the values within those Roll Queries (i.e. the Roll Template properties, etc.) should be subject to this particular character replacement. The problematic syntactical characters that make up the framework of the Add and Subtract Queries should not be subject to this particular character replacement. e.g. ?{Add or Subtract Dice?| will not work, while ?{Add or Subtract Dice?| will. One way to avoid the HTML entity conversions done by the forum is to break HTML entities with a space (e.g. & #125;). i.e. mass Find/Replace "&" with "& " and then post the full macro. Alternatively, I might recommend Pastebin.