RPTools.net

Discussion and Support

Skip to content

It is currently Thu Oct 19, 2017 12:08 am 






Reply to topic  [ 124 posts ]  Go to page 1, 2, 3, 4, 5 ... 9  Next

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Dragon
 
Joined: Fri Mar 23, 2007 10:27 am
Posts: 778
Location: Sussex, UK.
 Post subject: TokenMaker
PostPosted: Mon Jun 21, 2010 5:45 am 
Some Background
I've just started to learn java and so as an intellectual exercise I figured I'd put my skills to practice doing something I might enjoy and that might actually be useful to me when and if I ever finish it. I looked about for projects to get my hands on and I realised that there was an opportunity available for MapTool that I could have a crack at - automated Token Generation.

Me and my pals play D&D 4E. We are currently using MT as our VTT and one of our number lives 250 miles away and dials in, with Skype, to join the games. It works great. I am the DM. I'm also the techie who understands all the technology we are using (although others understand most of it too). But no one else has yet taken up the batton of DMing using MapTool. We use a complicated Framework (a highly modified version of Veggie's) and I use a modified version of James Mastersen's monster cut and paste to generate my monsters. It's relatively simple for me to make PC tokens and Monster tokens but its not as easy as it could be. If I want others in my group to use MT as DMs I'm going to have to explain to them how to build monster and PC tokens using these tools I've cobbled together and hacked. It's not easy.

We all have a DDi subscription, so we all have access to the Compendium and the Character Builder. All our PCs are built from the Character Builder and when making my campaigns I nearly always pick and choose monsters already existing in the Compendium. I have used the Monster Builder to build a few monsters at times too.

So, I thought, if I could make a program which would very simply and easily create PC and Monster tokens for MapTool that would be dead handy. It would also make a good project to play around with for learning Java. Hence TokenMaker was born.


TokenMaker
TokenMaker has been designed to do two distinct jobs:
1. Make PC/Player tokens.
2. Make Monster tokens.
I'm going to address both of these separately. Note that TokenMaker is 100% geared towards making 4E D&D tokens and definitely requires a DDi subscription to use.

1. PC Tokens
What I want is a tool that will take an existing DDi Character Builder Save File and generate a Player Token for MapTool.
The idea would be simply that you select a ".dnd4e" save file and press build and off it goes. It can get all the basic stats for your PC from there. It can parse out the Powers. It can also get a portrait file - which will be needed to make a token. The only thing missing is the details of what the Powers do. But the program can look that up as we make the token, if we have access to the Compendium inside the program. Press a button and "pop", a token can be made and saved.

2. Monster Tokens
Building monsters is perhaps a little more complicated in places and easier in others. I want the facility to look up monsters by name ("Goblin" for example) and have it throw me up a list to pick from. Click on the name in question and pop up it's stat block. Then pick a portrait file and press a button and "pop", out comes a monster token.

This Thread
This thread is here for me to report my progress on this task. I'm going to use it to report when I've completed parts of the task and to brain storm ideas for what I want it to do next. Feel free to chip in and help out wth comments and suggests and critque.

My Coding Speed
One thing I should point out up front is that I'm a busy chap. I have a full time job, a family, I run a D&D campaign which needs a lot of time spent on it, and I have a good social life. I'll spend the odd hour on the PC coding up some java as and when I have the time and feel the desire to do so. So don't expect this project to be finished any time soon. In fact, if it's anything like many of my other projects it may well never get finished.

_________________
The guy in the green hat.


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Mar 23, 2007 10:27 am
Posts: 778
Location: Sussex, UK.
 Post subject: Re: TokenMaker
PostPosted: Mon Jun 21, 2010 5:52 am 
PC Parsing

Things I've got working so far:
  • Open the save file.
  • I can parse out the basic stats for the PC (name, level, class, etc)
  • Get the portrait file name.
  • I go through and pick out each Power the PC has.
  • With each Power I'm capturing their attack and damage stats per weapon equipped.

Things still to do:
  • Grab their skills
  • Make a GUI to handle/display all this.
  • The Whole MapTool side of things (building a MT token with macros for powers, etc, etc).

Basically I have some simple parsing working here and am getting most of what I want out of the save file and into a Object for the PC. I still need to scan Skills and then I'm about there, ready to start looking into how on earth I'm going to output this into an actual MT token.

_________________
The guy in the green hat.


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Mar 23, 2007 10:27 am
Posts: 778
Location: Sussex, UK.
 Post subject: Re: TokenMaker
PostPosted: Mon Jun 21, 2010 5:54 am 
Monster Parsing

I've made some good progress on here to date. One thing which has been really tough has been getting access to the Compendium programatically. It is easy to do searches on the Compendium, so getting a list of monsters with the name "Goblin" in them is simple. But actually getting the HTML code for a given monster has been a nightmare. Thanks to the usual very helpful people on this board I have now cracked that hurdle. This is what I have so far:

