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

Pickable Table Macro

Is there a way to make a macro that allows me to select which rollable table will be used from a macro. I thought it would be similar to the party message macro:  /w ?{Whisper|member 1|member 2|member 3|member 4|member 5} ?{Message} while also being mixed with the table auto roll macro: /w gm [[1t[Treasure-Hoard:-0-4]]] So im wondering if there is a way to make a macro that will allow me to pick between rollable tables to roll. Bonus points if the macro can let me change how many times I want to roll. Thanks for any help
1527769808
The Aaron
Pro
API Scripter
Sure: [[ ?{Number|1}t[?{which|d12min7|d8min5|d6min4}] ]]
Awesome works just like I wanted! I hated having to click a few different macros to get the rollable loot tables that I wanted so this solves my problem. Thank you very much!
1527787727
The Aaron
Pro
API Scripter
No problem. =D
I'd like to add a question to this. I am building random encounter tables and would like to create them as a macro. I have used The Aaron's suggestion above and that works great compared to what I had built. However, it will randomly output either the text inside the rollable table or simply just a number in which I have to hover over to see the result from the table. Is there a way to ensure that I always get the text output from the roll table result? MACRO USED: [[ ?{Number|1}t[?{which|Tier1ArcticEncounters|Tier2ArcticEncounters}] ]]
1527792638
The Aaron
Pro
API Scripter
Probably those rows start with a number.  Try prefacing them with a letter.
YES!!! Good lord I've been hung up on that and it never crossed my mind that it didn't like the number. "1 half-ogre" in my table for example put the number output.  The Aaron thanks for your response good sir! Wonderful lesson learned. One step closer to running a completely open world, random game.
1527794087
The Aaron
Pro
API Scripter
No problem!  The Rollable Tables, in order to support formulas and math stuff, automatically convert to a number if they begin with a number.  Not immediately obvious, to be sure. =D One other thing to note: With inline rolls if you roll multiple times on a rollable table, it will only show 1 text result.  So if you did: [[ 2t[Tier1ArcticEncounters] ]] and got "A single Squid" and "Some 23 Mermaids", it would only show one of them.  The only way around that is to either use: /roll 2t[Tier1ArcticEncounters]  or upgrade to a Pro subscription and use the Recursive Table API script.
Understood. Thanks again sir. :D
1527796025
The Aaron
Pro
API Scripter
No worries. =D
1527816131
Ziechael
Forum Champion
Sheet Author
API Scripter
The Aaron said: The only way around that is to either use: /roll 2t[Tier1ArcticEncounters]  or upgrade to a Pro subscription and use the Recursive Table API script. Or hover over the output and read the tooltip for a full break down of the table roll results ;)
1530320549

Edited 1530320890
Hi All, As a bit of a follow on from this topic, I am trying to have the option of selecting a coin roll from one table and an item roll from a second table. When I use the following: !rt &{template:5e-shaped} {{title=Searching...}} {{text=You search, and find [[1t[?{which|IndTreasureCR0-4|IndTreasureCR5-10|IndTreasureCR11-16|IndTreasureCR17+}]]] and [[1t[MagicMinorCommon]]]}} it lets me select the coin roll level and also rolls the item table correctly. However if I try to duplicate the request for an item table: !rt &{template:5e-shaped} {{title=Searching...}} {{text=You search, and find [[1t[?{which|IndTreasureCR0-4|IndTreasureCR5-10|IndTreasureCR11-16|IndTreasureCR17+}]]] and [[1t[?{which|MagicMinorCommon|MagicMinorUncommon}]]]}} it ends up rolling twice off the selected coin roll table and no item table. Is it simply an issue of formatting or is it not possible to do such a thing?
1530321085
The Aaron
Pro
API Scripter
If you use the same label in a Roll Query, the second and later will get the value of the first.  You need to change one of your ?{which|...} to something else.  The second ?{which} is being replaced with your initial answer.
Thanks. Works a treat. Glad to find it was an easy fix: !rt &{template:5e-shaped} {{title=Searching...}} {{text=You search, and find [[1t[?{choose|IndTreasureCR0-4|IndTreasureCR5-10|IndTreasureCR11-16|IndTreasureCR17+}]]] and [[1t[?{which|MagicMinorCommon|MagicMinorUncommon}]]]}} One day I'll actually understand what I am doing :)