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

Any way to nest queries several layers deep?

1525416702

Edited 1525419457
Exactly what it says. I've got a macro I'm trying to set up which, ideally, would ask a series of questions. What School of Magic? - What tier of Spell? - Which Spell? - And then in the default roll template produced by the spell choice: How many Damage Step Increases?/Whatever I need to query for that spell. I know you can nest to an extent by replacing certain characters with their html code, and can then nest a bit further by replacing the ampersand in that html code with the html code for ampersand. The problem is that even at that point the macro I'm ultimately trying to set up goes 2 steps past what I can get to work. The only solution I've managed to come up with is to just keep the spells as each being their own macro and then reference them as #Spell-Name. And while I fully acknowledge that that's probably the simplest and easiest way to do this, it's not the way I want to do it and thus feels like failure. Plus if possible I want it all to be one macro so it's possible to just take it and drop it into a game no fuss. After spending quite some time with this I'm thinking I have no choice but to compromise due to the limitations of the system, but was hoping that someone far better at this than me might know a simple solution that escapes me. EDIT: Hmm, well uh, nevermind. Apparently #Macro doesn't quite work like I thought. It just inserts the actual macro text, so that apparently it's literally no different than just continuing to nest things like I was and still breaks the main macro. Damn.
1525427052

Edited 1525427100
Ziechael
Forum Champion
Sheet Author
API Scripter
It can &nbsp;be done... to a certain extent and with some hoops to jump through. Your best bet is to have all your spells set up as standalone macros but use a nested menu of dropdown queries to send a button to the chat for a player to click on to cast the spell. When you get into the realms of nesting the macro text itself in queries you increase the complexity many times over. Here are a couple of threads where I've discussed this subject at length including examples on how I handle it plus some suggestions for how I'd do it if I were to start over (I'm 3.5 years in now and way too deeply ingrained to redo my system lol): <a href="https://app.roll20.net/forum/post/5148828/can-you-" rel="nofollow">https://app.roll20.net/forum/post/5148828/can-you-</a>... <a href="https://app.roll20.net/forum/post/5982183/3-dot-5d" rel="nofollow">https://app.roll20.net/forum/post/5982183/3-dot-5d</a>...
1525449494

Edited 1525449577
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I'd recommend doing API/ability command button menus. You can nest these (especially ability command buttons) as deep as you want without any need to replace anything. Your final promp, I would leave as a prompt within the macro. Something like this: %{spellSchool} [Abjuration](~char name|abjuration)[Conjuration](~char name|conjuration) %{abjuration} [level1](~char name|level_1_abjuration)...[level n](~char name|level_n_abjuration) %{level_1_abjuration} [barkskin](~char name|barkskin) %{barkskin} &{template:default} {{name=Barkskin}} {{level=1}} {{effect=Causes your skin to grow thick and fibrous, granting you a [[?{empowered|No,1|Yes,2}*floor(@{level}/2)]] bonus to your natural armor class}} Note that all of these should be character abilities. I obviously don't know what system you're using, so the above is just some examples of how it would be set up. EDIT: I'd also look at combining all your levels into a single spell school ability that is just sorted based on level.