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

Drop-down Macro that lists then outputs Macros running RecursiveTable API

1608450344

Edited 1608450886
Ok. Seems like this should be possible but I'm out of my league. I have some rollable tables. I built macros for each of those rollable tables using the RecursiveTable API and included some nice output: MACRO1 !rt /w gm &{template:default} {{rname= Heading for Output }} {{name= Subheading for output }} {{description= The party encounters** [[1t[Name_of_Table-one]]]**. }} ! MACRO2 !rt /w gm &{template:default} {{rname= Heading for Output }} {{name= Subheading for output }} {{description= The party encounters** [[1t[Name_of_Table-two]]]**. }} ! MACRO3 !rt /w gm &{template:default} {{rname= Heading for Output }} {{name= Subheading for output }} {{description= The party encounters** [[1t[Name_of_Table-three]]]**. }} ! Now, what I'd like to do is create a macro that will give me a drop-down listing Macro1 and Macro2 and then when I select the macro, the macro executes and outputs in the nice format. I have the drop-down and the output format but it's not actually executing the selected macro with the RecursiveTable output. DROP-DOWN MACRO This gives me everything I'm looking for except MACRO3 isn't in the list !rt /w gm &{template:default} {{name= Random Encounter }} ?{This Random Encounter|Encounter at-day, #Name_of_Macro-one|Encounter at-night,#Name_of_Macro-two |The Third Encounter-day,#Name_of_Macro-three} ! Now, if I remove the space in front of the pipe for option 3, it's suddenly there BUT, it appears to only be calling the macro associated with option 3 regardless of the choice made from the drop-down. I'm soooo close. But something's still broken somewhere. Arg! Seriously, this feels like voodoo. I removed the !rt and trailing ! a couple of times when stuff broke and put it back in - doing nothing else - and it started working again. I just don't know where to go from here. I can run the macros single but I'm creating a lot of tables and it would be nice to have a single option to choose rather than clutter my screen with buttons.
1608478102

Edited 1608478437
Jordan C.
Pro
API Scripter
Okay, so in your final macro you need a parameter for the result to go to (i.e. {{Description=result}}. Then you need to do some weird stuff to get a button by using this: !rt /w gm &{template:default} {{name= Random Encounter }} {{?{This Random Encounter|Encounter at-day, [Button](!
#Name_of_Macro-one)|Encounter at-night,[Button](!
#Name_of_Macro-two)}}}! This part creates a clickable button that runs the macro:  [Button](!
#Name_of_Macro-one) This can be found in the wiki under "API Command Buttons" Now, since your examples reuses   a lot   of the same functions you can also do something like this: !rt w/ gm &{template:default} {{name=Random Encounter}} {{Description=You encounter [[ 1t[?{Encounter Region|Desert,Desert-Encounters|Arctic,Arctic-Encounters}]]]}} Where the full template gives the output of the encounter results and skips the step of making a macro for each table.
Yeah. See. I knew there had to be a better way to do it. That worked like a champ! I only busted my head against that for about 15 hours. I should have posted this question much sooner. In my defense, I'm a noob at this customizing stuff and trying to learn the ropes. Lesson learned.  Well... THANK YOU!  I have about 10 different random encounter tables for this homebrew concoction I'm working on and this will help me immensely.
1608554608
Jordan C.
Pro
API Scripter
Glad to hear it! And don't sweat it, you'll thank yourself later for taking the time to work through some of the stuff through trial and error. Most, if not all, of the cool tricks on Roll20 are from people experimenting and beating their heads against the wall too!