Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Script:HL-Import

From Roll20 Wiki

Jump to: navigation, search
API ScriptAuthor: James W.
Version: 0.5
Last Modified: 2016-03-13
Code: Pathfinder HeroLab Import
Dependencies: None
Conflicts: None


Pathfinder HeroLab Character Import will import a character to the Pathfinder character sheet from HeroLab, via XML converted to JSON. Any XML to JSON converter will work, but XML attributes need to have an underscore ("_") added to the beginning of their names, and be aware that some converters may drop the "class" XML nodes under the "classes" node, which will prevent classes (and all related items) from being imported. The script was tested with the XML to JSON converter on CodeBeautify.org, and it is recommended that you use this converter.

Contents

Usage

  1. Export the character (or characters) as an XML file in Hero Lab (File -> Save Custom Output, choose "Generate XML File").
  2. 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).
  3. 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).
  4. 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).
  5. Repeat steps 1-4 on new tokens, if you want to import multiple files at once.
  6. Select the token (or tokens), type "!hl-import" into the chat window, and press enter.

What the script (currently) does

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.

Currently imported

  • 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

Currently NOT imported

  • 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

Known issues (some are script issues, some are character sheet issues)

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

Other notes

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

Changelog

v0.50 (2016-03-13)

  • Release