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 .
×
Advertisement Create a free account

roll table that rolls on another roll table?

1635190236
Ben
Pro
Hello, I'm sure this has been answered but I couldn't find it and excuse my very limited knowledge of scripts in general.. I built a rollable table and assigned weights to each entry.  If one specific entry comes up, I'd like it to automatically roll on a new table and produce the result too.  How do I do this?  I am a pro user so I have access to add API scripts.  Thanks.
1635190625
The Aaron
Forum Champion
API Scripter
With the API, you can do that with the RecursiveTable script.
1635192821
Ben
Pro
Ok, here's what I have.. which obviously isn't right.  "MAGIC" is the table I want to roll first and the entry from that table that I want to trigger the rolling of the "Supercharged" table is called "a Supercharged Spell!".  Help?  Again, I apologize for my lack of knowledge.. [[1t[MAGIC] ]] !rt[Delimiter:BR|PrefaceUniqueSpace] &{template:default}{{name=a Supercharged Spell!}}[[1t[Supercharged]]]
1635193338
The Aaron
Forum Champion
API Scripter
Your MAGIC table would need to be written in terms of your Supercharged table, for example, your rows in it might look like: Your spell is blue Your spell creates the smell of roses Your spell creates [[1d100]] butterflies [[1t[Supercharged]]] Then you'd just call it like !rt[Delimiter:BR|PrefaceUniqueSpace] &{template:default}{{name=A Spell!}}{{Result=[[1t[MAGIC]]]}} And depending on your weighting, you'll sometimes get a Default template with a Result row that has "Your spell is blue" in it, or perhaps the result of calling [[1t[Supercharged]]]. You can get more creative with the results by including template syntax in your table rows.
1635193890
Ben
Pro
Thanks so much for the help, is there a way to broadcast it in normal chat rather than whisper it?
1635194362
Ben
Pro
Ben said: Thanks so much for the help, is there a way to broadcast it in normal chat rather than whisper it? Nm.. I've got it.. thank again for everything.
1635194831
The Aaron
Forum Champion
API Scripter
No problem!