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 Tables Help on [[ [[1d6}}t[10gp-Gemstones] ]]

1708478420

Edited 1708478485
First, let me confess I know next to nothing about scripting. I'm trying to display the results in chat for a the following macro: !rt [Delimiter:BR] /w gm &{template:default} {{name=Random Treasure}}{{description=?{Choose|10gp Gemstones,[[1t[10gp-Gemstones]]]|50gp Gemstones,[[1t[50gp-Gemstones]]]|100gp Gemstones,[[1t[100gp-Gemstones]]]|500gp Gemstones,[[1t[500gp-Gemstones]]]|1000gp Gemstones,[[1t[1000gp-Gemstones]]]|5000gp Gemstones,[[1t[5000gp-Gemstones]]]|25gp Art Objects,[[1t[25gp-Art-Objects]]]|250gp Art Objects,[[1t[250gp-Art-Objects]]]|750gp Art Objects,[[1t[750gp-Art-Objects]]]|2500gp Art Objects,[[1t[2500gp-Art-Objects]]]|7500gp Art Objects,[[1t[7500gp-Art-Objects]]]|Individual Treasure Tier I,[[1t[Individual-Treasure-Tier-I]]]|Individual Treasure Tier II,[[1t[Individual-Treasure-Tier-II]]]|Individual Treasure Tier III,[[1t[Individual-Treasure-Tier-III]]]|Individual Treasure Tier IV,[[1t[Individual-Treasure-Tier-IV]]]|Treasure Horde Tier I,[[1t[Treasure-Horde-Tier-I]]]|Treasure Horde Tier II,[[1t[Treasure-Horde-Tier-II]]]|Treasure Horde Tier III,[[1t[Treasure-Horde-Tier-III]]]|Treasure Horde Tier IV,[[1t[Treasure-Horde-Tier-IV]]]} }} Everything works just fine when I call from the Treasure Horde Tier I Table which has, for example the following macro inside the table: [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[50gp-Gemstones] ]] 50gp Gemstones [[ [[1d6]]t[Magic-Item-Table-A] ]] Magic Items Except that what it displays in the chat is incomplete, because when I hover over the results for 50gp gemstones as you can see there are 7 more gemstones listed as an outcome on the roll, but not displayed in chat. What am I doing wrong here and how can I get everything to display in chat?
1708530943
The Aaron
Roll20 Production Team
API Scripter
Here is the current thread about RecursiveTable, which might have some helpful examples:&nbsp; <a href="https://app.roll20.net/forum/post/7844658/script-update-recursivetable-now-with-rollable-table-images-and-better-prefixing-rules-for-roll-templates" rel="nofollow">https://app.roll20.net/forum/post/7844658/script-update-recursivetable-now-with-rollable-table-images-and-better-prefixing-rules-for-roll-templates</a> One thing you need is to remove the space after !rt: !rt[Delimiter:BR] /w gm &amp;{template:default} {{name=Random Treasure}}{{description=?{Choose|10gp Gemstones,[[1t[10gp-Gemstones]]]|50gp Gemstones,[[1t[50gp-Gemstones]]]|100gp Gemstones,[[1t[100gp-Gemstones]]]|500gp Gemstones,[[1t[500gp-Gemstones]]]|1000gp Gemstones,[[1t[1000gp-Gemstones]]]|5000gp Gemstones,[[1t[5000gp-Gemstones]]]|25gp Art Objects,[[1t[25gp-Art-Objects]]]|250gp Art Objects,[[1t[250gp-Art-Objects]]]|750gp Art Objects,[[1t[750gp-Art-Objects]]]|2500gp Art Objects,[[1t[2500gp-Art-Objects]]]|7500gp Art Objects,[[1t[7500gp-Art-Objects]]]|Individual Treasure Tier I,[[1t[Individual-Treasure-Tier-I]]]|Individual Treasure Tier II,[[1t[Individual-Treasure-Tier-II]]]|Individual Treasure Tier III,[[1t[Individual-Treasure-Tier-III]]]|Individual Treasure Tier IV,[[1t[Individual-Treasure-Tier-IV]]]|Treasure Horde Tier I,[[1t[Treasure-Horde-Tier-I]]]|Treasure Horde Tier II,[[1t[Treasure-Horde-Tier-II]]]|Treasure Horde Tier III,[[1t[Treasure-Horde-Tier-III]]]|Treasure Horde Tier IV,[[1t[Treasure-Horde-Tier-IV]]]} }} I don't know if that will fix the issue you're having, but it can't hurt.&nbsp; &nbsp;It would help to see what some of your tables look like.&nbsp;&nbsp;
1708540469

