Custom TokenTool 1.0b32 (Nerps!)

Thoughts, Help, Feature Requests

Moderators: dorpond, trevor, Azhrei


User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Custom TokenTool 1.0b29 (Nerps!)

Post by JamzTheMan »

Thanks username. I think I originally got hung up on the getTransferObject(transferable) and looking for some direct methods to use.

The post inspired me to take another look now that I know it was possible for sure. And what do you know, the rplibs already had a file handler routine built for me to return a list or file URL's! :)

So, TokenTool 1.31 will now pull the file name from the URL (either dragged from Chrome or filesystem). (I drop the extension) Note: IE 11 doesn't seem to like drag n drop into TokenTool, looks to be a security thing... bah, who uses IE anyway lol

It uses whatever name is in the Filename input box for token or image saves as well as setting the MapTool Name & GM Name for rptok saves. The input is filled with the filename on drag n drop event but can be changed/edited afterwords.
Screenshots
tt1.JPG
tt1.JPG (23.85 KiB) Viewed 8192 times
tt2.JPG
tt2.JPG (15.76 KiB) Viewed 8192 times
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Custom TokenTool 1.0b31 (Nerps!)

Post by JamzTheMan »

OK, build 1.0b31 is posted. Changelog/links updated in OP and signature. Enjoy!
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Darcphaze
Cave Troll
Posts: 91
Joined: Sun Aug 10, 2008 9:29 pm
Contact:

Re: Custom TokenTool 1.0b31 (Nerps!)

Post by Darcphaze »

Just thought I'd say YOU GUYS ROCK

Great stuff. Anything that makes a GM's job easier is fantastic in my book.
No matter what a GM plans for, the players are certain to find another way to do it

Altcode
Kobold
Posts: 2
Joined: Mon Nov 10, 2014 4:55 pm

Re: Custom TokenTool 1.0b31 (Nerps!)

Post by Altcode »

Not sure if I'm doing something wrong on my end, but I can't seem to change the images on tokens that have been dragged as rptok tokens once they're in MapTool. Looks like all that does for these is add a new image to the assets folder and a new entry in content.xml's imageAssetMap instead of replacing the current one.

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Custom TokenTool 1.0b31 (Nerps!)

Post by JamzTheMan »

Altcode wrote:Not sure if I'm doing something wrong on my end, but I can't seem to change the images on tokens that have been dragged as rptok tokens once they're in MapTool. Looks like all that does for these is add a new image to the assets folder and a new entry in content.xml's imageAssetMap instead of replacing the current one.
Are you referring to the Portrait image or the Token Image? I'll take a look when I get a chance here.

Also, are you drag and dropping or saving then loading the tokens?
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

Altcode
Kobold
Posts: 2
Joined: Mon Nov 10, 2014 4:55 pm

Re: Custom TokenTool 1.0b31 (Nerps!)

Post by Altcode »

Just the token image has the problem, looks like the portrait image changes fine. Doesn't seem to matter how it gets into MapTool so long as TokenTool spit it out as an rptok, tried dragging/dropping and saving first. I'm using MapTool 1.3.b91 if that changes anything.

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Custom TokenTool 1.0b31 (Nerps!)

Post by JamzTheMan »

OK, I can duplicate this, thanks for the heads up! It looks like MT adds the image but doesn't update the xml for the current asset. I should be able to clean this up soon(tm).
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Custom TokenTool 1.0b32 (Nerps!)

Post by JamzTheMan »

Ok, bug squashed!

Build 32
o Fixed bug that prevented user from changing Token Image inside MapTool.[/spoiler]
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Custom TokenTool 1.0b32 (Nerps!)

Post by aliasmask »

I've seen this with iMarv's 3.5/pathfinder tokens from his site. I think I fixed by cut/pasting token after I load it.

Tielc
Cave Troll
Posts: 25
Joined: Wed Jul 16, 2014 10:41 pm

Re: Custom TokenTool 1.0b32 (Nerps!)

Post by Tielc »

Jamz,

I was hoping you, having created this might be the best source to the answer I am looking for.

I am currently re-writing my own HeroLab to Maptool tool so I can better modify the macros and properties that are created. I'm doing this in .NET and I'm using the Cyrptography.MD5 class to accomplish this.

The issue I'm running into is the actual images give me the correct hash codes as shown here
3a2444f5097382ce5cf23a1b5dae71e5.png
3a2444f5097382ce5cf23a1b5dae71e5.png (35.39 KiB) Viewed 8087 times
= 3a2444f5097382ce5cf23a1b5dae71e5 (size = 36,241 bytes)

However, the other file in the .rptok file (the one with the matching name / no extension) does not as shown here
it won't let me attach it to the forum, but anyway, it's filename is 3a2444f5097382ce5cf23a1b5dae71e5, but it's MD5 Hash = ed56f11d7a4d6a496dc0d397f12f32a9 (size = 198 bytes)

Now, my first though is this makes sense, as the files are different sizes, which means they do not contain the same byte data. I looked at the non extension-ed file, and it looks just to be an xml file.

