Creating an image table in MapTool is tedious, at best, for all but the most trivial tables. I created a perl script to make the process much easier, especially for a large collection of images.
Perl runs on every platform that MapTool runs on so everyone should be able to use this script fairly easily.
To run this on your machine you'll need to have the following installed:
- a copy of
perl
(Strawberry Perl for Windows works) - a copy of
md5sum
(my script expects output like that from the GNUWin32 version of md5sum which is 1 line per file with the checksum, a space, an asterisk, and then the filename) - a zip file manipulation tool (e.g. 7-Zip, unzip, etc.)
- the ability to run commands in a terminal / command prompt window
This process should work on any platform (Windows, Linux, Mac, etc.) that has those tools available. I developed and tested this on Windows so your mileage may vary. If you experience problems, please let me know.
The process isn't hard or complicated; it's just tedious for a human. Computers excel at tediousness, so my strategy is to "make the computer do it."
Basically, we want to add a collection of image files to a .mttable file. The script defaults to jpg images, but you can change that by using the -e
command line option and specifying the new extension (i.e. -e png
). You can only use graphic formats supported by MapTool.
Table files (extension .mttable) are just zip files that are renamed. That makes them easy to work with directly.
- Create a folder named 'assets' (make sure it's lowercase and includes the 's' on the end)
- Copy the image files you want to use into the assets folder.
- Open a command prompt / terminal window
- Change directories into the assets folder you created.
- Run the attached perl script IN THE ASSETS DIRECTORY. Use the command line option
-n
to set the table name (e.g.-n "My Table Name"
or-n Fudge
. Use the command line option-e
to specify the extension if your images are not jpg images (e.g.-e png
) - Open your zip tool of choice (7zip, etc.)
- Add the assets folder and the two XML files (
content.xml
andproperties.xml
) created by the script in the parent directory of assets to the archive. - Save the archive and then rename it from x.zip to x.mttable ('x' can be any name).
- Open MapTool.
- Turn on the tables pane if it isn't already by selecting Window | Tables from the menu.
- In the tables pane click the 'import' button to import your table.
That's it. You should now have a new table named whatever you named your table using the -n
option (or, by default, 'deck'). You can rename the table at any point by selecting the table and then clicking the 'edit' button in the tables pane.
Hopefully this helps you create image tables for MapTool. They are very handy for creating decks of cards, sets of dice, etc.
I purchased a couple of the GameMaster's Apprentice (GMA) decks (which include VTT images) and created tables for them in MapTool. That makes it very quick to generate a character name, motivation, story plot, random encounter, etc. using 3 cards from the GMA. Here's the MapTool macro I use to draw the cards. Note that I resized the cards to 412x562 to save space (just select all the images at once in windows explorer; right click; select resize; then custom; then put in 412x562 as the size). The frame created will be too small if you don't resize the images.
[h: table="GMA Base"]
[h: setTablePickOnce(table, 1)]
[frame("GMA", "width=1266; height=600; temporary=1;"):
{
<html>
<head>
<title>[r:table]</title>
</head>
<body>
<img src="[r:tableImage(table)]">
<img src="[r:tableImage(table)]">
<img src="[r:tableImage(table)]">
</body>
</html>
}]
[h: setTablePickOnce(table, 0)]
This macro will open a window like this in MapTool. If you want different cards, just run the macro again. No need to close the window between invocations of the macro. It will replace the window contents with a new set of cards.
If you are OCD like me (note: obviously it should be 'CDO' because the letters should be in alphabetical order, duh!) it might bug you that the numbers in the GMA filenames don't match the numbers on the cards (e.g. file 2 is card 10). If so, here's a batch file that will rename the files so the numbers match. It also increases the number of digits to 3 for all cards (so 1 becomes 001, etc.) so they sort propertly in a file listing. And hey, no complaining, I said it was bonus OCD info.
You can edit the script and do a search and replace for the base part of the name depending on which set you have ('Base', 'SciFi', etc.).
ren "GMA Base VTT_Part1.jpg" "GMA Base 001.jpg"
ren "GMA Base VTT_Part2.jpg" "GMA Base 010.jpg"
ren "GMA Base VTT_Part3.jpg" "GMA Base 100.jpg"
ren "GMA Base VTT_Part4.jpg" "GMA Base 101.jpg"
ren "GMA Base VTT_Part5.jpg" "GMA Base 102.jpg"
ren "GMA Base VTT_Part6.jpg" "GMA Base 103.jpg"
ren "GMA Base VTT_Part7.jpg" "GMA Base 104.jpg"
ren "GMA Base VTT_Part8.jpg" "GMA Base 105.jpg"
ren "GMA Base VTT_Part9.jpg" "GMA Base 106.jpg"
ren "GMA Base VTT_Part10.jpg" "GMA Base 107.jpg"
ren "GMA Base VTT_Part11.jpg" "GMA Base 108.jpg"
ren "GMA Base VTT_Part12.jpg" "GMA Base 109.jpg"
ren "GMA Base VTT_Part13.jpg" "GMA Base 011.jpg"
ren "GMA Base VTT_Part14.jpg" "GMA Base 110.jpg"
ren "GMA Base VTT_Part15.jpg" "GMA Base 111.jpg"
ren "GMA Base VTT_Part16.jpg" "GMA Base 112.jpg"
ren "GMA Base VTT_Part17.jpg" "GMA Base 113.jpg"
ren "GMA Base VTT_Part18.jpg" "GMA Base 114.jpg"
ren "GMA Base VTT_Part19.jpg" "GMA Base 115.jpg"
ren "GMA Base VTT_Part20.jpg" "GMA Base 116.jpg"
ren "GMA Base VTT_Part21.jpg" "GMA Base 117.jpg"
ren "GMA Base VTT_Part22.jpg" "GMA Base 118.jpg"
ren "GMA Base VTT_Part23.jpg" "GMA Base 119.jpg"
ren "GMA Base VTT_Part24.jpg" "GMA Base 012.jpg"
ren "GMA Base VTT_Part25.jpg" "GMA Base 120.jpg"
ren "GMA Base VTT_Part26.jpg" "GMA Base 013.jpg"
ren "GMA Base VTT_Part27.jpg" "GMA Base 014.jpg"
ren "GMA Base VTT_Part28.jpg" "GMA Base 015.jpg"
ren "GMA Base VTT_Part29.jpg" "GMA Base 016.jpg"
ren "GMA Base VTT_Part30.jpg" "GMA Base 017.jpg"
ren "GMA Base VTT_Part31.jpg" "GMA Base 018.jpg"
ren "GMA Base VTT_Part32.jpg" "GMA Base 019.jpg"
ren "GMA Base VTT_Part33.jpg" "GMA Base 002.jpg"
ren "GMA Base VTT_Part34.jpg" "GMA Base 020.jpg"
ren "GMA Base VTT_Part35.jpg" "GMA Base 021.jpg"
ren "GMA Base VTT_Part36.jpg" "GMA Base 022.jpg"
ren "GMA Base VTT_Part37.jpg" "GMA Base 023.jpg"
ren "GMA Base VTT_Part38.jpg" "GMA Base 024.jpg"
ren "GMA Base VTT_Part39.jpg" "GMA Base 025.jpg"
ren "GMA Base VTT_Part40.jpg" "GMA Base 026.jpg"
ren "GMA Base VTT_Part41.jpg" "GMA Base 027.jpg"
ren "GMA Base VTT_Part42.jpg" "GMA Base 028.jpg"
ren "GMA Base VTT_Part43.jpg" "GMA Base 029.jpg"
ren "GMA Base VTT_Part44.jpg" "GMA Base 003.jpg"
ren "GMA Base VTT_Part45.jpg" "GMA Base 030.jpg"
ren "GMA Base VTT_Part46.jpg" "GMA Base 031.jpg"
ren "GMA Base VTT_Part47.jpg" "GMA Base 032.jpg"
ren "GMA Base VTT_Part48.jpg" "GMA Base 033.jpg"
ren "GMA Base VTT_Part49.jpg" "GMA Base 034.jpg"
ren "GMA Base VTT_Part50.jpg" "GMA Base 035.jpg"
ren "GMA Base VTT_Part51.jpg" "GMA Base 036.jpg"
ren "GMA Base VTT_Part52.jpg" "GMA Base 037.jpg"
ren "GMA Base VTT_Part53.jpg" "GMA Base 038.jpg"
ren "GMA Base VTT_Part54.jpg" "GMA Base 039.jpg"
ren "GMA Base VTT_Part55.jpg" "GMA Base 004.jpg"
ren "GMA Base VTT_Part56.jpg" "GMA Base 040.jpg"
ren "GMA Base VTT_Part57.jpg" "GMA Base 041.jpg"
ren "GMA Base VTT_Part58.jpg" "GMA Base 042.jpg"
ren "GMA Base VTT_Part59.jpg" "GMA Base 043.jpg"
ren "GMA Base VTT_Part60.jpg" "GMA Base 044.jpg"
ren "GMA Base VTT_Part61.jpg" "GMA Base 045.jpg"
ren "GMA Base VTT_Part62.jpg" "GMA Base 046.jpg"
ren "GMA Base VTT_Part63.jpg" "GMA Base 047.jpg"
ren "GMA Base VTT_Part64.jpg" "GMA Base 048.jpg"
ren "GMA Base VTT_Part65.jpg" "GMA Base 049.jpg"
ren "GMA Base VTT_Part66.jpg" "GMA Base 005.jpg"
ren "GMA Base VTT_Part67.jpg" "GMA Base 050.jpg"
ren "GMA Base VTT_Part68.jpg" "GMA Base 051.jpg"
ren "GMA Base VTT_Part69.jpg" "GMA Base 052.jpg"
ren "GMA Base VTT_Part70.jpg" "GMA Base 053.jpg"
ren "GMA Base VTT_Part71.jpg" "GMA Base 054.jpg"
ren "GMA Base VTT_Part72.jpg" "GMA Base 055.jpg"
ren "GMA Base VTT_Part73.jpg" "GMA Base 056.jpg"
ren "GMA Base VTT_Part74.jpg" "GMA Base 057.jpg"
ren "GMA Base VTT_Part75.jpg" "GMA Base 058.jpg"
ren "GMA Base VTT_Part76.jpg" "GMA Base 059.jpg"
ren "GMA Base VTT_Part77.jpg" "GMA Base 006.jpg"
ren "GMA Base VTT_Part78.jpg" "GMA Base 060.jpg"
ren "GMA Base VTT_Part79.jpg" "GMA Base 061.jpg"
ren "GMA Base VTT_Part80.jpg" "GMA Base 062.jpg"
ren "GMA Base VTT_Part81.jpg" "GMA Base 063.jpg"
ren "GMA Base VTT_Part82.jpg" "GMA Base 064.jpg"
ren "GMA Base VTT_Part83.jpg" "GMA Base 065.jpg"
ren "GMA Base VTT_Part84.jpg" "GMA Base 066.jpg"
ren "GMA Base VTT_Part85.jpg" "GMA Base 067.jpg"
ren "GMA Base VTT_Part86.jpg" "GMA Base 068.jpg"
ren "GMA Base VTT_Part87.jpg" "GMA Base 069.jpg"
ren "GMA Base VTT_Part88.jpg" "GMA Base 007.jpg"
ren "GMA Base VTT_Part89.jpg" "GMA Base 070.jpg"
ren "GMA Base VTT_Part90.jpg" "GMA Base 071.jpg"
ren "GMA Base VTT_Part91.jpg" "GMA Base 072.jpg"
ren "GMA Base VTT_Part92.jpg" "GMA Base 073.jpg"
ren "GMA Base VTT_Part93.jpg" "GMA Base 074.jpg"
ren "GMA Base VTT_Part94.jpg" "GMA Base 075.jpg"
ren "GMA Base VTT_Part95.jpg" "GMA Base 076.jpg"
ren "GMA Base VTT_Part96.jpg" "GMA Base 077.jpg"
ren "GMA Base VTT_Part97.jpg" "GMA Base 078.jpg"
ren "GMA Base VTT_Part98.jpg" "GMA Base 079.jpg"
ren "GMA Base VTT_Part99.jpg" "GMA Base 008.jpg"
ren "GMA Base VTT_Part100.jpg" "GMA Base 080.jpg"
ren "GMA Base VTT_Part101.jpg" "GMA Base 081.jpg"
ren "GMA Base VTT_Part102.jpg" "GMA Base 082.jpg"
ren "GMA Base VTT_Part103.jpg" "GMA Base 083.jpg"
ren "GMA Base VTT_Part104.jpg" "GMA Base 084.jpg"
ren "GMA Base VTT_Part105.jpg" "GMA Base 085.jpg"
ren "GMA Base VTT_Part106.jpg" "GMA Base 086.jpg"
ren "GMA Base VTT_Part107.jpg" "GMA Base 087.jpg"
ren "GMA Base VTT_Part108.jpg" "GMA Base 088.jpg"
ren "GMA Base VTT_Part109.jpg" "GMA Base 089.jpg"
ren "GMA Base VTT_Part110.jpg" "GMA Base 009.jpg"
ren "GMA Base VTT_Part111.jpg" "GMA Base 090.jpg"
ren "GMA Base VTT_Part112.jpg" "GMA Base 091.jpg"
ren "GMA Base VTT_Part113.jpg" "GMA Base 092.jpg"
ren "GMA Base VTT_Part114.jpg" "GMA Base 093.jpg"
ren "GMA Base VTT_Part115.jpg" "GMA Base 094.jpg"
ren "GMA Base VTT_Part116.jpg" "GMA Base 095.jpg"
ren "GMA Base VTT_Part117.jpg" "GMA Base 096.jpg"
ren "GMA Base VTT_Part118.jpg" "GMA Base 097.jpg"
ren "GMA Base VTT_Part119.jpg" "GMA Base 098.jpg"
ren "GMA Base VTT_Part120.jpg" "GMA Base 099.jpg"