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

Trying to have Item Table Macro roll multiple results

Hi all, I've been combing through the forums and I just can't seem to find an answer that functions properly.  I've got a macro that allows me to roll from multiple tables in order to facilitate acquired loot in the game.  The Macro works fine, but I'm trying to find out where to put a command such as [[(?{how many times?|1})]] in order to give me the option to roll from an item table multiple times.  I don't know if that would even be the correct command, but its the closest I found to what I'm trying to figure out.  I've tried that particular command in several spots and at best, I end up with the screenshot below.   I'm not insanely knowledgeable on macros so any help would be appreciated. The Macro I'm trying to figure out : /w gm &{template:npcaction} {{rname= Magic Item Tables }} {{name=}} {{description=?{Choose|Magic Item Table A,[[1t[Magic-Item-Table-A]]]|Magic Item Table B,[[1t[Magic-Item-Table-B]]]|Magic Item Table C,[[1t[Magic-Item-Table-C]]]|Magic Item Table D,[[1t[Magic-Item-Table-D]]]|Magic Item Table E,[[1t[Magic-Item-Table-E]]]|Magic Item Table F,[[1t[Magic-Item-Table-F]]]|Magic Item Table G,[[1t[Magic-Item-Table-G]]]|Magic Item Table H,[[1t[Magic-Item-Table-H]]]|Magic Item Table I,[[1t[Magic-Item-Table-I]]]|Random Figurine of Wondrous Power,[[1t[Random-Figurine-of-Wondrous-Power]]]|Table I Magic Armor,[[1t[Table-I-Magic-Armor]]]}  }} Apologies if this is a simple fix and is an obvious answer.
For a single table roll, the macro is this: [[1t[TABLENAME]]] You can roll on a table multiple times by changing the number in front of the 't'. Here is rolling three times: [[3t[TABLENAME]]]  But the output will only be 'evaluated' if the table items are numbers.  If they are text based, then you'll only see the first roll that is generated from the table. In order to roll on a table with text outputs multiple times, you'll need to use the RollableTables script  (Pro subscription required, which you have). Then to make the number a query/variable, you would change it to this: [[?{How many times?|1}t[TABLENAME]]]  The way your query is written, you would need to use html replacements for the ?{How many times?} because it would be a nested macro inside your ?{Which Table?} query.   Here's a simple example. This will work: ?{Which Table?|A,[[1t[TableA]]]|B,[[1t[TableB]]]}  This will not: ?{Which Table?|A,[[?{How many times?|One,1|Two,2}t[TableA]]]|B,[[?{How many times?|One,1|Two,2}t[TableB]]]}  It would have to be written like this with html replacements: ?{Which Table?|A,[[?{How many times?|One,1|Two,2}t[TableA]]]|B,[[?{How many times?|One,1|Two,2}t[TableB]]]}  That gets ugly and confusing really quickly. So you can improve the query by moving any parts that are the same in each output outside of the query. That would look like this: [[?{How many times?|One,1|Two,2}t[?{Which Table?|A,TableA|B,TableB}]]] For your treasure table macro, it will look like this: !rt /w gm &{template:npcaction} {{rname=Magic Item Tables }} {{name=}} {{description=[[?{How many times?|1}t[?{Which Table?|Magic Item Table A,Magic-Item-Table-A|Magic Item Table B,Magic-Item-Table-B|Magic Item Table C,Magic-Item-Table-C|Magic Item Table D,Magic-Item-Table-D|Magic Item Table E,Magic-Item-Table-E|Magic Item Table F,Magic-Item-Table-F|Magic Item Table G,Magic-Item-Table-G|Magic Item Table G,Magic-Item-Table-G|Magic Item Table I,Magic-Item-Table-I|Random Figurine of Wondrous Power,Random-Figurine-of-Wondrous-Power|Table I Magic Armor,Table-I-Magic-Armor}]]]}} One last step that I usually do is separate any queries out from the rest of the macro, because any query prompt that is repeated in a single macro always uses the same outputs. This can help with troubleshooting: !?{How many times?|1} ?{Which Table?|Magic Item Table A,Magic-Item-Table-A|Magic Item Table B,Magic-Item-Table-B|Magic Item Table C,Magic-Item-Table-C|Magic Item Table D,Magic-Item-Table-D|Magic Item Table E,Magic-Item-Table-E|Magic Item Table F,Magic-Item-Table-F|Magic Item Table G,Magic-Item-Table-G|Magic Item Table G,Magic-Item-Table-G|Magic Item Table I,Magic-Item-Table-I|Random Figurine of Wondrous Power,Random-Figurine-of-Wondrous-Power|Table I Magic Armor,Table-I-Magic-Armor} !rt /w gm &{template:npcaction} {{rname=Magic Item Tables }} {{name=}} {{description=[[?{How many times?}t[?{Which Table?}]]]}} Lastly, if you're just looking for D&D 5E treasure tables, there's a few options that have already been developed in this thread here .
This is one of the best-explained answers I've read through. Thank you for making it easy for an idiot like me to follow.  Your solution paired with the Rollable Table script was exactly what I was looking for.  Seriously, thank you!