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

Trouble with a nested macro involving multiple tables and commands. Some guidance would be greatly appreciated.

I am slowly trying to wrap my head around creating macros, and the project I set myself on was a custom 3-step rollable table setup (tavern name and brief, ad-libbed description)  that would be whispered to GM, roll for one of 5 name conventions (Adjective + Noun, Noun + Noun, Adjective + Noun with a descriptive title, like bar, club, inn, etc.), and then provide clickable options for each naming convention, which would provide the name of the tavern and lead to the third step -- the ad-libbed description. To give you a better idea of what I'm trying to do, here it is broken down: Whisper GM and roll the following table. /w gm &{template:npcaction} {{rname=Tavern Name Generator}} {{name=Select the following name convention ( [[1t[TavNameConv]]] ), or choose from the list below}} Whisper GM again and Provide a list of the following tables to roll from: TavAdjNoun, TavNounNoun, TavAdjNounTitle, TavNounANDNoun, TavAdjTitle. This is where I'm stuck at the moment. The snippet above works flawlessly and displays the naming convention just fine, but anything I put after comes out blank. Roll from the tables associated with the selected naming convention; roll from additional tables to generate an ad-lib one-two sentence description; whisper both results to GM. This step will be worked on later. Initially, I'd wanted to do this all in one step, but after some reading, I ran into my first issue; the system can't call back to a previous result and use it to perform an action. So, I reasoned that having it suggest a naming convention as part of a nested macro with a list of the available naming conventions would be a nice compromise, but I ran into issues with that as well. After a little trial and error, I found that having it perform a second whisper did in fact work and the npcaction template was displayed properly, but I can't seem to get it to display the list of naming conventions, as you can see below. The commands that do work up to this point are: /w gm &{template:npcaction} {{rname=Tavern Name Generator}} {{name=Select the following name convention ( [[1t[TavernNameConvention]]] ), or choose from the list below}} /w gm &{template:npcaction}{{rname=Generation Methods}} Everything after {{rname=Generation Methods}} seems to fail. I suppose my first question should be, is this too ambitious a project, or simply beyond what the system can handle without the API? If not, are there any known bugs I should be aware of that could be potential challenges in making this work? Secondly, I'm clearly missing something, but I'm not entirely sure where else to look at this point, so, if you can think of anything that could shed some light on whatever I'm missing, I'd definitely appreciate it. Between the wiki, video tutorials (yes, even Cody's Taking20, Roll20 Master Series) and, trial and error, I'm just finding myself more frustrated -- I can get a nested die-roller working, and the basic concept behind its execution is similar in my mind, but I haven't had much luck so far. Finally, is what I have so far . . . 'too clunky'? Could it be streamlined a bit? Thank you in advance. Your time and insight are greatly appreciated.
1587025271
Ziechael
Forum Champion
Sheet Author
API Scripter
What does the full macro currently look like? You've only given us the bits that work so guessing at what the problem might be is a bit tricky ;)
I can't find the thread but once ago, a user found a way to generate random names using rollable-tables. Don't know if it will be of any help but you'll find below what I remember of the thread: Rollable tables: [Color]: Blue, Red, Green, Black [Verb]: Prancing, Bathing, Laughting, Sleeping [Animal]: Porcupine, Horse, Badger, Squirrel [Type]: Inn, Pub, Cellar, Castle [Description]: A good place to live, A dull place, An abandoned house macro: /w gm &{template:npcaction} {{rname=[[1t[Color]]] [[1t[Verb]]] [[1t[Animal]]] [[1t[Type]]]}} {{name=[[1t[Description]]]}} You can add more descriptions by creating more tables and select the table to roll when invoking the macro. The tables may be useful if you want a firm grasp on the description part (to reflect how gloomy or wealthy a particuliar place is for example): {{name=?{Description, select rollable-table |[[1t[Description_Dangerous]]] | [[1t[Description_Safe]]] | [[1t[Description_Wealthy]]] }}}.
Ziechael said: What does the full macro currently look like? You've only given us the bits that work so guessing at what the problem might be is a bit tricky ;) You're absolutely right, and that's what I get for writing for help at half-past midnight lol. I didn't think to save a snippet of what I'd tried, but my last attempt was pretty darn close. On a lark, I pulled up a random github I'd found in a google search and saw my mistake staring me in the face.  Here is the solution: /w gm &{template:npcaction} {{rname=Tavern Name Generator}} {{name=Select the following name convention ( [[1t[TavernNameConvention]]] ), or choose from the list below}}  /w gm &{template:npcaction} {{rname=Tavern Name Generator}} {{name=Select the following name convention ( [[1t[TavernNameConvention]]] ), or choose from the list below}} /w gm &{template:npcaction}{{rname=Generation Methods}}{{description= [Adj + Noun](!
#TavAdjNou)[Adj + Noun w/Title (!
#TavAdjNounTitle)[Adj w/Title](!
#TavAdjTitles)[Noun & Noun](!
#TavNounANDNoun)[Noun & Noun w/Title](!
#TavNounANDNounTitle)}} And here is how I kept botching things up: /w gm &{template:npcaction} {{rname=Tavern Name Generator}} {{name=Select the following name convention ( [[1t[TavernNameConvention]]] ), or choose from the list below}} /w gm &{template:npcaction}{{rname=Generation Methods}}{{description= [[1t[Adj + Noun](!
#TavAdjNou)]]][1[Adj + Noun w/Title (!
#TavAdjNounTitle)]]][1[Adj w/Title](!
#TavAdjTitles)]]][Noun & Noun][1(!
#TavNounANDNoun)]]][1[Noun & Noun w/Title](!
#TavNounANDNounTitle)]]}} Now I can get to the next stage of this! Maybe I just needed to step away and nap for a little bit.  Erik H. said: I can't find the thread but once ago, a user found a way to generate random names using rollable-tables. Don't know if it will be of any help but you'll find below what I remember of the thread: Rollable tables: [Color]: Blue, Red, Green, Black [Verb]: Prancing, Bathing, Laughting, Sleeping [Animal]: Porcupine, Horse, Badger, Squirrel [Type]: Inn, Pub, Cellar, Castle [Description]: A good place to live, A dull place, An abandoned house macro: /w gm &{template:npcaction} {{rname=[[1t[Color]]] [[1t[Verb]]] [[1t[Animal]]] [[1t[Type]]]}} {{name=[[1t[Description]]]}} You can add more descriptions by creating more tables and select the table to roll when invoking the macro. The tables may be useful if you want a firm grasp on the description part (to reflect how gloomy or wealthy a particuliar place is for example): {{name=?{Description, select rollable-table |[[1t[Description_Dangerous]]] | [[1t[Description_Safe]]] | [[1t[Description_Wealthy]]] }}}. That's alright if you can't remember. What you've provided gives me ideas to work with, and that's more than enough. Thank you. Thank you both for your time and quick responses.
1587041617
Ziechael
Forum Champion
Sheet Author
API Scripter
Have you tried simply combining the templates into one? (you were also missing a ']' in there): /w gm &{template:npcaction} {{rname=Tavern Name Generator}} {{name=Select the following name convention ( [[1t[TavernNameConvention]]] ), or choose from the list below}}  {{description= [Adj + Noun](!
#TavAdjNou)[Adj + Noun w/Title](!
#TavAdjNounTitle)[Adj w/Title](!
#TavAdjTitles)[Noun & Noun](!
#TavNounANDNoun)[Noun & Noun w/Title](!
#TavNounANDNounTitle)}}
1587041706
Ziechael
Forum Champion
Sheet Author
API Scripter
Ignore the '1' just threw a test table in there:
1587042317

Edited 1587042504
Originally, I had tried to run it as a single template, but combined with the errors I was having previously, I split them up and seeing some progress I decided to just go with it. I hand't thought to try and combine them again until you mentioned it. Yours looks much cleaner!