Edited 1708540604
This may not be the source of your problem, but if Aaron's advice doesn't fix it, I was getting some odd results with how things displayed and what was rolled on recursive tables that others were not, even though they were using my example code.&nbsp; I disabled every API and then reloaded one by one until the problem came back and it turned out there was a conflict with the Dynamic Lighting API.&nbsp; Weird, I don't get it, but I repeated the experiment several times and every time gave that result, here is the thread for that forum discussion <a href="https://app.roll20.net/forum/post/11789469/trouble-with-recursive-magic-tables/?pageforid=11789469#post-11789469" rel="nofollow">https://app.roll20.net/forum/post/11789469/trouble-with-recursive-magic-tables/?pageforid=11789469#post-11789469</a> Given that I don't need that (excellent) API active all the time, I am happy to disable it until needed
The Aaron said: Here is the current thread about RecursiveTable, which might have some helpful examples:&nbsp; <a href="https://app.roll20.net/forum/post/7844658/script-update-recursivetable-now-with-rollable-table-images-and-better-prefixing-rules-for-roll-templates" rel="nofollow">https://app.roll20.net/forum/post/7844658/script-update-recursivetable-now-with-rollable-table-images-and-better-prefixing-rules-for-roll-templates</a> One thing you need is to remove the space after !rt: !rt[Delimiter:BR] /w gm &amp;{template:default} {{name=Random Treasure}}{{description=?{Choose|10gp Gemstones,[[1t[10gp-Gemstones]]]|50gp Gemstones,[[1t[50gp-Gemstones]]]|100gp Gemstones,[[1t[100gp-Gemstones]]]|500gp Gemstones,[[1t[500gp-Gemstones]]]|1000gp Gemstones,[[1t[1000gp-Gemstones]]]|5000gp Gemstones,[[1t[5000gp-Gemstones]]]|25gp Art Objects,[[1t[25gp-Art-Objects]]]|250gp Art Objects,[[1t[250gp-Art-Objects]]]|750gp Art Objects,[[1t[750gp-Art-Objects]]]|2500gp Art Objects,[[1t[2500gp-Art-Objects]]]|7500gp Art Objects,[[1t[7500gp-Art-Objects]]]|Individual Treasure Tier I,[[1t[Individual-Treasure-Tier-I]]]|Individual Treasure Tier II,[[1t[Individual-Treasure-Tier-II]]]|Individual Treasure Tier III,[[1t[Individual-Treasure-Tier-III]]]|Individual Treasure Tier IV,[[1t[Individual-Treasure-Tier-IV]]]|Treasure Horde Tier I,[[1t[Treasure-Horde-Tier-I]]]|Treasure Horde Tier II,[[1t[Treasure-Horde-Tier-II]]]|Treasure Horde Tier III,[[1t[Treasure-Horde-Tier-III]]]|Treasure Horde Tier IV,[[1t[Treasure-Horde-Tier-IV]]]} }} I don't know if that will fix the issue you're having, but it can't hurt.&nbsp; &nbsp;It would help to see what some of your tables look like.&nbsp;&nbsp; Thank you, I'll definitely check out the current thread. Did remove the space but still having issues one thing that I didn't mention previously was it crashes the API occasionally as well, when it does this is the message I get. Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:8.0pt; mso-para-margin-left:0in; line-height:107%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-font-kerning:1.0pt; mso-ligatures:standardcontextual;} Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your script's code and click the "Save Script" button. We will then attempt to start running the scripts again. More info... If this script was installed from the Mod Library, you might find help in the Community API Forum. For reference, the error message generated was: SyntaxError: Expected "[" or [ |\t] but "8" found. Undefined (first crash) For reference, the error message generated was: SyntaxError: Expected "[" or [ |\t] but "6" found. Undefined (second crash) For reference, the error message generated was: SyntaxError: Expected "[" or [ |\t] but "5" found. undefined (third crash) I'll also post the on the thread the macro and table that I'm experiencing problems with
Simon G. said: This may not be the source of your problem, but if Aaron's advice doesn't fix it, I was getting some odd results with how things displayed and what was rolled on recursive tables that others were not, even though they were using my example code.&nbsp; I disabled every API and then reloaded one by one until the problem came back and it turned out there was a conflict with the Dynamic Lighting API.&nbsp; Weird, I don't get it, but I repeated the experiment several times and every time gave that result, here is the thread for that forum discussion <a href="https://app.roll20.net/forum/post/11789469/trouble-with-recursive-magic-tables/?pageforid=11789469#post-11789469" rel="nofollow">https://app.roll20.net/forum/post/11789469/trouble-with-recursive-magic-tables/?pageforid=11789469#post-11789469</a> Given that I don't need that (excellent) API active all the time, I am happy to disable it until needed Thank you Simon, don't use any of the Dynamic Lighting API's though so I think its something else.
@The Aaron Okay so here's the macro, I did remove the space between the !rt and[Delimiter:BR] !rt[Delimiter:BR] /w gm &amp;{template:default} {{name=Random Treasure}}{{description=?{Choose|10gp Gems, [[1t[10gp-Gems]]]|50gp Gems, [[1t[50gp-Gems]]]|100gp Gems, [[1t[100gp-Gems]]]|500gp Gems, [[1t[500gp-Gems]]]|1000gp Gems, [[1t[1000gp-Gems]]]|5000gp Gems, [[1t[5000gp-Gems]]]|25gp Art Objects, [[1t[25gp-Art-Objects]]]|250gp Art Objects, [[1t[250gp-Art-Objects]]]|750gp Art Objects, [[1t[750gp-Art-Objects]]]|2500gp Art Objects, [[1t[2500gp-Art-Objects]]]|7500gp Art Objects, [[1t[7500gp-Art-Objects]]]|Individual Treasure Tier I, [[1t[Individual-Treasure-Tier-I]]]|Individual Treasure Tier II, [[1t[Individual-Treasure-Tier-II]]]|Individual Treasure Tier III, [[1t[Individual-Treasure-Tier-III]]]|Individual Treasure Tier IV, [[1t[Individual-Treasure-Tier-IV]]]|Treasure Horde Tier I, [[1t[Treasure-Horde-Tier-I]]]|Treasure Horde Tier II, [[1t[Treasure-Horde-Tier-II]]]|Treasure Horde Tier III, [[1t[Treasure-Horde-Tier-III]]]|Treasure Horde Tier IV, [[1t[Treasure-Horde-Tier-IV]]]} }} Here's the table I'm running into problems with and the code in each table item [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[[[2d6]]t[10gp-Gems]]] 10gp gems [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d4]]t[25gp-Art-Objects] ]] 25gp Art Objects [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]1t[50gp-Gems] ]] 50gp gems [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[10gp-Gems] ]] 10gp gems [[ [[1d6]]t[Magic-Item-Table-A] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d4]]t[25gp-Art-Objects] ]] 25gp Art Objects [[ [[1d6]]t[Magic-Item-Table-A] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[50gp-Gems] ]] 50gp gems [[ [[1d6]]t[Magic-Item-Table-A] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[10gp-Gems] ]] 10gp gems [[ [[1d4]]t[Magic-Item-Table-B] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d4]]t[25gp-Art-Objects] ]] 25gp Art Objects [[ [[1d4]]t[Magic-Item-Table-B] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[50gp-Gems] ]] 50gp gems [[ [[1d4]]t[Magic-Item-Table-B] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[10gp-Gems] ]] 10gp gems [[ [[1d4]]t[Magic-Item-Table-C] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d4]]t[25gp-Art-Objects] ]] 25gp Art Objects [[ [[1d4]]t[Magic-Item-Table-C] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[50gp-Gems] ]] 50gp gems [[ [[1d4]]t[Magic-Item-Table-C] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d4]]t[25gp-Art-Objects] ]] 25gp Art Objects [[ [[1d4]]t[Magic-Item-Table-F] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[50gp-Gems] ]] 50gp gems [[ [[1d4]]t[Magic-Item-Table-F] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d4]]t[25gp-Art-Objects] ]] 25gp Art Object [[1t[Magic-Item-Table-G] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[50gp-Gems] ]] 50gp gems [[1t[Magic-Item-Table-G] ]] Magic Items Probably a data entry error somewhere, that I haven't caught.
1708618708
The Aaron
Roll20 Production Team
API Scripter
I tried a few of those in a test setup but didn't get any issue.&nbsp; It's probably in a deeper nested table.&nbsp;&nbsp;
1708651268

