
Since the only script for importing Hero Lab characters hasn't been updated in over a year (not to mention the link to it is dead), I've been working on my own script to import characters into the Pathfinder character sheet. I should mention that due to the API environment not including the XML DOM parsing part of the JavaScript language, I've opted to convert the XML to JSON first, rather than trying to hack together a way to process the XML as text.
Usage:
The script will look for a character object with the same name as the character it's importing from Hero Lab; if it finds one, it'll import to that character, otherwise it will create a new character with that name. It will do this for all of the characters in the import, including any "minions" attached to a character, such as familiars and animal companions; the first character in each XML file will be set to "represent" with the token used for the import.
The script currently imports the following:
Usage:
- Export the character (or characters) as an XML file in Hero Lab (File -> Save Custom Output, choose "Generate XML File").
- Open the XML file in your favorite text editor that isn't WordPad, MS Word, or any other word processor (I recommend Notepad++) and copy the entire contents (Ctrl-A, then Ctrl-C, for the shortcut-impaired).
- Go to CodeBeautify.org's XML to JSON converter, and convert the XML to JSON (paste the XML into the field on the left, set the result mode to "text", click "XML to JSON", then copy the text from the text field on the right).
- Paste the JSON text into the GM Notes on a token you intend to use for the FIRST character in the XML file (if you're importing more than one).
- Repeat steps 1-4 on new tokens, if you want to import multiple files at once.
- Select the token (or tokens), type "!hl-import" into the chat window, and press enter.
The script will look for a character object with the same name as the character it's importing from Hero Lab; if it finds one, it'll import to that character, otherwise it will create a new character with that name. It will do this for all of the characters in the import, including any "minions" attached to a character, such as familiars and animal companions; the first character in each XML file will be set to "represent" with the token used for the import.
The script currently imports the following:
- Name (obviously)
- Ability scores
- Feats
- Traits
- Classes, including levels
- Current XP
- Favored class (only if manually set, and only the name)
- BAB
- Skills (situational modifiers get added to the macro as new template lines)
- Saving throws
- Max Dex Bonus
- Armor Check Penalty
- Arcane Spell Failure
- Hit dice (HD > class levels, it gets dumped into the level for class #5)
- Spell caster classes
- Spells (from currently memorized, known, and spellbook)
- Size
- Languages
- DR
- Resistances
- Immunities
- Weaknesses
- Senses (low-light, darkvision, scent, etc)
- Challenge Rating
- XP award (what the character's CR is worth)
- Personal details, including: player name, deity, race, alignment, gender, age, height, weight, hair, eye, and skin color
- Class features
- Racial traits
- AC
- Items
- Attacks
- Flaws
- Type/subtypes
- Hero points
- Token sight properties (eventually it will automatically set darkvision/low-light vision)
- Undoubtedly a bunch of stuff I've forgotten
- You'll almost certainly need to manually recalc the character after importing
- Spellclasses will be set to the appropriate class from the Classes tab, but it won't populate the "name", and it won't populate the caster level until you manually change the class' level on the Classes tab (not even a recalc will fix this).
- Since it isn't actually specified in the XML, the script will make its best guess as to which ability score a spellclass uses (but only if it hasn't already been set).
- Bonus spells don't seem to populate until you change the ability mod it uses to something else and back again.
- Importing feats will attempt to find an existing feat on the sheet with the same name; if found, it'll overwrite that feat, instead of making a new one
- If it finds multiple feats with the same name, it will append how many times you've taken it at the end of the name; this does not effect feats that have you select weapons (since the weapon name is listed as part of the feat name), but will apply to feats like Extra Rogue Talent.
- Likewise, importing spells will attempt to find a spell with the same name, level, and spellclass.
- Importing class features, racial traits, and items will work the same way (once they're added), so you should be able to re-import over existing characters with minimal duplication.
- Stats like HP, base save bonuses, BAB, etc., aren't listed per-class in the XML, so the script will dump it all into the first class on the sheet.
- Before importing skills, the script will delete all skill-related attributes; this includes any changes to skill macros. If you have custom skill macros you wish to keep, back them up first.
- Currently the script won't clear the GM notes on the token, but future versions will. The characters I'm testing this with end up being thousands of lines of JSON, which causes a bit of lag when opening the token's properties. There will be a debug mode that disables this.