When you start up TokenMaker and tell it you want to build a Monster it pops up the frame below. You can type something you want into the "Name:" field and press "Find" and it goes off and finds all the monsters matching that name:

Attachment:
File comment: The Monster Maker
monstermaker.jpg
monstermaker.jpg [ 157.92 KiB | Viewed 4747 times ]


Selecting a monster and pressing the Build button (or double clicking the monster name) will pop up a new frame with the monster's web entry in it:

Attachment:
File comment: The Monster Build Dialog
goblinunderboss.jpg
goblinunderboss.jpg [ 114.5 KiB | Viewed 4747 times ]


You can use the Portrait button to pop up a file chooser to select yourself a portrait file for this monster.

Still To Do
  • Add the portrait (thumbnail) that you select to the Builder Frame so you can see it.
  • Scan the HTML page we grabbed and populate the underlying Monster object - I suspect this will be a non-trivial task! Need to populate the Powers collection as we go.
  • Do the whole "Build a MapTool Token" thing.

_________________
The guy in the green hat.


Last edited by Blakey on Mon Jun 21, 2010 6:05 am, edited 1 time in total.

Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Mar 23, 2007 10:27 am
Posts: 778
Location: Sussex, UK.
 Post subject: Re: TokenMaker
PostPosted: Mon Jun 21, 2010 5:54 am 
Frameworks

Before I can start building actual tokens I need to come up with a final plan for what I'm going to do with respect to Frameworks - if I'm going to make a new Framework to suuport this application or if I'm going to try and build tokens for specific existing Frameworks like Veggies and Rumbles. Much more thought is needed in this area.

_________________
The guy in the green hat.


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Mon Jun 29, 2009 9:37 am
Posts: 3108
Location: Germany
 Post subject: Re: TokenMaker
PostPosted: Mon Jun 21, 2010 6:14 am 
The cleanest solution would be to open your tool to support "any" framework - given someone wrote an "exporter class" (or whatever needed) for it. If you think now extendable it shouldnt be so much harder than to write one fixed solution.

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

most complete list of my maptool stuff


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Mar 23, 2007 10:27 am
Posts: 778
Location: Sussex, UK.
 Post subject: Re: TokenMaker
PostPosted: Mon Jun 21, 2010 6:17 am 
What's Next

I think I'm going to get both the PC and Monster scanning stuff working completely first. So I need to make sure I can get all the info I need from the PC save file and into the PC object. And I need to parse the Monster HTML and get that all stored in my internal Monster object. That's step one really.

Once that is done I have to have a serious think about how I get from my internal classes to actual MapTool tokens. I'm not even thinking about this yet!! :D

_________________
The guy in the green hat.


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Mar 23, 2007 10:27 am
Posts: 778
Location: Sussex, UK.
 Post subject: Re: TokenMaker
PostPosted: Mon Jun 21, 2010 6:18 am 
CoveredInFish wrote:
The cleanest solution would be to open your tool to support "any" framework - given someone wrote an "exporter class" (or whatever needed) for it. If you think now extendable it shouldnt be so much harder than to write one fixed solution.


Yeah, excellent suggestion. I'll keep that in mind - thanks.

_________________
The guy in the green hat.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5410
 Post subject: Re: TokenMaker
PostPosted: Mon Jun 21, 2010 8:14 am 
Blakey wrote:
What's Next

I think I'm going to get both the PC and Monster scanning stuff working completely first. So I need to make sure I can get all the info I need from the PC save file and into the PC object. And I need to parse the Monster HTML and get that all stored in my internal Monster object. That's step one really.

Once that is done I have to have a serious think about how I get from my internal classes to actual MapTool tokens. I'm not even thinking about this yet!! :D


Well... one option is to serialize the Monster/PC object as an XML document. Then the end user could provide an XSLT to transform the XML content from one form to another based on the token's internal structure (or some other intermediary structure. This would make it fairly simple for thinks like skills, abilities, to be stored no matter what the target framework's property names are. The powers are the big ugly piece here. Some frameworks store the power directly on the token macro, others store a JSON description of the power on the token inside the macro, others store the JSON description in a token property, and others store a JSON description on a Lib token... I am sure there are other combos I am not thinking of right now.

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Mar 23, 2007 10:27 am
Posts: 778
Location: Sussex, UK.
 Post subject: Re: TokenMaker
PostPosted: Mon Jun 21, 2010 8:27 am 
jfrazierjr wrote:
Well... one option is to serialize the Monster/PC object as an XML document. Then the end user could provide an XSLT to transform the XML content from one form to another based on the token's internal structure (or some other intermediary structure. This would make it fairly simple for thinks like skills, abilities, to be stored no matter what the target framework's property names are. The powers are the big ugly piece here. Some frameworks store the power directly on the token macro, others store a JSON description of the power on the token inside the macro, others store the JSON description in a token property, and others store a JSON description on a Lib token... I am sure there are other combos I am not thinking of right now.


