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

Table Export and Excel*

I remember when Aaron posted his Table-Export script and thinking how useful it could be. Manually putting items into tables via the Roll20 VTT was rather painful. But between family and career I never had the time it seemed and simply forgot about it. Then Aaron came out with his great “Recursive-Table” script and I knew sooner or later I would need to build some tables on Roll 20. But once again other issues took away my free time. So here it is months (if not years) after he produced these two scripts and I am finally in a position to do some work with them. To add items into a table one must create lines that look like this: !import-table --nuts --hide This command lets the script know you want to create a new table, named nuts and then hide the output from the chat window. !import-table-item --nuts --Acorn --1 !import-table-item --nuts --Beech --1 !import-table-item --nuts --Breadnut --1 !import-table-item --nuts --Candlenut --1 !import-table-item --nuts --Chestnuts --1 !import-table-item --nuts --Chinese chestnuts --1 !import-table-item --nuts --Sweet chestnuts --1 !import-table-item --nuts --Deeknut --1 !import-table-item --nuts --Johnstone River almond --1 !import-table-item --nuts --Kola nut --1 !import-table-item --nuts --Kurrajong --1 These lines input the items in the table; giving them all a weight of 1. Of course typing all of this in a text file is not that much fun either. Wouldn’t it be better to just worry about the list of items you want to enter instead of all of the repeated commands? Here is how to do it with Excel (I believe there is a way in Open Office but I’ve not experimented with it.) I’ve been building “game aids” in Excel for years and never felt the need to re-build too many items in Roll20. But with Recursive Tables… I figured I would give it a try. A B C D E F G 1 2 !import-table-item -- Table Name -- Table Item -- 1 3 4 5 First, I broke the script parts into cells. Then came the challenge of adding the necessary spaces between the items. H I 2 =CONCATENATE(A2," ",B2,C2," ",D2,E2, " ",F2,G2) For that I use the Concatenate command. Column I puts all of the pieces back together and puts the proper spacing in place. In Excel you can grab the bottom right corner of a cell and drag it down which will duplicate the cell as many times as you want. Any number in the cell will grow by one though so you have to copy and paste the “1” into Column G. Once you have the parts in the right places it speeds everything up tremendously. You can build one row, and then pull down the entire row and duplicate it over and over. It is easy to add more rows when needed. So then you just need to change the name of the table in Column C and put the list in Column E: Acorn Beech Breadnut Candlenut Chestnuts Chinese chestnuts Sweet chestnuts Deeknut Johnstone River almond Kola nut Kurrajong To see how well it worked I wanted to go find and build some tables. I couldn’t use most of my work as it uses DND 3.5 edition copyrighted material. So I turned to Wikipedia. Here’s two quick examples. !import-table --haircolor --hide !import-table-item --haircolor --Black --40 !import-table-item --haircolor --Brown --30 !import-table-item --haircolor --Deep Brunette --10 !import-table-item --haircolor --Medium Brown --10 !import-table-item --haircolor --Light Brown --10 !import-table-item --haircolor --Chestnut Brown --5 !import-table-item --haircolor --Light Chestnut Brown --5 !import-table-item --haircolor --Auburn --10 !import-table-item --haircolor --Copper --5 !import-table-item --haircolor --Red --1 !import-table-item --haircolor --Titian --5 !import-table-item --haircolor --Strawberry Blonde --5 !import-table-item --haircolor --Light Blonde --5 !import-table-item --haircolor --Dark Blonde --10 !import-table-item --haircolor --Golden Blonde --15 !import-table-item --haircolor --Grey --20 !import-table-item --haircolor --White --2 !import-table --eyecolor --hide !import-table-item --eyecolor --Amber --5 !import-table-item --eyecolor --Blue --20 !import-table-item --eyecolor --Brown --40 !import-table-item --eyecolor --Gray --10 !import-table-item --eyecolor --Green --15 !import-table-item --eyecolor --Hazel --10 !import-table-item --eyecolor --Red --1 !import-table-item --eyecolor --Violet --5 !import-table-item --eyecolor --Mixed --2 I data-mined and created 17 charts off of Wikipedia (and other sites) in under an hour. I then imported them all into one of my games with one copy and paste. These aren’t exactly useful charts as they sit perhaps, but could be altered for use in a number of different settings. Rollable Tables: <a href="https://wiki.roll20.net/Collections#Rollable_Tables" rel="nofollow">https://wiki.roll20.net/Collections#Rollable_Tables</a> Table Export Script: <a href="https://app.roll20.net/forum/post/1144568/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/1144568/slug%7D</a> Recursive Table: <a href="https://app.roll20.net/forum/post/2845333/script-recursivetables-expands-inline-rolls-in-rollable-table-results/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/2845333/script-recursivetables-expands-inline-rolls-in-rollable-table-results/?pagenum=1</a> For all of the charts I created; they can be found here: <a href="https://docs.google.com/document/d/1o7FDW_rCNjGk9Q0GeYQQ-mC5Uo96_CZErHbpQjsdSCk/edit?usp=sharing" rel="nofollow">https://docs.google.com/document/d/1o7FDW_rCNjGk9Q0GeYQQ-mC5Uo96_CZErHbpQjsdSCk/edit?usp=sharing</a> *You need to be a Pro member in order to use API scripts.
1486067898
The Aaron
Pro
API Scripter
Nice! &nbsp;=D &nbsp;Even MORE reason for me to get the souped-up version Scott C. helped with out the door...&nbsp;
1486070940
Ziechael
Forum Champion
Sheet Author
API Scripter
Great guide and something I've done myself many times (for 3.5e treasure tables for example)... nice to see I'm not the only obsessive concatenater out there ;)
Aaron, I look forward to seeing the latest version once it is ready. Ziechael, Excel has been my "friend" for a long time for building gaming aids. All sorts of fun tricks and refinements possible. If only we had access to a basic&nbsp; "IF statement " on Roll20.... Almost two years ago I took and hacked to death an API script to create a monstrosity which could generate random pouch contents based on "Lesser," "Greater," "Noble," and "Royal." Some categories I made way back when and stuck around. It worked but was not very nice looking in the chat window. After Recursive Tables came out I simply created macros which called on a table to generate the same values as the script created but made it all more presentable.&nbsp;So now if nothing else, I got rid of one single use script for a more useful script. And Table Export allows me to build and use other tables quickly.
You can also format column G as text, to avoid having to copy and paste each cell.&nbsp; In addition, it seems like you could build the spaces into the "--" cells, so that your concatenate formula could just use A1,A2, etc.&nbsp; Just add a space before each "--" in the cell. EDIT:&nbsp; Annoyingly, formatting the column as text did not work for me, and it incremented the numbers.
It was a chore to get it all set up; but that was one of the pitfalls that had to be avoided. Once I figured most of my charts were under 100 entries I changed a few things so I just needed to change one cell and have the others all equal that one. Then used a macro with a CountA function to copy and paste the results of the used rows into a text file. I haven't worked on too many other tables since then. Was working on changing random treasure results a bit on an existing table. One that generates coins and the chance of gems, jewelry, and miscellaneous items found on folks, etc. The Recursive Table script opens up lots of possibilities.&nbsp;