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
This post has been closed. You can still view previous posts, but you can't post any new replies.

Lookup Tables

I would like to see Lookup Tables. These would work that same as Rollable Tables except that you would send in a value and it would return the item at that line.
Can you give an example?
It would work something like this: given a table named MyTable with 6 entries in it A,B,C,D,E,F each with a weight of 1 you could use something like this: /w gm You selected  [[1t[MyTable]]] !         whispers to the gm a random selected item from the table, the way it works now. /w gm You selected  [[1t[MyTable|3]]] !      whispers to the gm - You selected C ! /w gm You selected  [[1t[MyTable|6]]] !      whispers to the gm - You selected F ! /w gm You selected  [[1t[MyTable|10]]] !    also whispers to the gm - You selected F ! because 10 is out of the array bounds. /w gm You selected  [[1t[MyTable| [[1d3]] ]]] ! would give you one of the first three item in the table. /w gm You selected  [[1t[MyTable|0]]] !      would whisper to the gm a random table item just as the rollable tables do now. If you use it with a negative number it should give you the first item in the table.
1599601624
David M.
Pro
API Scripter
In the meantime, since you're Pro, have you looked at the RecursiveTables script? <a href="https://app.roll20.net/forum/post/5954076/script-update-recursivetables-now-with-rollable-table-images-and-better-prefixing-rules-for-roll-templates" rel="nofollow">https://app.roll20.net/forum/post/5954076/script-update-recursivetables-now-with-rollable-table-images-and-better-prefixing-rules-for-roll-templates</a>
Yes I have looked at and use Recursive tables but they still don't do what I want here such as weather tables that have a window into the table that moves with the date. Sorry, I know what I am looking for but I am having a difficult time articulating it. I am running Dragon Heist and there are some tables in there such as Running a Business and Profit margins that could be combined into one macro with Lookup tables. Or how about the Equipment table from PHB.
1599651712
David M.
Pro
API Scripter
Sorry, I got distracted for around an hour between first reading your post and commenting, and mixed up your intent in my head. There is actually a lookup script, found&nbsp; here . Also written by TheAaron. To return the nth row of table TableName, just enter: !lookup TableName n Caveat: the output is always the same format in chat, and so not compatible with additional text (or templates) in macros as in your OP, but wanted to share in case it helped for some cases, at least.&nbsp;
Wow! that's great! I'll start playing around with it right now. Thanks!
Thanks for the suggestion! After 30 days, Suggestions and Ideas with fewer than 10 votes are closed and the votes are refunded to promote freshness. Your suggestion didn't build the right momentum this time, but feel free to submit it again! We find that the best suggestions describe the problem you are having, and the solution you want. You can learn more about the process of making suggestions on the Roll20 Wiki! More details can be found here .