RPTools.net

Discussion and Support

Skip to content

It is currently Sun Oct 22, 2017 11:08 pm 






Reply to topic  [ 5 posts ] 

Previous topic | Next topic 

  Print view

Author Message
 Offline
Kobold
 
Joined: Tue May 27, 2014 3:13 am
Posts: 9
Location: Belmont, MA, USA
 Post subject: Scripting token creation
PostPosted: Tue May 27, 2014 3:33 am 
Hello everyone,

I'm currently managing a website for sharing an amateur role-playing game (that I won't post here because it's a french website, furthermore I wouldn't like to look like an advertiser ;) ), and as I have a HUGE collection of images that I would like to use as tokens in a new framework that I'm building with friends for MapTool, I would like to know if there are scripting capabilities for TokenTool.

I already managed to make system shortcuts for TokenTool and MapTool for Debian/Ubuntu, if anyone is interested I could make tutorials for launching these programs from a terminal :)

OK, let's go to the main question:

In Unix/Linux shell language, I would like to know if there is a way to give arguments to TokenTool so that it could create a token from an image. E.g.:

Code:
tokentool --image=foo.png --output=bar.png


Thank you for giving me pointers :)

~Red


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9413
Location: Netherlands
 Post subject: Re: Scripting token creation
PostPosted: Wed May 28, 2014 5:31 am 
im definately not an expert in this area, but AFAIK: no. no arguments. You could dig around on this forum a bit for more info.

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3482
Location: Austin, Tx
 Post subject: Re: Scripting token creation
PostPosted: Wed May 28, 2014 1:35 pm 
I don't know of any command line tools but you could always add that functionality via patch and submit it.

Also, the rptok files are compressed XML. You could also write a XML utility to for existing rptok files.

Lastly, ImageMagick is a command line utility for manipulating images
http://www.imagemagick.org/

Here are some of the capabilities
Here are just a few examples of what ImageMagick can do:

Quote:
Format conversion: convert an image from one format to another (e.g. PNG to JPEG).
Transform: resize, rotate, crop, flip or trim an image.
Transparency: render portions of an image invisible.
Draw: add shapes or text to an image.
Decorate: add a border or frame to an image.
Special effects: blur, sharpen, threshold, or tint an image.
Animation: create a GIF animation sequence from a group of images.
Text & comments: insert descriptive or artistic text in an image.
Image identification: describe the format and attributes of an image.
Composite: overlap one image over another.


Hope that helps.

_________________
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
 Offline
Kobold
 
Joined: Tue May 27, 2014 3:13 am
Posts: 9
Location: Belmont, MA, USA
 Post subject: Re: Scripting token creation
PostPosted: Sat May 31, 2014 5:19 am 
Yeah, so I finally ended up using ImageMagick to create token-like objects and the result is not so bad.
Here is the script I wrote and ran:

Code:
#!/bin/bash
mkdir out
for f in *.png
do
 convert -geometry x256 $f out/$f
done
cd out
mkdir out
for f in *.png
do
 convert $f -scale 256x256 -background transparent -gravity center -extent 256x256 out/$f
done
cd out
mkdir out
for f in *.png
do
 convert -size 256x256 xc:transparent -fill $f -strokewidth 10 -stroke gray -draw "circle 128,128 128,5" +repage out/$f
done


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3482
Location: Austin, Tx
 Post subject: Re: Scripting token creation
PostPosted: Sat May 31, 2014 7:11 am 
Good deal. Thanks for sharing.

_________________
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 5 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman