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

Nested Query Question

Hi, this may have been answered already somewhere but I've checked about 30 forum  threads on this issue and none seem to have this exact problem. I'm trying to create a nested query, and I have queries inside the nested macros as well. I can kind of get it to work, but it won't post the results, or if it does, it messes them all up and combines both macros partially for some reason. :/ I'm at a loss on how to fix this. The macro is as follows: &{template:default} {{name=**Viscosity** (Alteration) (Water)}} {{**Duration**=[[2d6+@{level}]]}} {{**Area of Effect**=Touch or Self}} {{**Effect**=?{Which Macro?|Armor Bonus,#Harden|Attack Bonus,#Fluid }}} Now, I saw on the wiki that there should be a space after #Harden, but I tried that and it messes the macro up. For some reason, there's also a third option that reads "0" with the way it is currently set up, but if I remove the space after #Fluid, it goes away, but break the macro even further. Currently, the choice macros each have two queries within them, and I finally got those working right, but now I can't seem to get the finished product to work as even though the options come up, nothing posts to the Effect section. These are the nested macros:  Fluid = Attack has increased by {{?{How many points of THAC0?|0}}}! Syliaris has lost {{?{How many points of AC?|0}}} of AC! Harden = Armor is increased by {{?{How many points of AC?|0}}}! Syliaris has lost {{?{How many points of THAC0?|0}}} THAC0. I tried boxing the functions, but that makes it worse. Could someone please point out where I'm going astray here?
1460506099

Edited 1460506240
Silvyre
Forum Champion
Hi, Seth . Here are links to Advanced Usage for Roll Queries and Roll Query Troubleshooting sections of the Roll20 Wiki, which explain why you're having difficulty getting this to work, and how to fix the issues you're having. Here are some links to forum threads, which demonstrate how to write Advanced Roll Query macros: <a href="https://app.roll20.net/forum/post/3045449/nesting-abilities-within-a-macro" rel="nofollow">https://app.roll20.net/forum/post/3045449/nesting-abilities-within-a-macro</a> Within one of my replies to the above thread , I link to two additional threads, which you may also find insightful, once you've read the Wiki sections linked above. <a href="https://app.roll20.net/forum/post/3102101/pf-pathfinder-sheet-dropdown-attack-query" rel="nofollow">https://app.roll20.net/forum/post/3102101/pf-pathfinder-sheet-dropdown-attack-query</a> <a href="https://app.roll20.net/forum/post/2900058/issue-making-a-nested-query" rel="nofollow">https://app.roll20.net/forum/post/2900058/issue-making-a-nested-query</a> Please let me know if there's anything I can help clarify. Thank you.
I'm not understanding. The errors I'm getting shouldn't even be possible and I'm writing the macro in the abilities of the character, not the macro section, so the replacements thing is just making it worse.
1460508750

Edited 1460508907
Silvyre
Forum Champion
It's probably a good idea to remove the excess doubled curly braces that you currently have placed around your Roll Queries within your Settings Macros (#Fluid and #Harden), as those will interfere with the Roll Template syntax (in a similar way that they would interfere with the Roll Query syntax). After you've done that, could I ask that you please repost the Settings Macros, with care taken to ensure that the HTML entities aren't converted by the forum (i.e. by placing a space within the HTML entities, e.g. & #125; )?
I don't understand the bit about the Settings Macros, or what that is. Also, I'm not using HTML entities because the macro is written in the character abilities and when I tried using them it made it mess up even more than before. Right now I have: &{template:default} {{name=**Viscosity** (Alteration) (Water)}} {{**Duration**=[[2d6+@{level}]]}} {{**Area of Effect**=Touch}} {{**Effect**=?{Which Macro?|Armor Bonus,#Harden|Attack Bonus,#Fluid }} With: Fluid Attack has increased by [[?{How many points of THAC0?|0}]]! Syliaris has a temporary AC of [[?{How many points of AC?|0}+@{Sylaiaris|AC} ]]! and: Harden Armor is increased by [[?{How many points of AC?|0}]]! Syliaris has an effective THAC0 of [[?{How many points of THAC0?|0}+@{Sylaiaris|ThAC0} ]]! Which results in three options: Armor Bonus, Attack Bonus, and 0, none of which ask for more than a single entry and enter the first box from the opposite macro with the first half of the test from the correct macro. Except in the case of 0 which asks for 3 entries and then posts a conglomerate that makes less than no sense.
1460511056

Edited 1460511707
Silvyre
Forum Champion
Seth said: I don't understand the bit about the Settings Macros, or what that is. A Settings Macro (or just "Macro") is a macro that is saved in the My Settings tab of the Sidebar . The&nbsp; call of a Settings Macro consists of that Macro's name preceded by a #. e.g. #Fluid calls the Settings Macro named "Fluid". The value of a Settings Macro is the contents of the Actions field within that Settings Macro's Edit Macro window. The value of #Fluid is "Attack has increased by [[?{How many points of THAC0?|0}]]! Syliaris has a temporary AC of [[?{How many points of AC?|0}+@{Sylaiaris|AC} ]]!" The issues you're experiencing stem from the fact that there exist " problematic characters " within the values of your nested Settings Macros. To resolve this issue, you'll have to: Identify which characters are problematic and which are not, and Subject the problematic characters to character replacements as per Advanced Usage for Roll Queries . Advanced Usage for Roll Queries does a bit to outline which characters are problematic or not, but here's a bit more insight into what is problematic to a Roll Query and what isn't. You might also want to check out this example macro: Example (nesting Roll Queries)
1460512419

Edited 1460512694
[Deleted]
Sheet Author
Tried writing the HTML into the settings macros. It works, but then when I save it, it goes back to the regular symbol, and nothing changes. If anything it's more broke now because every option now asks for three inputs and then butchers their placements. Also, I only found one symbol in each macro I could successfully replace and it was the first vertical bar in the second roll of each them.
1460513077

Edited 1460513135
Silvyre
Forum Champion
Seth said: Tried writing the HTML into the settings macros. It works, but then when I save it, it goes back to the regular symbol, and nothing changes. Ah, good observation. Reopening a saved Settings Macro&nbsp; causes the HTML entities within it to be converted (which would cause the macro that the Settings Macro is nested within to break if that Settings Macro resaved ). This behaviour is not present within macros saved as Abilities , so it may be more convenient to save macros containing HTML entities as Ability Macros. As such, I'll recommend taking the advice of&nbsp; Roll Query Troubleshooting by directly inserting the values [of your Settings Macros] into your Roll Query, replacing their calls . Seth said: Also, I only found one symbol in each macro I could successfully replace and it was the first vertical bar in the second roll of each them. Vertical bars of nested Roll Queries are definitely in need of replacement, so you're definitely on the right track. You'll also want to replace the closing curly braces of nested Roll Queries.
Well, I decided to just make two separate macros out of it instead of making three that wherein I only have to use one.... Maybe one day I'll understand this stuff a bit better, but for now I just have to accept that some stuff is beyond me :/ Thank you for your help and your time.
hi