.rptok XML guide?

Doc requests, organization, and submissions

Moderators: dorpond, trevor, Azhrei

Post Reply
MidnightLightning
Kobold
Posts: 13
Joined: Mon Oct 05, 2009 10:53 am

.rptok XML guide?

Post by MidnightLightning »

Okay, after finding out that the .rptok files are actually .zip files in disguise, I'm now deep into developing a means to export characters created in the (now obsolete, but still good) 3EProfiler online character sheet tool.

Inside the rptok archive, I found the content.xml file and gazed in wonder at its length. Which has now lead me to ask, what elements of that XML tree are required/optional? I mean, does MapTool have defaults that I could rely on rather than bloating my XML? For example, <isFlippedX /> and <isFlippedY /> elements could logically default to 'false' if not supplied by the token file on import.

I could play around with this in MapTool myself, but thought I'd post as well, to see if there was a guide to the XML elements' meanings, and a DTD of sorts to determine what valid options are for those elements.

neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Re: .rptok XML guide?

Post by neofax »

What framework do you plan on using in MapTools? If you are going to use a Homebrew and use the basic properties, it would probably be easier to figure out how to have 3EProfiler write to CharacterTool (another RPTools program). If you plan on using Lindsay's Framework, then plan on writing the code for each of the nodes (easiest explanation I could think of). Also, I think Jay is writing the rpgame file for Lindsay's framework, but don't quote me on that.
Image
Time-Zone information UTC -5

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: .rptok XML guide?

Post by Azhrei »

I would not count on defaults.

MapTool exports the data to XML using an automated software library (XStream) and that library writes out the contents of each field. When reading objects back in, it calls the default constructor and then assigns values for the fields it finds in the XML.

So defaults may work. Ideally, they would work. But there could be parts of the code that have circular dependencies on data and that means leaving a field to default could cause problems. :( (Note: I'm not saying there are such fields, only that there could be.) You're unlikely to see any formal documentation on the file format as it changes too rapidly. When 1.3 goes Gold and Trevor starts 1.4, it might be worth documenting the major components though.

In regards to converting the 3EProfiler, I agree that the better solution is probably to CharacterTool, but I can also understand the desired for a direct conversion. (Wouldn't it be cool to provide a link on a character sheet that generates the RPTOK file?!)

I'm currently in the process of redoing the Profiler on TheTangledWeb.net to be PF compatible. In the process I'm ripping out most of the guts of it and using a JavaScript framework (jQuery for those that are interested) so it's been a long process. I have much of it done -- the first two sections of the sheet -- but there's still more to do. I plan to implement some kind of RPTOK generation that plays nicely with lmarkus' framework, as well as a simple XML output that could be imported into other tools.

neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Re: .rptok XML guide?

Post by neofax »

I could *almost* kiss you if you can make that work! Since I don't play enough 3.5E/Pathfinder, to know the rules, I tend to not truly grasp lmarkus framework and this would work perfectly for me. Also, if anyone knows how to write the ouputsheets for PC-Gen, we could use that too. PC-Gen already has an example that someone made for InitTool from back in 2008 and doesn't work now.
Image
Time-Zone information UTC -5

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: .rptok XML guide?

Post by Azhrei »

Well, PCGen just uses an external text file that can have placeholders inserted for various data fields.

So if you took the XML out of a MapTool token and deleted all of the actual data and replaced it with the placeholders, you'd have 90% of it done. PCGen uses a loop command (like the FOREACH roll option in MT macros) that you would put the XML code into, then PCGen would replicate the XML code over and over, filling in the values each time. This would be for feats, spells, skills, and anything repetitive.

neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Re: .rptok XML guide?

Post by neofax »

Yes, I knew this as I have started trying to make it work. However, the bigger problem is getting it to work for a framework and still be generic enough for others to use. I do know that more people use Lindsays Framework for 3.5/Pathfinder games, but for 4E that is a different story.

Azhrei,
Could you setup a sub-forum under User Creations for side projects like this? I think it would be great for people to post ideas and have others run with them. Kinda like Notsonoble's(I think) Pathfinder statblock to framework, PC-Gen/3EProfiler/TOS/ to MapTool rptok, generic plugins for frameworks (i.e. HTML styles for code output)...

DMFTodd
Cave Troll
Posts: 95
Joined: Mon Jun 29, 2009 11:17 pm

Re: .rptok XML guide?

Post by DMFTodd »

The approach I've taken for these is to have a "default" XML layout that you read in and then the output program is updating/string replacing into that default. That way if someone is using a different framework, they can hopefully tweak the default and it still works with your program to create the rptok.

At least that's the approach I'll take when I do the DM's Familiar export to Maptool.

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Re: .rptok XML guide?

Post by jay »

The default values set when a token is constructed do work. If XStream doesn't find an element that is in the token, then it just leaves it as the default value. If you look at CT's code there is a blank.rptok file in the resources directory that has the XML I update when you create a token from CT. It is quite a bit smaller.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: .rptok XML guide?

Post by Azhrei »

jay wrote:The default values set when a token is constructed do work. [...] If you look at CT's code [...]
I have no idea about CT; I was assuming the post was regarding MT.

User avatar
jay
RPTools Team
Posts: 1767
Joined: Tue Feb 07, 2006 1:07 am
Location: Austin, Tx

Re: .rptok XML guide?

Post by jay »

It is regarding MT, but I'm referring to the code in CT that creates MT's token XML. I have a blank token which has the minimum amount of XML needed for MT to be able to use it. Then when CT writes out its file it updates the content.xml with any data that can be transferred to MT.

MidnightLightning
Kobold
Posts: 13
Joined: Mon Oct 05, 2009 10:53 am

Re: .rptok XML guide?

Post by MidnightLightning »

neofax wrote:What framework do you plan on using in MapTools?
The goal of this is not use a framework, but rather create custom Macros that are based on the characters' attributes at the time of export, rather than exporting Properties that fit with a certain framework. Hence the part of the RPTOK file that I was focusing on was the Macros area, and was trying to figure out what other areas I could cut out.

Post Reply

Return to “Documentation Requests/Discussion”