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 .
×

Trying to pull from multiple rollable tables in a macro

Hello, I'm still kinda getting used to the Macros and what they are capable of.  I have rollable tables in my game for crits/fails that are currently broken up by severity based on levels of the characters.  For example I currently have [[1t[MeleeFail-(Lv.9-12)]]], [[1t[MeleeFail-(Lv.5-8)]]], and [[1t[-MeleeFail-(Lv.1-4)]]] as separate macros to roll these tables and pull back results.  What I would really like to do is have one macro that rolls all of these tables together and pulls one result back.  So that in the end its rolling levels 1-12 instead of 9-12, etc.  Thank you for any help that anyone can give with this.
The 'simple' way would be to just create another rollable table that has all of the level 1 - 12 fails listed together.  But outside of that, it won't be possible without an API script (Pro subscribers only). Since you have a Pro subscription, you could use The Aaron's RecursiveTables script to what you're looking for, or I'm sure timmaugh has a way to do it with his meta scripts. For the RecursiveTables script, I think you'd have to create one more rollable table (named MeleeFailLevels in my example) with three items: MeleeFailLevels (Lv.1-4) (Lv.5-8) (Lv.9-12) Then you'd use RecursiveTables to do something like this: !rt [[ 1t[MeleeFail-[[1t[MeleeFailLevels]]]] ]]
1625850999
The Aaron
Roll20 Production Team
API Scripter
How would it choose which table to return a result from, or would it just randomly pick one from any of the tables?
1625855937

Edited 1625883322
timmaugh
Roll20 Production Team
API Scripter
Jarren K. said: Since you have a Pro subscription, you could use The Aaron's RecursiveTables script to what you're looking for, or I'm sure timmaugh has a way to do it with his meta scripts. Yep. I think the answer to Aaron's question (and the outcome desired -- is it a single event that needs resolving, or one event in a longer command line?) would tend to steer either toward RecursiveTable or Metascripts. I'm guessing a meta-solution would be somewhat similar to what I posted this morning, here . It would take Muler and ZeroFrame . I would probably set up a Mule with 3 variables... 1-4=[[1t[MeleeFail-(Lv.1-4)]]] 5-8=[[1t[MeleeFail-(Lv.5-8)]]] 9-12=[[1t[MeleeFail-(Lv.9-12)]]] Then any time I wanted to use the character's level in a roll against that table, I could use that in a "get" statement to resolve within those ranges: get.@{selected|Level}/get (the above would need the {& mule...} statement, including the name of the Mule that was storing those range variables) If Aaron is right and what you mean by rolling against any of the ranges is to have a random roll amongst all possible outcomes of the 3 tables (effectively a level 1 through 12 roll), then I would use a 1d12 as the variable to retrieve against that same Mule: get.[[1d12]].value/get The probabilities of that would be right if all of the 3 tables had the same number of returns available. If they were not of equal number, you could utilize a rollable table as the source for the variable instead of the 1d12, and then weight each line appropriately. For instance, if 1-4 had 30 entries, 5-8 had 40, and 9-12 had 50, you could have a table with weights of: VALUE | WEIGHT ------|--------- 4  |  30 8  |  40 12  |  50  Then use something like: get.[[1t[ThreeTableDistribution]]].value/get
1625878669
Oosh
Sheet Author
API Scripter
If you're using the 5e by Roll20 sheet, one of the templates does a conditional display that would work (assuming what you're trying to do is basically roll from each table once, then pick which of the three results to keep with a 1d3).