Export Battlemap as JPG - Script

Some time ago I wanted a way to easily export a portion of a map at set resolutions in order to be used in various VTT software. I played around with scripting it and am finally happy with the result. I thought I'd share it here. It can be run purely as a script, or if you want you can install the additional images and make easy to use buttons for them. The scripts were primarily intended for exporting battlemaps at some common resolutions of 50x50px per 5' and 100x100px per 5'. I have included 3 versions of the script for different resolutions.

Export10pxPerUnit.scr - Exports the selected area at a resolution of 10px per map unit. So if you select a 50x50 area, the resulting image will be 500x500 px (I use this for systems that want 50x50px per 5')
Export20pxPerUnit.scr - Exports the selected area at a resolution of 20px per map unit. So if you select a 50x50 area, the resulting image will be 1000x1000 px. (I use this for systems that want a 100x100px per 5')
ExportSelPxPerUnit.scr - Exports the selected area and allows you to enter a resolution per unit area. (For Roll20 VTT which expects images to be at 70x70px per 5', use a resolution of 14)

How it works.
When the script is run, it prompts you to click on two points defining an area of the map to be exported.
The script will turn off the GRID sheet (if you want the grid printed, you can always remove the lines "HIDESHT GRID" and "TOGLSHT GRID;"
The script will then create a folder with the same name as the map if it doesnt exist, and then prompt the user to enter a file name for the export.
The script will then create the JPG file inside the created folder.


Install Instructions
Copy the .scr files into the CC3Plus install folder, typically at C:/ProgramData/Profantasy/CC3Plus/
Optional - If installing the buttons.
Copy the Bitmaps folder to the CC3Plus install folder.
Once copied over, the images should appear in CC3Plus/Bitmaps/Icons/ebm/
Make a backup of any .mnu files you will edit.
Edit the .mnu files where you wish the icons to be available. (I usually only edit the dungeon.mnu, city.mnu, and ss4.mnu files) Add the text from the "Add to MNU files.txt" into the file after the last line beginning with a # and before the "&File:" line. The numbers selected were chosen so it wouldn't interfere with any of the Vintyri packages.
If not already on, turn on the Custom icon bar 3 and restart CC3.

Usage
If using as a script without the buttons type one of the following depending on which version you want to use and follow the prompts.
scriptm @Export10pxPerUnit
scriptm @Export20pxPerUnit
scriptm @ExportSelPxPerUnit

Select the first point and second point outlining the area to be exported. It is helpful to have a grid set and Snap turned on to get exact areas exported.
Enter the resolution to export to if prompted.
Enter the filename of the image to be exported.

If you choose to install the buttons, you can just click the button on the toolbar and then follow the prompts as above.
Sign In or Register to comment.