Thursday, 12 September 2013

Managing data file creation

Over the last couple of evenings I've been implementing what I hope will be a solution to the trickeries of managing the creation of my large Hero Lab data files.

If you've not played with Hero Lab at all, it's a program that allows you to create RPG characters for a number of supported gaming systems, including my preference of Savage Worlds. The data for each setting is contained within separate XML files, one for each setting. If there's only one or two books, creating one of these data files as a single entity is fine... but when you start looking at a large series of books it becomes daunting scrolling up and down this large file trying to work out exactly where you want to place the new entries, or find that annoying bug.

I've decided to try a slightly different approach and split the datafile up into smaller text files, each containing specific things, such as skills or equipment for individual books. For example this is what my current folder structure is like

In order to then recombine these into the one data file we need to use some form of concatenation script to merge it all back together again. My tool of choice for this is Apple's Automator, but linux and windows both have their own ways of doing this. For anyone interested in doing this, here's the workflow I'm going through.

We are prompted to select a starting folder (with the default set). It then scans all the folders and subfolders, building up a list of all the files. The text is pulled out of all these files, added to the clipboard and then run through the final batch script.

the issue I was encountering with this was that there seemed to be no particular order to how it was combining the files. Originally I had the start and end tags in their own files, but these were ending up in random places in the file, so now these pieces of text are being added to the clipboard text before it gets written out as the data file. So far this seems to be working and should make it much easier to add new content as the Achtung! Cthulhu books are released.

Now to work out what that niggly bug was back in April!

No comments:

Post a Comment