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

d20_ctr file packer/unpacker

Discussion in 'User Created Content' started by BatCountry, Mar 31, 2012.

  1. 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.

    Two caveats - it will randomly assign an ID to any file it discovers in the directory tree specified which isn't already in the RES/manifests/*.manifest files. This will probably break the image linkage specified by the XML file, as they're specified by manifest ID.

    You can manually edit the XML file (creature/CREATURENAME.d20_ctr) and set the ID of any new image to any positive integer AFAICT as long as it doesn't coincide with any other image in any of the manifests that are in the token path.

    d20pro ignores any collision in global IDs, for instance in d20pro 683 is the cleric graphic, but if a creature you import replaces that id, it doesn't affect the cleric output and still shows up correctly.

    So the logical steps for producing a modified token would be:
    1) export an already-set-up loose character template that you want to represent your creature/character with from d20pro (say "foo.d20_ctr")
    2) dump with "python ctr_dumper.py foo.d20_ctr"
    3) make your changes to the product directory (dump_foo.d20_ctr)
    4) re-pack the counter with "python ctr_packer.py dump_foo.d20_ctr newfoo.d20_ctr"
    5) re-import into d20pro and ensure everything worked right (which it very well may not.)

    No guarantees that either of these scripts will function as indicated blah blah blah, you agree to indemnify the author blah blah blah.
    I've spent a grand total of 4 hours figuring out the format, writing an exporter, writing a packer, and testing how d20pro reacts to manifest id collisions, plus about 10 minutes of looking at the xml file. This does not constitute thorough quality testing.

    That being said, I've successfully unpacked a character export changed some graphic files around, edited the XML to change their name and resistances (low hanging fruit), then repacked them and successfully reimported them into d20pro.

    DOWNLOAD: http://www.mediafire.com/download.php?7bd3z754h70448t (2.8k, two python scripts in a zip.)

    (Notes on the format: http://forums.d20pro.com/viewtopic.php?f=17&t=1624#p7939)
     

Share This Page