RPTools.net

Discussion and Support

Skip to content

It is currently Fri Dec 15, 2017 7:11 am 






Reply to topic  [ 67 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

Previous topic | Next topic 

  Print view

Author Message
 Offline
Dragon
 
Joined: Sun Sep 04, 2011 6:01 am
Posts: 260
 Post subject: Re: Custom TokenTool 1.0b29 (Nerps!)
PostPosted: Tue Nov 04, 2014 2:15 pm 
http://stackoverflow.com/questions/8112 ... -file-path


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Custom TokenTool 1.0b29 (Nerps!)
PostPosted: Tue Nov 04, 2014 8:03 pm 
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.

Attachment:
tt1.JPG
tt1.JPG [ 23.85 KiB | Viewed 1238 times ]


Attachment:
tt2.JPG
tt2.JPG [ 15.76 KiB | Viewed 1238 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


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Custom TokenTool 1.0b31 (Nerps!)
PostPosted: Wed Nov 05, 2014 4:31 pm 
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


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Sun Aug 10, 2008 8:29 pm
Posts: 91
 Post subject: Re: Custom TokenTool 1.0b31 (Nerps!)
PostPosted: Thu Nov 06, 2014 10:34 am 
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


Top
 Profile  
 
 Offline
Kobold
 
Joined: Mon Nov 10, 2014 4:55 pm
Posts: 2
 Post subject: Re: Custom TokenTool 1.0b31 (Nerps!)
PostPosted: Mon Nov 10, 2014 5:17 pm 
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.


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Custom TokenTool 1.0b31 (Nerps!)
PostPosted: Tue Nov 11, 2014 12:13 am 
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


Top
 Profile  
 
 Offline
Kobold
 
Joined: Mon Nov 10, 2014 4:55 pm
Posts: 2
 Post subject: Re: Custom TokenTool 1.0b31 (Nerps!)
PostPosted: Tue Nov 11, 2014 11:46 am 
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.


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Custom TokenTool 1.0b31 (Nerps!)
PostPosted: Tue Nov 11, 2014 2:22 pm 
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


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Custom TokenTool 1.0b32 (Nerps!)
PostPosted: Thu Nov 13, 2014 7:30 pm 
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


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7967
Location: Bay Area
 Post subject: Re: Custom TokenTool 1.0b32 (Nerps!)
PostPosted: Thu Nov 13, 2014 7:46 pm 
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.

_________________
Downloads:


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Wed Jul 16, 2014 9:41 pm
Posts: 25
 Post subject: Re: Custom TokenTool 1.0b32 (Nerps!)
PostPosted: Sat Jan 03, 2015 10:30 pm 
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
Attachment:
3a2444f5097382ce5cf23a1b5dae71e5.png
3a2444f5097382ce5cf23a1b5dae71e5.png [ 35.39 KiB | Viewed 1133 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?)


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Custom TokenTool 1.0b32 (Nerps!)
PostPosted: Sat Jan 03, 2015 11:34 pm 
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


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Wed Jul 16, 2014 9:41 pm
Posts: 25
 Post subject: Re: Custom TokenTool 1.0b32 (Nerps!)
PostPosted: Sun Jan 04, 2015 10:52 am 
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 (viewtopic.php?f=8&t=23623&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:
Attachment:
HeroLab.zip [24.79 KiB]
Downloaded 50 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 :)


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Wed Jul 16, 2014 9:41 pm
Posts: 25
 Post subject: Re: Custom TokenTool 1.0b32 (Nerps!)
PostPosted: Sun Jan 04, 2015 2:20 pm 
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>
.....


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Custom TokenTool 1.0b32 (Nerps!)
PostPosted: Mon Jan 05, 2015 1:57 am 
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 67 posts ]  Go to page Previous  1, 2, 3, 4, 5  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 are 2 users online :: 0 registered, 0 hidden and 2 guests (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 2 guests





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

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman