Thursday, October 2, 2008

Sick and tired....

...of entering and updating my LFR character over and over again!

So being me, I wrote a program that would allow me to copy from 1 campaign file to another. It's not very complex:

In step 1 you locate a campaign database (hey look I even used the Open common dialog). The program scans it looking for the charsheet node and then builds a list of all the sub nodes. It also extracts the name element and displays it. Because copying character id-00002 is less clear than copying character XYZ. You add them to the list, set a target directory and hit export.
The program craps out a psuedo-XML file where some of the tags have been changed to !!!REPLACE!!!. Each file it generates has the character name and a unique timestamp.

In step 2 you open one of the files created by the exporter. Next you select a target campaign (the db.xml of the target campaign actually). Then you press import. It does the rest.
What it does is search the target file for a charsheet node. it then figures out what the next unique ID should be and puts that over !!!REPLACE!!! as it loads the source file. This ensure the PC has a unique ID and it even keeps the links for his items functioning correctly.

One minor bug/feature. It will not import into a campaign that doesn't have a charsheet node. This means you have to create at least one character within the campaign before you try to load more in. Really this shouldn't be a big deal. I may fix it in future revisions.

Step 3 open FGII and view the characters.

I've never tried a transfer while FGII is running. I suspect it would be a BadThing.

I'll probably clean this up and release it. Oh it's not 4E_JPG specific. It should work for any ruleset that uses a charsheet node (i.e. all of them). I also wouldn't recommend transferring characters across rulesets.

1 comment:

David said...

Dang dude. We were actually just thinking about this very thing after I passed my DM cloak over to another player to let him have a go of it. Looks like you beat us to it.

Also, great work on the PHB parser, I'm just now getting around to dumping the bulk of it into the module. As easy as importing magic items was, the AV should be a piece of cake.