What is this second file for? Does it have to exist in the .rptok file? Does the content.xml file reference this (as opposed to the image file itself first?)

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Custom TokenTool 1.0b32 (Nerps!)

Post by JamzTheMan »

Honestly, I'm not sure why they did it that way. I haven't delved into those classes to much to look into it. I simply called the same classes in MT to create the token (I didn't need to recreate the wheel).

It's a shame you are doing it in .net but I understand we all have our comfort zone. We really need it built into MT with a suite of xml methods/macros so we can manipulate these xml files better.

If you do have success, can you give thought to externalizing the MT property names a bit? Or use lmarcus's framework? It seems every one of these tools always create their own framework so I always go back to using regexp parser...
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

Tielc
Cave Troll
Posts: 25
Joined: Wed Jul 16, 2014 10:41 pm

Re: Custom TokenTool 1.0b32 (Nerps!)

Post by Tielc »

I just checked, out of curiosity, and the non-extension files don't appear to be needed by Maptool.

For reference, I opened the .rptok file with winzip and removed them all, and the tokens drop into MapTool just fine; in both build b91 and your NERPS version. This will just make creating the .rptok file easier later.

As for the development platform, it's purely as you mentioned, comfort level. I've been writing small apps (as addins) for my company's software (SOLIDWORKS) for nearly 13 years, starting back in VB6. In that time, I should have learned C# and hence Java as a byproduct. Unfortunately, I've never sat down and learned the syntax well enough to be comfortable with it. I always end up wasting a bunch of time trying to get the syntax right, when I could just write it in VB quickly; same goes for WPF. I spent weeks figuring it out, wanting to benefit from the automatic binding of WPF, but in the end I abandoned it.

I'm more than happy to share my source, which you can use if you want to determine how I'm reading the .por files from MapTool. I'm just using serialization and took the time to create all the classes that match the xml they output (this is finished).

Now I'm working on transferring the data to similar serializable objects for the MapTool xml in the .rptok file. I'm also spending time determining how I want this whole process to work. I really like what Dracones has written, so much, that it was the reason I ended up purchasing Hero Lab. The challenges I'm having however (http://forums.rptools.net/viewtopic.php ... 3&start=45) have kept me from implementing it the way I wanted.

So to your final point, I am planning on implementing the ability to map any properties I can read from HeroLab to any property in MapTool. As for the Macros, I'm going to create a macro editor (no context sensitive tools) in my app, where you can decide / write the macros you want for your tokens (similar to what he created later on).

Some of this is reinventing the wheel, but I was debating between using HeroLab in parallel with Maptool. I find it really nice to do as much as possible in MapTool as possible however. I'm NOT looking to convert every pre-generated character in Pathfinder existence like he was. Mine is on a token by token basis, though, you can still create multiple tokens at once.

I've included the class library I've written to read the Hero Lab Files here:
HeroLab.zip
(24.79 KiB) Downloaded 94 times
All of the classes in the .dll are public. I'm not familiar, as mentioned with Java, but in .NET, if you call HeroLab.LoadPORFile(filenames()) (the only argument is an array of file locations) it will return a collection, or rather a List (Of Character) objects.

You will most likely need to have .NET 4.5 on your system as I'm using the latest ZipArchive class which requires it to read and write the final files. I am also extensively using the XML.Serialization and the Security.Cryptography classes.

These objects contain basically everything relevant I have found in the Hero Lab files. The top Object is a serialization of the index.xml file. So it contains information about the .por (.zip) file itself, which is where the files are located for the characters (.xml, .txt and .htm) It also copies the contents of those files to a string (I'm planning on using this in Forms in MT).

Within this Object is another Object called CharacterData. This contains, basically, everything from the .XML file for each character. (I have not yet written the code to extract Minions from parent characters, I was going to get the rest of this working first).

These objects are deep, but not complex (I'll add an extract function to the top level class eventually). I'm also using the property and field names as created by HeroLab for now. I am looking at renaming a lot of these to make them a little more legible in my IDE. This however requires annotating every object in my code with the matching node names in Hero Lab's XML file. I spent over a day writing these as is.

On a side note, it would be money if the Handout image could accept an htm or pdf to show an actual character sheet :)

Tielc
Cave Troll
Posts: 25
Joined: Wed Jul 16, 2014 10:41 pm

Re: Custom TokenTool 1.0b32 (Nerps!)

Post by Tielc »

I know Jamz said he was just using the .jar libraries to create his tokens, so I'm hoping someone else might know what this first MD5 hash in the content.xml file is for, the ID value. I know what the image id's are for, but I wasn't sure where this was one generated from. In nearly every example I've run across it ends in == as well, not sure what that means either.

<net.rptools.maptool.model.Token>
<id>
<baGUID>fwABASo0c8kCAAAASQAAAA==</baGUID>
</id>
.....

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Custom TokenTool 1.0b32 (Nerps!)

Post by JamzTheMan »

I believe that is the guid for the class basically.

MT basically just uses Xstream to serialize the object to/from xml so really, the xml is specific to Xstream. Look at their documentation for more hints...

Here the Token class and what info it contains at that time is serialized.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

Post Reply

Return to “TokenTool”