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

Help! 5e Nested Macros & Rollable Tables - NPC Background Generation

November 27 (3 years ago)

Hey Guys!

I'm trying to create a menu to generate a Random Background to NPC I'm creating on the fly. I'm creating a Macro per Background Type. Each of them contains Rollable Table that works well when my macro call them directly. Although, I'm regrouping these Background Type Macros in a Macro that makes me select one out of a dropdown list. When i'm using this macro. It doesn't fully read the all my background type and stop before checking the rollable tables. 

What am I doing wrong? If there's already a post with an answer somewhere in the forum, Can someone send me a link of a post that talk about something similar please? 


November 28 (3 years ago)

You need to remove the space between each | and #.

November 28 (3 years ago)

Thanks Jarren, Although, I have an even worst result when I do that. 
It just write #BG_Acolyte in the chat without even executing the macro. 

November 28 (3 years ago)

Edited November 28 (3 years ago)

I Made some trouble Shooting. The problem is the " , " from my BG_Acolyte macro. '' , '' serves a purpose in the roll20 script and is interpreted as a code first before a sentence punctuation.

November 28 (3 years ago)
timmaugh
Pro
API Scripter

That is the problem found in the order of operations of the roll 20 parsing. The macro is expanded before the query resolves. You can get around this by escaping all of the relevant characters in the nested macro, or...

If you want to be able to run the macro on its own, which you won't if you escape all of the HTML characters, you can retrieve it using Fetch. Fetch constructions resolve after the query has resolved, so at that point the commas won't break the query syntax.

#(macro_name)

Once you make your selection from the query, the only thing left in the place of the query is the fetch construction you have chosen. Then Fetch resolves that to pull in the macro.

In this case, Fetch Will work on its own. However, I always suggest that people pair it with ZeroFrame and Select manager, for full effect.