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

Using Nested Macro, to call other macro, that has !rt

Hello all, First time posting, couldn't find anything in any old forum posts about how to fix this so I hope y'all can help! I am trying to make a treasure generator in my game for different levels of loot. (Common, Minor Uncommon, Major Uncommon, Minor Rare, etc.) So I looked on the wiki to figure out what I should do, and it just raises more questions for me haha. Anyways, what I have is a macro that does a query for my other macros that I have made.  Looks something like this: ?{Loot Level|Common,#Common-Treasure |Minor Uncommon,#Minor-Uncommon-Treasure |Major Uncommon,#Major-Uncommon-Treasure, etc...} Now if I select Common for instance, it's supposed to use the macro [Common-Treasure] right?  That looks something like this: !rt[Delimiter:BR|PrefaceUniqueSpace] &{template:default}{{name=Loot}}     {{Coins=[[ 6d8 ]]cp, [[ 4d8 ]]sp, [[ 2d8 ]]gp, [[ 0 ]]pp}}, {{Gems= [[ [[ 1d2 ]]t[Gems-B] ]]}}, {{Trinkets= [[ [[ 1d3 ]]t[Trinkets]]]}}, {{Potions= [[ [[ 1d3 ]]t[Potions-A]]]}}, {{Spell Scrolls= [[ [[1d2]]t[Spells-A]]]}}, {{Items= [[1t[Magic-Item-Table-A]]]}} I have the recursive tables API, am I doing something wrong and if so how do I fix it? When I run the Common-Treasure macro alone, it works and gives me everything I need, I just want a macro to select which loot level so I don't have like 5+ macros in my macro bar.
1724869633
Gauss
Forum Champion
Hi Daniel A.,  Short version is...don't use nested queries, use Chat Menus .  When you put something inside a query you see:  ?{queryname|name, destinationname } Roll20 sees:  ?{queryname|name, destinationcontents } If those contents have control characters they can break the query. You have to use HTML substitution to resolve it, and that way lies madness.  Chat Menus are simple and easy. No insanity.
Ahh thank you Gauss, I'll look into how to make and use Chat Menus.
1724871464
Gauss
Forum Champion
Daniel A. said: Ahh thank you Gauss, I'll look into how to make and use Chat Menus. Here is a sample Chat Menu based on your query:  &{template:default} {{name=Loot Level}} {{select one= [Common](`#Common-Treasure) [Minor Uncommon](`#Minor-Uncommon-Treasure) [Major Uncommon](`#Major-Uncommon-Treasure) [insert next name here](`#insert macro name here) }} Note I did not test the above. 
Thank you, thank you, thank you!!! Was looking into how to make it but couldn't for the life of me figure it out, this helps immensly. And it works! Just need to finish the details, seriously thank you very much!
If you're playing D&D 5E and don't want to recreate the wheel, I posted a couple options for treasure tables in this thread . Further down there's a Mod script to add the custom 'Loot' version.   And here's another Mod script for a different custom set of treasure tables.