I'm well away from getting here still, but I think this is a good idea. I'll probably provide some sort of simple XML output as a first step - using serialize as you suggest. People can then take them and run with them for their own frameworks in the short term.

I definitely want to be able to press a button and have it save a Token out of this tool when I'm all done. I suspect that the most likely approach I'll take here is to make myself a new Framework that this tool generates tokens for. As suggested earlier if I write an interface to represent "tokenizable" (!!!) then anyone can come along later and write a class to implement that interface for their own framework.

But this is way in the future!

_________________
The guy in the green hat.


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Mar 23, 2007 10:27 am
Posts: 778
Location: Sussex, UK.
 Post subject: Re: TokenMaker
PostPosted: Mon Jun 21, 2010 10:36 am 
Player Maker

Today I added a little frame to display the Player and let you load PC save files. It looks like this:

Attachment:
File comment: Player Maker Frame
playermaker.jpg
playermaker.jpg [ 127.35 KiB | Viewed 4727 times ]


This is with the 18th level wizard in my current campaign loaded. As you can see there is a list of all his powers in the middle of the screen and when you mouse over a given power a ToolTip pops up with the stats of that power with his first equipped weapon, for reference (although you can't see all the tool tip on this screen grab). Getting there.

Next up on PCs is to scan in Skills from the Save File and maybe display them on this frame.

_________________
The guy in the green hat.


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Mar 23, 2007 10:27 am
Posts: 778
Location: Sussex, UK.
 Post subject: Re: TokenMaker
PostPosted: Tue Jun 22, 2010 3:40 am 
Player Maker

Last night I added a little portrait onto the Player Maker frame. This is the default file that is held as the portrait for your PC inside the CB save file. It's enabled as a button so you can click on it and it will pop up a file chooser which will allow you to change the portrait displyed. This doesn't change the portrait on the character builder save file but when the time comes to build a MT token this is the portrait that will be used for the token.

It now looks like this:

Attachment:
File comment: Player Maker frame with a clickable portrait.
playermaker.jpg
playermaker.jpg [ 117.15 KiB | Viewed 4705 times ]


Next up - scanning the save file for Skill data and saving it with the PC object.

_________________
The guy in the green hat.


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Fri Mar 23, 2007 10:27 am
Posts: 778
Location: Sussex, UK.
 Post subject: Re: TokenMaker
PostPosted: Wed Jun 23, 2010 8:06 am 
Quick update.

I've now got the PlayerMaker scanning the save file and grabbing out all the PC stats of significance and saving them away, including the skills. So basically I can now read a Character Builder save file and get everything out of it I think I need.

Today I have created a Token class to deal with actually creating a MapTool token. I have written all the code to create all the constituent parts of the token in the right places and then zip them up to make an rptok file. I've added some code to the PlayerMaker frame such that when you click the "Save" button it pops up a dialog box, asking for a save file name (*.rptok). Once that is selected it actually goes off and builds a plain MapTool token. Yay!

Trouble is, if you come to try and use the token inside MapTool it doesn't recognise it as a valid token. That whole side of things needs debugging and fixing up and then I'm at the stage where I can generate tokens from my saved PC files. Of course the tokens I'm creating have no MT Properties or Macros on them yet so we have a LONG way still to go.

_________________
The guy in the green hat.


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Sun Jun 22, 2008 12:23 am
Posts: 231
Location: Tampa, FL
 Post subject: Re: TokenMaker
PostPosted: Thu Jun 24, 2010 9:33 am 
Have you considered publishing your code as you go along? You could use google code as a repository, then folks can see what you have and possibly contribute.

_________________
When the boogeyman goes to bed everynight, he checks his closet for Chuck Norris.


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Fri Apr 20, 2007 11:12 pm
Posts: 2317
Location: Albuquerque, NM
 Post subject: Re: TokenMaker
PostPosted: Thu Jun 24, 2010 10:02 am 
Very cool... would love this to be easily integratable (is that a word?) with Rumble's framework someday. Great work.


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Tue Mar 31, 2009 8:48 pm
Posts: 290
Location: Lakewood, CO
 Post subject: Re: TokenMaker
PostPosted: Thu Jun 24, 2010 11:22 am 
Are you concentrating on this being specifically for D&D, or a more general tool?

I'd love to see a more general tool, along the lines of what I suggested in this thread awhile back:

viewtopic.php?f=2&t=13036


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 124 posts ]  Go to page 1, 2, 3, 4, 5 ... 9  Next

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