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 (!rt) output returning 0

I've recently started using recursive tables and found it to be a godsend of a tool to use in roll20! The problem started when I was setting up my treasure/looting macro, everything goes well until I specify the output of each of the Hoard loot boxes, it all went smoothly until I put this command inside one of the tables: ** Copper, Silver, Gold and Plat: **[[2d6*100]] CP, [[2d6*1000]] SP, [[6d6*100]] GP and [[3d6*10]] PP ⫼ ** Gems or Art Object: **[[[[2d4]]t[250gpArt]]] ⫼ ** Potions or Magic Items: **[[1t[MagicItemTableH]]] However it came up as a 0 when it was rolled, so I changed it to: ** Copper, Silver, Gold and Plat: **[[2d6*100]] CP, [[2d6*1000]] SP, [[6d6*100]] GP and [[3d6*10]] PP ⫼ ** Gems or Art Object: **[[[[2d4]]t[250gpArt]]] ⫼ ** Potions or Magic Items: **[[[[1d1]]t[MagicItemTableH]]] This seemed to fix the issue however, the problem started occurring again when rolling more complicated rolls like this one:  ** Gold and Plat: **[[4d6*1000]] GP and [[5d6*100]] PP ⫼ ** Gems or Art Object: **[[[[3d6]]t[1000gpGem]]] ⫼ ** Potions or Magic Items: **[[[[1d1]]t[MagicItemTableF]]] ** and ** [[[[1d4]]t[MagicItemTableG]]] it 70% of the time returns a 0 on the MagicItemTableG values (see attached image) Is this an error caused by the item inside the table being very complicated? (ive set that on value of the table to be at 100 weight making it appear a lot more frequently) the image has the same error result twice ^^
1572833749
The Aaron
Roll20 Production Team
API Scripter
It's probably this bug:&nbsp; <a href="https://app.roll20.net/forum/post/6778746/api-sendchat-returns-bad-results-to-callback-with-rollable-tables-expressions-with-inline-rolls" rel="nofollow">https://app.roll20.net/forum/post/6778746/api-sendchat-returns-bad-results-to-callback-with-rollable-tables-expressions-with-inline-rolls</a> There's some advice in the report about how to structure rolls to prevent it. See if you can get it working. I can try and take a look tomorrow night if you don't make progress.&nbsp;
I found a solve, albeit a very complicated and tedious one. After trying the test table I found that most results were occurring as 0 when the die roll wasn't specified; [[1t[MagicItemTableI]]] so I changed it to [[[[1d1]]t[MagicItemTableI]]] and that seemed to fix the issue mostly but it still occurs rarely, I tried with simple inline table rolls and the error seemed to not occur at all, maybe the API hits the MB limit for processing and returns a failed result when it gets too complicated and crowded. My fix was simple is theory but a nightmare to put in place in reality: I made a inline macro inside the table so that I would have to click the button to roll for the magical item; [Magic Item Table I](!&amp;#13;#1d1MagI). (I'll probably do the same for gems/art objects simply because of my need for symmetry).&nbsp; This seems to have completely fixed the issue, and it might add the extra tidiness to the chat window however if I have to set this up for every single magical item table and as well as set up different macros for different number of die rolls my brain will melt with the amount of work required. TL;DR : I fixed the issue by making the tables more complicated but by simplifying the process needed to roll the table.
Is there no simple fix for the problem? (I spent about 2 hours simply replacing all the items inside the table so that the error stops occurring) Both my eyes and my brain hurt from the amount of linkage the table and macros need. I've read the posts you linked but I'm not too sure I understand why the problem is occurring, the only thought that comes to mind is ( i've read somewhere, and am by no means an expert ) that there was this MB limit to how much a .json file can operate and that maybe in complicated 1 roll = 10 rolls commands it takes up the entirety of that limit and just stops before completing the process resulting in a null response for the rolls that took too much out of it (the only reason this makes sense for me is the error occurs when the same table decides to roll the maximum amount; 1d4 MagicalItemTableB and a 1d6 MagicalItemTableA where both rolls would *crit* at the maximum value so 4 rolls for table B and 6 rolls for table A &lt;_&lt; in this case i've seen it almost always forgoes the other table roll entirely and just outputs a 0 but it doesn't explain why it sometimes forgoes the first table roll rather than the other one (unless they both run simultaneously and first one to hit the limit loses), however the error doesn't seen to occur when the rolls are smaller say a 4 on table B and a 2 on table A &lt;_&lt; in this case both results would output normally).