Thread: D&D Miniatures Resizing Script
-
April 12th, 2010, 13:22 #1
- Join Date
- Oct 2009
- Location
- GMT -6 hrs
- Posts
- 503
D&D Miniatures Resizing Script
This script was based off of work done by "valeros". The original can be found here.
The included script is designed to download images files from a website (in this case, WotC's D&D Mini Preview pages), convert the files to PNG and remove the originals.
BE AWARE: The VBScript file (ending in VBS) uses features that some antivirus programs may consider the file to be a virus. You may view the details of the file by editing the file as described in the "Before Running" section.
Before Running
================================================== ========
- ImageMagic needs to be installed on the system.
- This script has been tested with ImageMagick 6.5.7 for Windows
- https://www.imagemagick.org/
- You must configure the "START UPDATE" sections in the file.
- To edit, right click the file and choose "Open With..." and choose "Notepad" or another text editor.
- Version 1
- Line 17
- Change the location to where you would like to store the files.
- The location must be enclosed in quotation marks.
- The location must end in a \
- Example:
Code:CurrLoc = "C:\Downloaded Files\Fantasy Grounds\tokens\"
- Line 19
- Change the location to where ImageMagick is located.
- The location must be enclosed in quotation marks.
- The location must end in \convert.exe
- Only change the location of the line (In the example below, c:\program files\ImageMagick-6.5.7-1)
- Example:
Code:ConvertLoc = chr(34) & "c:\program files\ImageMagick-6.5.7-1\convert.exe" & chr(34) & " "
- Line 46 & 47
- If you would like to keep the original JPG files that were downloaded, put an apostraphe (') before the text on these lines.
- Example 1:
Code:'AddToBatchFile("PING -n 20 127.0.0.1>nul") 'AddToBatchFile("DEL " & chr(34) & CurrLoc & arySets(i,0,SysNum) & "\*.jpg" & chr(34))
- Example 2:
Code:' AddToBatchFile("PING -n 20 127.0.0.1>nul") ' AddToBatchFile("DEL " & chr(34) & CurrLoc & arySets(i,0,SysNum) & "\*.jpg" & chr(34))
- Line 17
To Run
================================================== ========
- Extract the files.
- Double Click on the "DownloadAndResize.vbs" file.
- When prompted, enter the size of the of the Medium sized pixel.
- After all files are downloaded, you will be notified and a DOS box will populate to modify the file.
- When the DOS box goes away, the files are complete.
- The images will be located in the folder on Line 17.
Version 1 Features:
================================================== ========
- Saves downloaded images to a folder created for each set of miniatures.
- Modifies background to remove white space.
- Resizes the images based on the size of the creature (ex, Small is 0.75x the size of Medium, Large is 2x the size of Medium)
- Currently configured for 3.x Edition
- Includes the following sets:
- Set Symbols
- Harbinger
- Dragoneye
- Archfiends
- Giants of Legend
- Aberrations
- Deathknell
- Angelfire
- Underdark
- War Drums
- War of the Dragon Queen
- Blood War
- Unhallowed
- Night Below
- Desert of Desolation
- Dungeons of Dread
- Against the Giants
- Demonweb
- Players Handbook Heroes Series 1
- Dangerous Delves
- Legendary Evils
- Players Handbook Heroes Series 2
- Savage Encounters
Any feedback is appreciated!
EDIT: Original file did not download the files due to testing bug. This has been fixed in the current attachment.Last edited by tdewitt274; April 12th, 2010 at 14:06.
-
April 12th, 2010, 13:48 #2
Downloading does not start after entering the pixels
Everybody lies...
-Dr. Gregory House, HOUSE MD-
Urge to destroy world, rising...
-Black Mage, 8-Bit Theater-
-
April 12th, 2010, 14:09 #3
- Join Date
- Oct 2009
- Location
- GMT -6 hrs
- Posts
- 503
Originally Posted by Czarisyn
Thanks!
-
April 12th, 2010, 14:43 #4
worked nicely, good work
Everybody lies...
-Dr. Gregory House, HOUSE MD-
Urge to destroy world, rising...
-Black Mage, 8-Bit Theater-
-
April 14th, 2010, 14:40 #5
- Join Date
- Oct 2009
- Location
- GMT -6 hrs
- Posts
- 503
Version 2
Here's a newer version that will set everything up for making your own modules.
Previously noted lines have been changed to account for new code. Please review the "READ ME.TXT" file in the zip folder for details.
- Adds a "definition.xml" and "thumbnail.png" (using the set name, where available from the WotC website) file for module creation.
- Moves the files to a \[Set Name]\tokens\[Set Name] format to allow for module creation.
- To create the module, go into the \[Set Name]\tokens folder and select all files, add to your favorite zipping utility.
- Rename as appropriate, with the extention ".mod" instead of ".zip"
- Modified code to handle new features.
Any feedback is appreciated!
-
April 15th, 2010, 03:33 #6
- Join Date
- Oct 2009
- Location
- GMT -6 hrs
- Posts
- 503
Version 3 - Creates MOD files
The script now creates a Module (MOD) file for each set. After the scripting is completed, copy the Module to your "modules" folder for Fantasy Grounds.
See the screen shot for an example of the finished product.
Previously noted lines have been changed to account for new code. Please review the "READ ME.TXT" file in the zip folder for details.
EDIT: Updated the ZIP file to resolve the War Drums and Night Below thumbnails show in the modules.
Code:Line 306 aryNames(0,0,11,0) = "ddm_setsymbol_11.jpg,Blood War.jpg,M" Line 308 aryNames(0,0,13,0) = "ddm_setsymbol_13.jpg,Night Below.jpg,M"
Last edited by tdewitt274; April 15th, 2010 at 13:07.
-
April 20th, 2010, 21:35 #7
tried version 3, the mod file doesn't get made, I do see a definition file and a zip file though
Everybody lies...
-Dr. Gregory House, HOUSE MD-
Urge to destroy world, rising...
-Black Mage, 8-Bit Theater-
-
April 21st, 2010, 00:25 #8
- Join Date
- Oct 2009
- Location
- GMT -6 hrs
- Posts
- 503
Originally Posted by Czarisyn
Sorry, I'm on a mobile phone and can't provide the link.
-
April 22nd, 2010, 02:48 #9
- Join Date
- Oct 2009
- Location
- GMT -6 hrs
- Posts
- 503
Thread on troubleshooting an issue with the v003 script.
I'll post a more permanent solution when available.
-
April 22nd, 2010, 03:34 #10
- Join Date
- Oct 2009
- Location
- GMT -6 hrs
- Posts
- 503
Version 4
A new version has been posted. This is pretty much the same as the previous version, with a few enhancements, code revisions, and a bug fix.
Dialog boxes are now used instead of modifying the actual script file. Please see the below instructions of how to run the script (also included in the Read Me text file).
- Extract the files.
- Double Click on the "DownloadAndResize.vbs" file.
- You will be asked to choose a folder for saving the files.
- Navigate to the folder desired.
- If the folder does not exist, you can create a "New Folder" by clicking the "New Folder" and typing a name.
- The system will automatically determine the location of ImageMagick.
- If ImageMagick is not found automatically, you will be prompted to find the "convert.exe" file.
- Navigate to the folder location of ImageMagick and double click on the "convert.exe" file.
- If ImageMagick is not found automatically, you will be prompted to find the "convert.exe" file.
- When prompted, enter the size of the of the Medium sized pixel.
- After all files are downloaded, you will be notified and a DOS box will populate to modify the file.
- When the DOS box goes away, the files are complete.
- The images will be located in the folder chosen at the begining of the script.
- Copy the created Module (MOD) files to your "module" folder for Fantasy Grounds.
Let me know if you encounter any issues.
Thanks
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks