Page 1 of 1

FEATURE: Hero Lab integration

Posted: Fri Mar 20, 2015 2:11 pm
by JamzTheMan
OK, so this one is a personal request. :)

Normally I wouldn't suggest, "Hey, lets support this ONE software" but it is very widely used and other VTT's have support/integration at some level.

There may be other software and could be some overlap depending on what we do but I'm mostly familiar with HL. If you could "easily" port in creatures/pc's to tokens, it could give MT a user based push. I've worked with Rob and some of the developers in the past as well on other projects and I'm sure we could get some support from the other end as well if needed.

My initial proposal would be:

1. Treat HeroLab Portfolio's as Asset Folders (.por files are simply zip files with an index.xml inside listing and pointing to characters inside the file. This could be leveraged for other "zip" types if done right)

2. When selecting a Portfolio, the asset window shows the individual characters and can be dragged into MT as normal tokens bringing in the character data with it.

3. The character data is XML, I propose a separate token data space to hold this as properties are framerwork specific. So something like Notes/GM/Notes, maybe Character Data? would hold it as text.

4. Add a few XML DOM commands that can query XML data. Would be useful for other integration points.

From here normal macro code can initialize the token.

Re: FEATURE: Hero Lab integration

Posted: Sat Mar 21, 2015 3:01 pm
by RPTroll
Craig had mensioned a Roll20 character sheet integration as well. Is this similar?

If so we should look at an abstraction layer that would be used to integrate with those two as well as future possibilities.

Re: FEATURE: Hero Lab integration

Posted: Sat Mar 21, 2015 7:39 pm
by JamzTheMan
I think the roll20 character sheet integration is actual character sheets (in html/css?) but one supports the other. HL integration would be setting up token properties only.

The way I had planned for that was to create a macro or two that you could supply an xpath to query the xml data to populate a property.

I'd also propose not caching .por files as an asset and instead create a fileWatcher event so the token knows when a .por file has been updated and could update (prompt?) the token.

The fileWatcher code would be a reuse on some other feature requests.

Re: FEATURE: Hero Lab integration

Posted: Tue Dec 20, 2016 7:11 pm
by MandyRae
Honestly, the biggest issue I see with implementing this is the naming of the token properties and the code of the various frameworks out there. You would either have to code an import for each framework, or something similar, or the frameworks would all have to be rewritten using a standardized set of token properties . . .

Re: FEATURE: Hero Lab integration

Posted: Tue Dec 20, 2016 10:49 pm
by JamzTheMan
MandyRae wrote:Honestly, the biggest issue I see with implementing this is the naming of the token properties and the code of the various frameworks out there. You would either have to code an import for each framework, or something similar, or the frameworks would all have to be rewritten using a standardized set of token properties . . .
Correct. So the "integration" is just the fact that it can create tokens based on images in the portfolio, link to the portfolio for quick updates, and extract and store the 3 statblocks. Since Hero Lab supports more than just Pathfinder, you obviously can't hard code a specific RPG.

But, I think you will find this integration is a lot easier than cut/pasting the data into the token. Also, a new macro that can grab data from XML using XPath makes it a better approach (IMO) than using regular expressions and also makes reading/changing the macro easier. I've supplied a macro in my campaign that does this. If your framework used different properties, you should be able to change it easy enough. Not every framework will want/need the same properties.

I had thought of adding a <link> property or such, basically just adding a place to add an xpath on the properties page but a lot of properties are really JSON objects or string properties so it's not a 1:1 mapping.

Now, of course, a framework may still want to use regular expression for non-hero lab users but it's here for use if you want it. I for one didn't want to do some sort of "export" in Hero Lab, copy, open MT, click macro, paste, "process" anymore for myself so here we are :)

Edit: BTW it's already done, you can view/test it in my fork...