Nesting Roll tables to create Random Encounter/Loot tables without using the API.

I found a little trick that allowed me to properly do nested roll tables without having to use the API. /r 1t[re], returns a number using the name of the table item. Items need to be named with a number. /r 1t[ [[1t[re]]] ], returns an entry in a random table. And here's the final macro I use. /w gm &{template:traits} {{name=Random Encounter}} {{description= [[1t[[[1t[re]]]]]]}}
The Aaron
API Scripter
Whoa!  That's really clever!

Edited 1507897066
Thanks Aaron! I found a way to name the tables with a prefix and still be able to use the macro. It makes management of these tables a bit more sane. This does a lookup in a random table from : tablename1, tablename2, tablename3, tablename4, tablename5, tablename6 /r 1t[tablename[[1d6]]] Ok, so here's a loot table with 3 levels of nesting. The first level can be the class of items: loot1:Potions, loot2:Scrolls, loot3:Gold. The second level can be the rarity of the items ( loot21:Level1, loot22:Level2, loot23:Level3 scrolls, or only have a single index like look11) The third level is where you list all the items. In the screenshot, I'm doing 3 lookups in sequence &{template:traits} {{name=Treasure}} {{description= [[1t[loot[[1t[loot[[1t[loot]]]]]]]]]}}
Very cool!