1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. While the majority of active discourse on D20PRO has moved to our Discord Channels, this forum is still active and checked-in on regularly by our staff. However, for the very latest information, conversation and/or immediate support, please join us on Discord here: http://discord.gg/Ph38ckM
    Dismiss Notice

Generating Monster Files Suitable for Import

Discussion in 'General Discussion' started by tpkurilla, Mar 6, 2012.

  1. tpkurilla

    tpkurilla New Member

    Joined:
    Aug 17, 2009
    Messages:
    9
    Likes Received:
    0
    Greetings All,

    I've been searching, unsuccessfully, for any documentation on the .d20_ctr files used for monster export/import.

    Essentially, I want to generate files myself that are suitable for d20Pro to import.

    This would be an enormous savings in time for me. And judging from some of the threads here, others as well.

    Is there any such documentation?

    If so, can someone please point me in the right direction?

    If not, would it be possible for someone at Mindgene to contact me so that we can figure some means to do this out? I'll sign NDAs or whatever. I just need documentation, at the very least. Jar files with callable objects would be amazing, though :mrgreen:

    Thanks in advance,

    -Thomas
     
  2. Leathermartini

    Leathermartini New Member

    Joined:
    Aug 8, 2010
    Messages:
    38
    Likes Received:
    0
    Do you want to do just one at a time or get a large number of them?

    The former should be pretty much right in the Library window.

    The latter has been done by putting all the monsters to export onto one map, saving the map with the monsters on it, and then exporting the map. (This is how the PF Bestiary was done. If you want it as an example, it's either in the User Content or the PF forum.)

    This is assuming you want to export them for later import back into d20pro.
     
  3. edwardcd

    edwardcd Administrator
    Staff Member

    Joined:
    Oct 13, 2010
    Messages:
    1,374
    Likes Received:
    9
    Hi Thomas,

    Are you looking to create your own d20Pro native creature files? That you can then import into d20Pro?

    You can export a few single creatures (.d20_ctr) and open the file up with a text editor to see the format that it saves the data, then mimic the xml'ish format. Alternatively, you may look at the herolab d20Pro format and use that style (though, the herolab format is less comprehensive).
     
  4. tpkurilla

    tpkurilla New Member

    Joined:
    Aug 17, 2009
    Messages:
    9
    Likes Received:
    0
    I have access to the text for all 4E monsters, thanks to Hero Lab's open source crawler. I want to put them into a format suitable for d20Pro to use.

    I was hoping that there would be some documentation to ease the pain, or even (small hope, but hope nonetheless) that object libraries in d20Pro could just be called.

    Oh well, guess I do it the hard way.

    If I can eventually get something together, I will definitely share so everyone can use it.

    Thanks for the pointers. Hopefully I can persevere. :shock:

    -Thomas
     
  5. BatCountry

    BatCountry New Member

    Joined:
    Mar 27, 2012
    Messages:
    3
    Likes Received:
    0
    Taking a look at the d20_ctr files in a hex editor it seems to be a pretty simple flat uncompressed format.

    There seems to be a header block with a simple FAT (filenames and offsets) the images, an xml counter and some manifests.

    Shouldn't be too hard to work up an exporter that produces this data.

    Format:
    All integers are stored big-endian.

    6 byte header = '~oGBo~'
    long int = offset of the beginning of the first file
    short int = number of files (-1) in the FAT below

    then a series of file records:
    long int = length of the next file
    short int = length of the filename
    bytearray = the filename of a file (relative to the d20pro root)

    Included in each token is a manifest file for the image information (per virtual resource directory)
    which consists of a tuple of:

    An integer (appears to be an image id associating the image with the XML token data), the filename (POSIX slashes in the path), a base64 encoding of a binary md5 sum digest.
    Colon delimited.

    The manifest image id appears to be assigned globally, presumably for speed and memory efficiency. Unsure how the program goes about dealing with token ID collisions (caused by your 1024 not being the same image mine), presumably it resolves that using its the manifest file in the token itself to see if it needs to unpack any images when loading the token.

    The ones in the images in my exported token are associated with the ones in the manifest.dat in the "res" folders of d20pro.

    I've got a python script that can dump a character token, but I'll need to play with trying to create a resource id collision to see how permissive that is; and learn and the structure of the token data XML before I could sensibly reverse the process (and thus pack up a new token).

    My end goal here is to try producing something that can convert an .rptok file, as I was previously using RPTools Maptool to run my campaign but found its overall bugginess and lousiness too annoying to continue and have resolved to buy a pile of d20pro licenses (now that I've figured out that importing all of my huge campaign data is a reasonable task [for a software engineer]).
     
  6. BatCountry

    BatCountry New Member

    Joined:
    Mar 27, 2012
    Messages:
    3
    Likes Received:
    0
    Here's a tool to unpack a d20_ctr file to a directory (dump_FILENAME) and another to re-pack the same directory structure to a counter. This requires (probably) python 2.6 or later. It may work with python as early as 2.4, but who knows. I don't think I've used any crazy futuristic features of python.
    (moved to new post)
    http://forums.d20pro.com/viewtopic.php?f=18&t=1643#p7950
     

Share This Page