Edited 1708652863
Deeper nested table? Nor sure I understand. The tables the Treasure Horde Tier I table calls to doesn't have anything other than a description of the gem, art, or magic item. So I pared down the Random-Treasure macro to just call from the Treasure Horde Tables !rt[Delimiter:BR|PrefaceUniqueSpace] /w gm &amp;{template:default} {{name=Random Treasure}}{{description=?{Choose|Treasure Horde Tier I, [[1t[THTI]]]|Treasure Horde Tier II, [[1t[THTII]]]|Treasure Horde Tier III, [[1t[THTIII]]]|Treasure Horde Tier IV, [[1t[THTIV]]]} }} Treasure Horde Tier I tables Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[10gp-Gems] ]] 10gp gems [[ [[1d6]]t[Magic-Item-Table-A] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d4]]t[25gp-Art-Objects] ]] 25gp Art Objects [[ [[1d6]]t[Magic-Item-Table-A] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[50gp-Gems] ]] 50gp gems [[ [[1d6]]t[Magic-Item-Table-A] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[10gp-Gems] ]] 10gp gems [[ [[1d4]]t[Magic-Item-Table-B] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d4]]t[25gp-Art-Objects] ]] 25gp Art Objects [[ [[1d4]]t[Magic-Item-Table-B] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[50gp-Gems] ]] 50gp gems [[ [[1d4]]t[Magic-Item-Table-B] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[10gp-Gems] ]] 10gp gems [[ [[1d4]]t[Magic-Item-Table-C] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d4]]t[25gp-Art-Objects] ]] 25gp Art Objects [[ [[1d4]]t[Magic-Item-Table-C] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[50gp-Gems] ]] 50gp gems [[ [[1d4]]t[Magic-Item-Table-C] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d4]]t[25gp-Art-Objects] ]] 25gp Art Objects [[ [[1d4]]t[Magic-Item-Table-F] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[50gp-Gems] ]] 50gp gems [[ [[1d4]]t[Magic-Item-Table-F] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d4]]t[25gp-Art-Objects] ]] 25gp Art Object [[1t[Magic-Item-Table-G] ]] Magic Items [[6d6*100]] Copper pieces [[3d6*100]] Silver pieces [[2d6*10]] Gold pieces [[ [[2d6]]t[50gp-Gems] ]] 50gp gems [[1t[Magic-Item-Table-G] ]] Magic Item When I run the macro I get Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your script's code and click the "Save Script" button. We will then attempt to start running the scripts again. More info... If this script was installed from the Mod Library, you might find help in the Community API Forum. For reference, the error message generated was: SyntaxError: Expected "[" or [ |\t] but "7" found. undefined And when I just copy and paste one of the Treasure Horde Tier I table items in to chat I get the following, where it doesn't display everything from the result in chat, but its there if I hover over the roll result. I've also received these responses after running the Random-Treasure macro And I don't know what to make of this latest event, but when the API crashes and restart it I'm seeing this when the API restarts in chat. Note I'm not running the macro again but I'm getting a result even though the API was restarted.