Thread: Pathfinder Creature Parser V2
-
February 22nd, 2014, 15:04 #1
Pathfinder Creature Parser V2
I've been putting releasing v2 of the Pathfinder creature parser off for a while now as I need to put some documentation together to do with the needed format of the major new feature - spells!
The main features of this v2 release are:
- New formatting of data on the NPC Other tab.
- Spell parsing – based off spell list formatting on the “Other” tab and spell name matching in the spell XML file. Spell XML file currently hard coded. Currently only 1 spell list is supported.
- Spell like ability parsing – based off spell like ability formatting on the “Other” tab and spell like ability name matching into the spell XML file. Spell XML file currently hard coded. Currently only 1 spell like ability list is supported. A single spell like ability list and a single spell list in the same block can be parsed.
- “Copy .mod to FG?” option (selected as default). This will copy the resulting .mod file to your FG App Data \modules directory – ready for use straight away. You will be prompted to overwrite if a file of the same name already exists.
- Adding of a “EXTRA FORMATTED DATA” option (at the very end of a statblock) to add in FG formatted (tagged) text to include in the Other tab (at the end of all of the data). Handy for adding in extra data/note to do with the NPC.
- Languages have been moved to the main tab.
- Minor parse/bug fixes identified in v1.
NOTE: In order to use this release fully (i.e the spell parsing) the spells and other data gets populated in a new format in the "Other" tab - if the input data does not conform to the Paizo stat block format then the creature may parse without errors but when you come to open the NPC in Fantasy Grounds you may encounter XML errors due to formatting issues. I hope to make this more robust and provide detailed documentation in the future - this was the main reason I've been putting off releasing this version. If you have XML errors in this version, try your statblock in the older version of the parser (both can be installed the same PC): https://www.fantasygrounds.com/forum...-Alpha-release
INSTALLATION
This is developed for Windows using the .NET platform. MAC users see the next section below.
- Download this file: https://drive.google.com/file/d/0B6o...WqJOVDpyCSnRgw Simply download the file using the download button within the Google Drive page the link takes you to, don't do a share request.
- Unzip to a temporary location.
- Double click on setup.exe and follow the instructions - if you don't have the required version of the .NET libraries these will be downloaded.
- The application will be installed to the Windows start menu: All Programs -> FG Tools for PFRPG -> FG Tools for PFRPG -> PFRPG FG Creature Parser V2 (sorry, I'll remove the double "FG Tools for PFRPG" at some point).
Run the app and it will look something like this:
Attachment 14814
MAC Users
I don't use a MAC so I can't support you to try to get it running. However, this post (and some of the posts around it) may help you: https://www.fantasygrounds.com/forum...l=1#post179447
-------------------------------------------------------------
Please let me know if it works and if you have any issues... A good place to look to see how the parsing is going is a temporary file created during parsing - it is the same name as your text file with an extension of .fpf; or check the logfile (same name as your text file + .log). The .fpf file contains formatted stat block info - it might help you to spot formatting errors in the original text file (I've seen a few from copy/paste from the Bestiary 2) and allow you to fix them yourselves and get some creatures parsed!
If you do have issues, please provide details of:
1) The error raised (full details please - the complete error message, etc.).
2) The text stat block for the creature you're parsing. (The one that caused the error may be indicated in the text line output).
3) The .fpf file entry for this creature and the logfile.Last edited by Trenloe; October 14th, 2022 at 12:43.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
February 22nd, 2014, 15:04 #2
How to Use
The creature parser is used to parse/convert a plain text file containing one or more Pathfinder statblocks that adhere to the Paizo statblock standard, more details on the Paizo statblock standard here: https://paizo.com/pathfinderRPG/prd/...roduction.html
Lots and lots of examples of valid statblocks available here: https://paizo.com/pathfinderRPG/prd/...sterIndex.html (These all work with the parser). NOTE: If you are copying statblocks from the PRD, another web page etc. make sure you remove blank lines within the statblock text etc. and make sure that the statblock text adheres to the Paizo standard and guidelines in posts #1 - #4 in this thread.
The parser is designed to allow the GM to copy NPC statblocks directly from an adventure PDF, paste into a text file and parse the text file. The parser should work fine *IF* the NPC being copy/pasted adheres to the Paizo statblock standard and there are no strange characters introduced during the copy/paste process (sometimes this happens when copying from a PDF - erroneous spaces or other characters can be introduced). Also ensure that there are no blank lines within an individual creature statblock - only use a blank line to separate one statblock from another.
Note: This is just a creature parser, it will not parse traps or vehicles. Do not include stats for traps or vehicles in the statblock file you parse as they will break the parser!
Multiple spells If a spell is prepared/memorized multiple times indicate it as <spell name> (<times prepared)> - some non-Paizo statblocks use (x<times prepared)> simply remove the "x". e.g. 3rd—fireball (DC 17) (3)
GOTCHAS
Stat block titles (Very Important!)
The Parser mainly relies on the stat block main titles to correctly read the data correctly. Make sure that when you copy/paste the creature that the main titles are on a line by themselves, no space in front and no spaces in the title (I've seen spaces appear when copying some creatures). The titles are:
Defense
Offense
Tactics (if present)
Statistics
Ecology (if present)
Special Abilities (if present)
Text file encoding Make sure you text file you use for parsing is in ANSI encoding, not UTF-8 or similar. There have been a few occurrences recently of strange characters being introduced using UTF-8 or other non ANSI encoding, and this causes all sorts of "unexplained" errors as the parser can't match key headings, etc.. You need to paste the statblock into only a plain-text editor - not something like Word/Wordpad. I'd recommend using Notepad++ (free) available from here: https://notepad-plus-plus.org/ and set the "Encoding" to ANSI.
Spell Like Abilities - will only parse one entry.
In order to make the saving throws of spell like abilities in the spells tab correct (based off the spell level) the spells are all placed in the relevant spell level section on the spells tab. The only problem that occurs with this approach is tracking use for at-will, constant and uses of longer than once per day (e.g. once per week, once per month, once per year). Any spell like abilities with use of X/day will be listed correctly with the right number of uses prepared - just check them off as you use them. Any abilities that have something other than X/day will be prepared with one use and the use data added to the end of the spell name in parentheses, e.g. "Remove Fear (At Will)".
Invalid Spell Like Abilities entries
In some older Paizo statblocks certain class abilities are listed as "Domain Spell Like Abilities", "Bloodline Spell Like Abilities" or similar entries. These are not actually spell like abilities, as they are not spells, and so will create issues with parsing of the statblock (usually in the form of an XML error when you try to open the module in FG). Remove these entries and move the relevant data to Special Attacks or SQ.
Pathfinder Society - creatures in PFS modules don't have XP values. The Parser relies completely on the XP line between creature Name/CR and Type to be able to split these lines up.
Workaround: PFS creatures, add a new line: "XP 1" (without the quotes) between the Name/CR line and the type line/s.
Frog God Games Statblocks: Frog God Games products (Slumbering Tsar, Rappan Athuk, Razor Coast, etc.) usually adhere to the Paizo statblock format - with one exception: the "Stat block titles" are not present, the books contain separator lines instead - so you must enter the relevant "Stat block titles" as listed above in place of the separator lines.
HeroLab statblock output
In HeroLab go to File -> Output Active Hero Statblock -> Plain Text -> Save to File and the output should work with some minor changes to the HeroLab exported file:
- Load up the HeroLab output into a text editor other than Window Notepad (which doesn't work well with HeroLab output). Use something like Notepad++ and change the encoding from UTF-8 to ANSI and check for incorrect looking characters. For example: HeroLab can export the weapon critical multiplier "x" as a non-standard character.
- Ensure the CR entry is on the same line as the name, not on a different line. e.g. Aasimar CR 1
- Add an XP line between the Name/CR line and Type line.
- Remove the --------- lines around the section titles (leave the Section title as this is very important - see "Stat Block Titles" above). Make sure you remove the whole line of -------- dashes and that there are no empty/blank lines within the individual NPC statblock.
- Remove any blank lines within each individual statblock.
- Remove the HeroLab notice at the bottom.
- Give each special ability entry a type indicator (Su), (Ex) or (Sp) and ensure each special ability line ends in a full stop/period ( . ) This ensures the formatting of special abilities in the Other tab is correct and helps to avoid XML errors when opening the module in Fantasy Grounds.
Combat Manager
https://www.combatmanager.com/
Check this thread for more details.
NOTE: Minor text formatting is still needed with statblocks copied from the monster statblock within combat Manager:
1) Move description to the beginning of the statblock.
2) Next line after description must be <NAME> CR <CR Value> all on one line. For example: Ghoul CR 2.
NOTE: When doing a "Select All" and copy from Combat Manager, the CR entry will be placed on the line before the name - move this to the end of the name line.
3) Remove all blank lines in the statblock.
4) Leave a blank line between each creature statblock.
Token Reference
A token reference has been added for each creature - referencing the creature display name in the tokens directory in the module - with a .png extension. For example:
Creature: Archon, Shield
Token: tokens/Archon, Shield.png@Bestiary2
Note: this needs the manual addition of the image to the "tokens" directory in the module and any required tokens - named <creature name>.png
EXTRA FORMATTED DATA
This is a catch all section at the very end of the statblock where free-form, Fantasy Grounds formatted data can be added. Enclose each paragraph in <p></p> tags so that the spacing will be correct. Use other FG formatted text tags as detailed in the "Internal Representation" section here: https://www.fantasygrounds.com/refdo...extcontrol.xcp
Here is an example from the Aasimar statblock:
Code:ECOLOGY Environment any land Organization solitary, pair, or team (3–6) Treasure NPC gear (scale mail, heavy mace, light crossbow with 10 bolts, other treasure) EXTRA FORMATTED DATA <p>Aasimars are humans with a significant amount of celestial or other good outsider blood in their ancestry. Aasimars are not always good, but it is a natural tendency for them, and they gravitate to good faiths or organizations associated with celestials. Aasimar heritage can hide for generations, only to appear suddenly in the child of two apparently human parents. Most societies interpret aasimar births as good omens. Aasimars look mostly human except for some minor physical trait that reveals their unusual heritage. Typical aasimar features are hair that shines like metal, unusual eye or skin color, or even glowing golden halos.</p> <h>Aasimar Characters</h> <p>Aasimars are defined by class levels - they do not possess racial Hit Dice. Aasimars have the following racial traits.</p> <p><b>+2 Charisma, +2 Wisdom</b>: Aasimars are insightful, confident, and personable.</p> <p><b>Normal Speed</b>: Aasimars have a base speed of 30 feet.</p> <p><b>Darkvision</b>: Aasimars can see in the dark up to 60 feet.</p> <p><b>Skilled</b>: Aasimars have a +2 racial bonus on Diplomacy and Perception checks.</p> <p><b>Spell-Like Ability</b>: Aasimars can use <i>daylight</i> once per day as a spell-like ability (caster level equals the aasimar's class level).</p> <p><b>Celestial Resistance</b>: Aasimars have acid resistance 5, cold resistance 5, and electricity resistance 5.</p> <p><b>Languages</b>: Aasimars begin play speaking Common and Celestial. Aasimars with high Intelligence scores can choose any of the following bonus languages: Draconic, Dwarven, Elven, Gnome, Halfling, and Sylvan.</p>
Last edited by Trenloe; May 22nd, 2018 at 14:48. Reason: HeroLab updates/clarifications
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
February 22nd, 2014, 15:05 #3
Spell name gotchas
- ear-piercing scream should be changed to earpiercing scream, the hyphen (-) causes the parser to see it as a new spell level and will report Cannot find spell XML element with name <ear> cannot parse this spell - skipping.
Pathfinder book reference superscripts.
The parser will remove the common Pathfinder reference book superscript from the end of a spell when it checks for the name, but leave the string in the Other tab list (so you know where to look). Example superscripts are APG, UC, UM, UC, UE, M, MA. Sometimes there are 2 superscripts, usually involving the Mythic "M", for example: APG,M. In this case the parser will fail with empty spell name "" error - change APG,M to APG+M.
Issues/development ideas:
- Traps and Vehicles are not parsed in this version.
- Only a single spell like ability class and spell class (one of each) can be currently parsed.
- Error messages need to be made more meaningful.
- XML creation made more robust to try to reduce XML errors.
Minor issue list:
- Sorcerer "Bloodline" not recognised at the end of the spell list. Fix in testing.
- For creatures with class levels the race/class/level entry would be included with the creature "Type". Fix in testing: race/class/level removed from "Type" and placed in the other tab formatted text after description. Data also stored in additional field <raceclass> (not used by FG at the moment).
- Expand spell multi-preparation to recognise (xN) as well as (N). e.g. "magic missile (x2)" as well as "magic missile (2)".
- Remove need for XP line - PFS creatures don't have an XP entry and currently need to be manually entered for creature to parse.
- Immune entries - if a "traits" entry is present, items after are not parsed in FG. e.g. "Immune construct traits, cold, magic;" does not parse the cold immunity into the CT.
- Change some mods to be FG effect friendly. For example - how to get "+4 vs fear" save modifier in effects? Is this even possible in the effects model?
- Process XXXXX Spell Like abilities - where XXXXXX could be Domain or other labels? (Example: Ifrit) At the moment the XXXXX is not included (but remains at the end of the previous line).
- Code for rare instances when 1 ability is listed as Spell-Like Ability rather than abilities. Seen once in Thornkeep.
- Convert CR fractions to decimals. e.g. 1/3 -> 0.33
- Parse single weapon attack bonuses reliably from multi-weapon attacks.
- Move "fast healing" entries from HD to SQ.
- Maximum of 9/day spell like ability uses supported.
Last edited by Trenloe; August 3rd, 2014 at 01:11.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
February 22nd, 2014, 15:21 #4
A simple example to start, the Aasimar from Bestiary 1: https://paizo.com/pathfinderRPG/prd/....html#_aasimar
The following is the Offense section where Spells and Spell Like abilities are detailed:
Code:Offense Speed 30 ft. (20 ft. in armor) Melee heavy mace –1 (1d8–1) Ranged light crossbow +0 (1d8/19–20) Special Attacks channel positive energy (5/day, 1d6, DC 12); rebuke death (1d4+1, 6/day); touch of good (6/day) Spell-Like Abilities (CL 1st) 1/day—daylight Spells Prepared (CL 1st) 1st—bless, command (DC 14), protection from evilD 0 (at will)—detect magic, guidance, stabilize D domain spell; Domains Good, Healing Statistics
The "Other" tab - note the new format, especially of the spells and spell like ability entries:
Attachment 14815
The "Spells" tab - spell classes have been created for both the spell like abilities and cleric spells sections and the spells have been populated, with the link bringing up spell details:
Attachment 14816Last edited by Trenloe; July 25th, 2016 at 04:00.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
February 22nd, 2014, 17:35 #5
- Join Date
- Dec 2013
- Posts
- 18
Hey Tren. I just parsed the Nadroj character from Rappan Athhuk and this is the only error I got within the parser:
'Cannot find spell XML element with name <obscuringmistatwill> cannot parse this spell - skipping.'
It worked perfectly other than that!! Thanks a ton! Will save a ton of work and headache. So pumped!
-
February 22nd, 2014, 17:51 #6
For this one the statblock doesn't quite match the standard - for the level 0 spells the heading is "At will" where it should be "0 (at will)".
Also, note that "magic missile (x2)" will not list the magic missile correctly - change this to "magic missile (2)" and it will prepare the spell twice. Do this for all (xN) multi spells.
Glad you got it working other than this minor issue!Last edited by Trenloe; February 22nd, 2014 at 22:47.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
February 22nd, 2014, 22:11 #7
This is fantastic, Trenloe - thanks so much!
-
February 23rd, 2014, 19:17 #8
I am trying to install it via Wine on Ubuntu 12.04, but Setup.exe keeps crashing. Maybe it's because of missing .NET ... What version of .NET do I need to run the parser?
//edit:
I was able to manually install the parser by copy the .deploy files in the "Application Files" to a directory an renaming them to .exe .dll etc.
The converter seems to run fine.Last edited by tseliger; February 23rd, 2014 at 19:28.
-
March 17th, 2014, 17:33 #9
- Join Date
- Nov 2013
- Location
- Nebraska
- Posts
- 236
Trenloe,
This is what I'm getting when I try to parse a PFS scenario:
Reading data file: C:\xxxxx\PFS501Statblocks.txt
Logging to: C:\xxxxx\PFS501Statblocks.txt.log
Formatting creature stat block: CROSSBOW THUG CR 1/3
Formatting creature stat block: CROSSBOW THUG CR 2
Formatting creature stat block: HOTSPUR CR 1
Formatting creature stat block: HOTSPUR CR 2
Formatting creature stat block: FAITH BARGE THUGS CR 1/3
Formatting creature stat block: FAITH BARGE THUGS CR 2
Formatting creature stat block: Kanger CR 1
Formatting creature stat block: KANGER CR 2
Formatting creature stat block: Young River Drake CR 2
Formatting creature stat block: Giant River Drakes CR 4
Formatting creature stat block: VIPER CR 1/2
Formatting creature stat block: ADDAS GRYMBLE CR 1
Formatting creature stat block: EUGENIA GRYMBLE CR 1
Formatting creature stat block: TARSI GRYMBLE CR 1
Formatting creature stat block: ROSH CR 1/3
Formatting creature stat block: Lemure CR 1
Formatting creature stat block: Dread Lemures CR 2
Formatting creature stat block: Teplebaas CR 4
Formatting creature stat block: HOLY AHENDILE CR 2
Formatting creature stat block: Razmiri THUG CR 1/3
Formatting creature stat block: HOLY AHENDILE CR 5
Error in FormatDataFile, Message: startIndex cannot be larger than length of string.
Parameter name: startIndex
Formatting creature stat block: RAZMIRI THUG CR 1
Processing creature: CROSSBOW THUG
Processing creature: CROSSBOW THUG
Processing creature: HOTSPUR
Processing creature: HOTSPUR
Processing creature: FAITH BARGE THUGS
Processing creature: FAITH BARGE THUGS
Processing creature: Kanger
Processing creature: KANGER
Processing creature: Young River Drake
Processing creature: Giant River Drakes
Processing creature: VIPER
Processing creature: ADDAS GRYMBLE
Processing creature: EUGENIA GRYMBLE
Processing creature: TARSI GRYMBLE
Processing creature: ROSH
Processing creature: Lemure
Processing creature: Dread Lemures
Processing creature: Teplebaas
Cannot find spell XML element with name <summon> cannot parse this spell - skipping.
Processing creature: HOLY AHENDILE
Cannot find spell XML element with name <readmagicbloodlinestarsoul> cannot parse this spell - skipping.
Cannot find spell XML element with name <minutemeteors> cannot parse this spell - skipping.
Processing creature: Razmiri THUG
Processing creature: HOLY AHENDILE
Processing creature:
Error in ReadWriteFormattedCreature, Message: The empty string '' is not a valid local name.
Error in btnStartParse_Click, Message: The Writer is closed or in error state.
Module file created: C:\xxxxx\PFS501Statblocks.mod
Parsing ended - check text above for errors.
EDIT: I looked at the .fpf file that was created, and for some reason, the Razmiri Thug isn't being separated from the Holy Ahendile. I went into the .txt file to fix it (deleted the the lines between the two entries and put in a new line break), but it doesn't seem to recognize that.
I also tried running it in the v1 parser, and got the same issue.Last edited by hangarflying; March 17th, 2014 at 17:45.
-
March 17th, 2014, 17:46 #10
The statblocks are not formatted correctly in the PDF - see this post for more details: https://www.fantasygrounds.com/forum...l=1#post154924
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks