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

Issue with Recursive Tables showing a } at the end of the output

Ok, so below are three results when using the recursive table functionality.  The first two show the result of two tables.  The first table is checking the chance of having a random encounter, 6 entries, each weighted at 1 with 6 calling another table.  The second table is the resulting monster if an encounter is called for. (I know I could have weighted the first table a 5 for nothing, and 1 for the encounter, and I will probably go back and change that, but for now it is what it is.) In the first example, the rollable table result was between 1 and 5, so there is no random encounter. In the second example, the first rollable table resulted in a 6 and called the second to determine what the encounter is.  Note the } at the end of the line. In the third example, I am just calling the encounter table directly.  Note that there is no extra bracket at the end of the line. Here is the code for the recursive table roll for the table to determine if there is a random encounter - !rt /w gm &{template:npcaction}{{name=B1 Level 2}} {{rname=Wandering Monster}}{{description=[[ 1t[B1-Level02-WanderingMonstersCheck] ]]}} And here is the code in the sixth entry of the first table, it always adds that extra } at the end !rt /w gm &{template:npcaction}{{name=B1 Level 2}} {{rname=Wandering Monster}}{{description=[[ 1t[B1-Level02-WanderingMonsters] ]]}} This second line of code, if run from chat does not produce the extra bracket at the end.
1632788129
The Aaron
Roll20 Production Team
API Scripter
Is there supposed to be an image accompanying that post? I'm not seeing the extra } you're talking about?
Are you calling these from a macro, a chat menu, or posting them directly into chat to roll them?  If they are in a macro, open up the macro and look at the code directly. Otherwise, I'm guessing that your rollable table 'B1-Level02-WanderingMonstersCheck' entry has an extra } in it. I'd suggest actually opening up the rollable tables themselves and looking at the code directly.
1633720474

Edited 1633720495
The Aaron said: Is there supposed to be an image accompanying that post? I'm not seeing the extra } you're talking about? Yes, sorry, here is the image that was missing - 
Jarren said: Are you calling these from a macro, a chat menu, or posting them directly into chat to roll them?  If they are in a macro, open up the macro and look at the code directly. Otherwise, I'm guessing that your rollable table 'B1-Level02-WanderingMonstersCheck' entry has an extra } in it. I'd suggest actually opening up the rollable tables themselves and looking at the code directly. It doesn't matter if done from a macro or chat, the same occurs.  The extra bracket only appears when running the first of those commands, so the last line of that table has the second command in it.  I can copy/paste from that table to chat, or put that in a macro, and it does not generate the extra bracket.
1633723153
The Aaron
Roll20 Production Team
API Scripter
Is this literally what is in the line for the table row? !rt /w gm &{template:npcaction}{{name=B1 Level 2}} {{rname=Wandering Monster}}{{description=[[ 1t[B1-Level02-WanderingMonsters] ]]}} Try changing it to: [[ 1t[B1-Level02-WanderingMonsters] ]]
Thanks Aaron, as usual you are awesome. Yes, that was the actual line.  I have changed it as you showed and it is working without the extra bracket.  So, it looks like if you start off using a !rt on the initial table, you don't need to specify that in tables that are then called.  Would that be correct?  For example, this is just one table calling to another, but there are a random number of monsters for each of the encounter entries.  Without the initial !rt it wouldn't roll those, for example, the encounter table (B1-Level02-WanderingMonsters) has an entry as shown below, rolling this directly is as the image below. [[1d2]] Zombies I ask, because I am going to set up some additional tables that will generate treasure randomly as well, and those may have multiple level deep on tables.   The Aaron said: Is this literally what is in the line for the table row? !rt /w gm &{template:npcaction}{{name=B1 Level 2}} {{rname=Wandering Monster}}{{description=[[ 1t[B1-Level02-WanderingMonsters] ]]}} Try changing it to: [[ 1t[B1-Level02-WanderingMonsters] ]]
1633926328
The Aaron
Roll20 Production Team
API Scripter
That's correct. You only need !rt when you're calling the initial roll. The results for each roll are substituted into the text, then re-evaluated until there are no more rolls (or the max depth is reached).