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

[Recursive Table] triggering (rolalble)TableB from a specific entry of (rollable)TableA

1640783537

Edited 1640783627
Hi all, am trying to do the following: tableA has 10 entries, one of these entries should basically execute tableB and the result should be displayed as tableA result in the chat. Is that something this API script can help me with? Thanks!
 Its been a while since I did anything with my magic item tables I built using RT but I am pretty sure I ran into your exact problem and wound up using API chat buttons to solve the problem.  I think it had something to do with a lack of replacement for a specific symbol with recursive tables.  Make sure you escape out everything you need to in the apichat button.   I would have a !rt command for Dragonhoard T1 that would then call a result or series of results from Magic Item Table A and in order to pull this off the table entry for HoardT1 would look something like this in TableExport format:  If you don't replace stuff out it tries to resolve it all at once and that breaks it.  the % replacements are purely for tableexport api, the rest of the replacements are cause you don't want them expanded on initial macro.  Or maybe you do, I dunno.  All I know is figuring this stuff out when I built them was one of the worst headaches ever.   !import-table-item --TreasureHoard0T4 --<%%91%%><%%91%%>(6d6)*100<%%93%%><%%93%%> Copper and <%%91%%><%%91%%>(3d6)*100<%%93%%><%%93%%> Silver and <%%91%%><%%91%%>(2d6)*10<%%93%%><%%93%%> Gold and <%%91%%><%%91%%><%%91%%>2d6<%%93%%><%%93%%>x10gp Gemstones<%%93%%>(!
%{TreasureAndXP|10GPGemstonesMacro})<%%91%%><%%91%%><%%91%%>1d6<%%93%%><%%93%%> Magic Item Table A<%%93%%>(!
%{TreasureAndXP|MagicItemTableAMacro}) --8
Thanks DM Eddie! will look into it and try figure out if that helps me too :D 
See if  this thread  helps. 
Hi Jarren, am not using google doc, am trying to keep it within roll20's Rollable Tables. Guess your approach cannot be mirrored here.  Furthermore am not that familiar with macros and API, am more the dumb user sort of in that context ;)   Scope is to create random encounter tables, some items potentially pointing to next rollable table containing several items from that context. macro currently looks like this: ?{ Choose environment and Level |Forest 1-4,!rt /w gm [[ 1t[Forest_Enctr_Lvl_1-4] ]] |Forest 5-10,!rt /w gm [[ 1t[Forest_Enctr_Lvl_5-10] ]] |Forest 11-16,!rt /w gm [[ 1t[Forest_Enctr_Lvl_11-16] ]] |Forest 17-20,!rt /w gm [[ 1t[Forest_Enctr_Lvl_17-20] ]] |Forest Sylvan T0,!rt /w gm [[ 1t[Sylvan-Woods-Tier0] ]] |Forest Sylvan T1,!rt /w gm [[ 1t[Sylvan-Woods-Tier1] ]] |Forest Sylvan T2,!rt /w gm [[ 1t[Sylvan-Woods-Tier2] ]] |Grasslands T0,!rt /w gm [[ 1t[Grassland_Enctr_Tier0] ]] |Grasslands T1,!rt /w gm [[ 1t[Grassland_Enctr_Tier1] ]] |Grasslands T2,!rt /w gm [[ 1t[Grassland_Enctr_Tier2] ]] |Grasslands T3,!rt /w gm [[ 1t[Grassland_Enctr_Tier3] ]] |Hills T0,!rt /w gm [[ 1t[Hill_Enctr_Tier0] ]] |Hills T1,!rt /w gm [[ 1t[Hill_Enctr_Tier1] ]] |Hills 11-16,!rt /w gm [[ 1t[Hill_Enctr_Lvl_11-16] ]] |Hills 17-20,!rt /w gm [[ 1t[Hill_Enctr_Lvl_17-20] ]] |Mountains 1-4,!rt /w gm [[ 1t[Mountain_Enctr_Lvl_1-4] ]] |Mountains 5-10,!rt /w gm [[ 1t[Mountain_Enctr_Lvl_5-10] ]] |Mountains 11-16,!rt /w gm [[ 1t[Mountain_Enctr_Lvl_11-16] ]] |Mountains 17-20,!rt /w gm [[ 1t[Mountain_Enctr_Lvl_17-20] ]] |Open Roads T0,!rt /w gm [[ 1t[Open-Roads-Tier0] ]] |Open Roads T1,!rt /w gm [[ 1t[Open-Roads-Tier1] ]] |Open Roads T2,!rt /w gm [[ 1t[Open-Roads-Tier2] ]] |--------------------------------------, [[ 1t[-------------------------] ]] |Encounter Elements,!rt /w gm [[ 1t[Encounter-Elements] ]] |Social Encounters,!rt /w gm [[ 1t[Social-Encounters] ]] |Travel Sceneries,!rt /w gm [[ 1t[Travel-Scenery] ]] |Wild Magic Zone,!rt /w gm [[ 1t[Wild-Magic-Zones] ]] } the last four entries are also items of the selectable regions (mountains, Hills, etc.)  above, and I would like to have them automatically rolled and displayed in the chat in case of a hit. Am currently confused, and probably don't see the obvious. Apologies.
I’m on my phone so I can’t give a full response, but the google doc I linked is just a bunch of ImportTable script items to be used by RecursiveTables. All of the items, once imported will be ample to roll on multiple tables to give the kind of results you are looking for.