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 .
×

Menus nested within menus

1598105744

Edited 1598106116
Hello everyone, first time poster here. I just started using roll20 and have been having a blast messing around with macros. I am just a dabbler and not terribly knowledgeable but I enjoy the challenge. Anyway, I have been tinkering with creating a macro that will allow me to&nbsp; assemble an Astral Construct (D&amp;D3.5). Everything seems to be working so far but I am having a small issue. Right now the script prompts the user to select a level for the astral construct. Next, to select special abilities from 2 more drop down menus in succession. If the user selects "resistance" as one of their abilities it then prompts to select the type of resistance. Everything works &nbsp;as desired, but for some reason the entire script for the menu shows up in the selection option - "Resistance ?{Type|fire - 5|cold - 5}". Why this shows up in the drop-down yet still functions is beyond me. I've scoured the forums and have tried implementing the proper syntax for nesting but to no avail. Hopefully someone here can help as I've been beating my head on this for days. Here is the problematic snippet. I've only included the level 1 part of the menu, I've also include the ending } so the script will run should you want to test it yourself. The problematic portion is the second special ability menu. &amp;{template:DnD35StdRoll} {{npcflag=true}} {{name=[Astral Construct]( <a href="http://www.d20srd.org/srd/psionic/monsters/astralConstruct.htm" rel="nofollow">http://www.d20srd.org/srd/psionic/monsters/astralConstruct.htm</a> )}} ?{Astral Construct Level|1st,{{Size:= Small &amp;#125;&amp;#125; {{Hit Dice:= 1d10+10 (15hp)&amp;#125;&amp;#125; {{Initiative:= +2&amp;#125;&amp;#125; {{Speed:= 30ft&amp;#125;&amp;#125; {{Armor Class:= 18 (+2 Dex&amp;#44; +5 nat&amp;#44; +1 size&amp;#44) Touch 13&amp;#44; FF 16 &amp;#125;&amp;#125; {{Base Attack/Grapple:= +0/-2 &amp;#125;&amp;#125; {{Attack:= Slam +2 melee (1d4+3) &amp;#125;&amp;#125; {{Full Attack:= Slam +2 melee (1d4+3) &amp;#125;&amp;#125; {{Space/Reach:= 5ft./5ft. &amp;#125;&amp;#125; {{Special Qualities:= ?{Menu A Ability1&amp;#124;Buff&amp;#124;Celerity&amp;#124;Cleave&amp;#124;Deflection&amp;#124;Fly&amp;#124;Improved Bull Rush&amp;#124;Improved Slam Attack&amp;#124;Mobility&amp;#124;Power Attack&amp;#124;Resistance&amp;#124;Swim&amp;#124;Trip&amp;#125;&amp;#44; ?{Menu A Ability2&amp;#124;Buff&amp;#124;Celerity&amp;#124;Cleave&amp;#124;Deflection&amp;#124;Fly&amp;#124;Improved Bull Rush&amp;#124;Improved Slam Attack&amp;#124;Mobility&amp;#124;Power Attack&amp;#124;Resistance &amp;amp;#63;&amp;amp;#123;Type&amp;amp;#124;fire - 5&amp;amp;#124;cold - 5 &amp;amp;#125;&amp;#124;Swim&amp;#124;Trip&amp;#125;&amp;#44; construct traits&amp;#44; darkvision 60 ft.&amp;#44; low-light vision &amp;#125;&amp;#125; {{Saves:= Fort +0&amp;#44; Ref +2&amp;#44; Will +0 &amp;#125;&amp;#125; {{Abilities:= Str 15&amp;#44; Dex 15&amp;#44; Con 0&amp;#44; Int 0&amp;#44; Wis 11&amp;#44; Cha10 &amp;#125;&amp;#125;|}
I think I figured it out. I was missing the "," (&amp;#44;) after the Resistance menu selection. Do I need commas after any drop down entry or just the ones that have more variables following? Like I said I am new to this stuff so if anyone has any suggestions on what I could be doing better I would greatly appreciate it.&nbsp;
1598118945
David M.
Pro
API Scripter
The commas are for when you want the "return" value to be different than the "label" value. ?{Name of Query|Option1|Option2|Option3|Option4|Option5} vs. ?{Name of Query|Label 1, value1|Label 2, value2} examples taken from here:&nbsp; <a href="https://wiki.roll20.net/Macros#Drop-Down_Prompts_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Drop-Down_Prompts_for_Roll_Queries</a>
1598120589

Edited 1598120728
Thanks David, Is that why the text for the next menu options were visible in the selection, ie the problem I was having? Adding the comma seemed to fix it. Is there a way to have the return value be the label+the next selection? I have been referencing that page BTW, hence all the HTML values in the nested menu.. It's been very helpful but a bit cryptic for a newcomer such as myself.
1598126738

Edited 1598126868
David M.
Pro
API Scripter
Lucid said: Thanks David, Is that why the text for the next menu options were visible in the selection, ie the problem I was having? Adding the comma seemed to fix it. Is there a way to have the return value be the label+the next selection? To your first question: I believe so, yes. To your second: if you want to return the label + the value, then you are really just making the label include everything, so no comma needed. In your case, you could replace "Resistance" and the subsequent additional nested query with just the two complete entries "Resistance -5 fire" and "Resistance -5 cold" to simplify things. Nested queries in general are a giant pain. Most people try to avoid them whenever possible, but it's a necessary evil sometimes.
1598134718
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If you run into serious nested query issues, the easy alternative is to build a&nbsp; Chat Menu .
Thanks Keith, I'm looking at that now and trying to see how I could use it in place of what I am doing now. Would this eliminate the need to use the HTML character identifiers or eliminate the need for nesting entirely?
1598202905
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
A chat menu is basically a list of buttons in chat that run different commands. I haven't parsed that impressive macro at the beginning, so I'm not sure what would need to be done. But basically the process changes from a query Choose A-&gt; Do This, B -&gt; Do Something Else to a list of buttons for Do This Do Something Else There is no nesting in the latter.
1598281189

Edited 1598281254
I do believe I get it. What a cool thing! Definitely easier than my current path. I will probably end up using this going forward as the Astral Construct process gets much more complicated after 3rd level in terms of options. I think this is going to save me a lot of work. Thanks again Keith.&nbsp;