FG Spreadshirt Swag
Page 1 of 23 12311 ... Last
  1. #1
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291

    Pathfinder Creature Parser - FULL release V1.0.0.15 - Updated 3rd January

    New v2 beta test available here: https://www.fantasygrounds.com/forum...2-Beta-Version

    UPDATE - 3rd January 2012. Full Version 1.0.0.15

    Attachment 2247

    New features/items fixed:
    • Modified to be able to read stat blocks from the Combat Manager application - https://www.combatmanager.com/. See readme.txt file and below.
    • logging disabled by default. Parsing is much faster without logging!
    • added custom xp tag to each create - XP is not used by Fantasy Grounds at present.
    • Added a token reference for each creature - see readme.txt and below.


    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!

    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


    GOTCHAS

    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.

    Stat block titles
    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 one 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)

    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 parses fine with some minor changes to the HeroLab exported file:
    1. Add an XP line between the Name/CR line and Type line.
    2. Remove the --------- lines around the section titles. (remove the whole line)
    3. Remove any blank lines within each individual statblock.
    4. Remove the HeroLab notice at the bottom.


    -------------------------------------------------------------


    Hi everyone,

    For a while I've been slowly developing an application that allows parsing of Pathfinder creature stat blocks from a text file into a Fantasy Grounds mod file.

    I've tried to design this so that stat blocks can just be copied from PF material (start with the description and end with the special abilities) into a text file and then the text file can be parsed into a creature module for loading in FG.

    See the files in the attachment. Extract to a folder. Run setup.exe.

    Follow the instructions in readme.txt.

    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 PM me with details of:

    1) The error raised.
    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; February 22nd, 2014 at 16:55.

  2. #2

    Parser Testing

    Any specific formating issues we should look for when creating the text file (doesnt like certain chracters ior spacing iussues?). I ran an npc from the first steps scenario into the parser and received the following parser notice toward the end:

    Processing creature: Deandre Dulay
    Error in ReadWriteFormattedCreature, Message: Index was outside the bounds of the array.
    Error in btnStartParse_Click, Message: Conversion from string "Index was outside the bounds of " to type 'Integer' is not valid.
    Module file created: C:\Documents and Settings\Main\My Documents\Downloads\pathfinderSocietyScenarioIntro 1FirstStepsPartIInServiceToLorePFRPGPDF\parsermodt est.mod


    I'm assuming keeping the tactics in the text file was a bad idea, but anything else that would specifically lead to the 2 errors above? I get a mod file and it shows in my library, but Im unable to see anything inside when I open. One other basic question for now - should I be encoding the .txt file as an ANSI, Unicode or UTF-8 file?
    Last edited by Talen; October 6th, 2011 at 22:42.

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291
    Quote Originally Posted by Talen
    Any specific formating issues we should look for when creating the text file (doesnt like certain chracters ior spacing iussues?).
    I've coded remove spaces at the end and beginning of lines, remove TABs, remove long hyphens and replace with the minus (-) sign, but I'm sure there are some in there that I still need to track down - I noticed the "x" for "x3" damage wasn't processing properly and need to update that.

    But, I tried to design it so that you can just copy and paste the stat block - have a look at the example in the zip file.

    Quote Originally Posted by Talen
    I ran an npc from the first steps scenario into the parser and received the following parser notice toward the end:

    Processing creature: Deandre Dulay
    Error in ReadWriteFormattedCreature, Message: Index was outside the bounds of the array.
    Error in btnStartParse_Click, Message: Conversion from string "Index was outside the bounds of " to type 'Integer' is not valid.
    Module file created: C:\Documents and Settings\Main\My Documents\Downloads\pathfinderSocietyScenarioIntro 1FirstStepsPartIInServiceToLorePFRPGPDF\parsermodt est.mod

    I'm assuming keeping the tactics in the text file was a bad idea, but anything else that would specifically lead to the 2 errors above?
    One of the first things I need to do is try to make the error messages more meaningful!

    I did all of my testing against monsters from Bestiary 1 and 2 and followed the stat block definition from page 6 of Bestiary 2. Late last night I ran a couple of NPCs from Carrion Crown 2 (Trial of the Beast) through and realisesd that I'm going to have to do some more work as NPCs are different to Monsters!

    As a starter Tactics need to be removed for now. I'll code for that later and move the tactics into the "Other" tab of the NPC.

    Please send the .txt file you were using to martinblake1415 (at) h o t m a i l (dot) c o m and I'll take a look. Sorry it flopped at the first step!

    Quote Originally Posted by Talen
    I get a mod file and it shows in my library, but Im unable to see anything inside when I open. One other basic question for now - should I be encoding the .txt file as an ANSI, Unicode or UTF-8 file?
    Even with errors I continue processing (in case you're doing a lot of creatures together and some of them work). If there was an error on the first creature then there won't be a complete db.xml file in the mod.

    The files I've been using are ANSI with Windows 1252 encoding. The encoiding has been necessary for some of the above mentioned issues (hyphens etc). I may look into making it cover other formats at a later date (if it's relatively easy and not expanding the formats is an issue to some people).

  4. #4
    Thanks for the info - I sent the text file your way.

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291
    Update: V 1.0.0.7 fixes items 2 and 3.

    Issues identified so far:

    Thanks to Talen for pointing me in their direction.

    1. PFS NPCs don't have XP entry. A lot of the initial logic in determining description, name/CR and type needs this line. Workaround - enter XP 1 in a line between name/CR and type.
    2. Creatures with "gear" entries rather than treasure. Workaround - change the Gear/Combat Gear title to "Treasure".
    3. Tactics section causes errors. Workaround - remove all tactics section (upto but not including "Statistics" title).


    I'm working on finding good solutions to the above items. In the mean-time if you want to parse the creature/NPC use the workarounds mentioned.
    Last edited by Trenloe; October 7th, 2011 at 12:02.

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291

    Update V1.0.0.7

    Update available - see the first post for download, changes and gotchas.

  7. #7
    Working great! The time save is fantastic! A few nitpicking points at the moment. The parser still doesnt like seeing "other gear"...it comes out as "no match" in the npc - but the good news is that it doesnt stop the parse and doesnt make a practical difference. Also, Im sure this was a further down the road point - but traps will stop the parse if you try to get them in.

  8. #8
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291
    Quote Originally Posted by Talen
    Working great! The time save is fantastic!
    Glad it's working for you. Yeah, I've been very surprised with the time save - I imported all the custom monsters from Carrion Crown 2 in about 5 minutes!

    I'm currently around 30% into a first pass of Bestiary 2 - currently up to Dragons (there are a lot of A's and D's in Bestiary 2!). So far, everything parses through OK - a couple of things to sort out, the main one being single attack format...
    Quote Originally Posted by Talen
    A few nitpicking points at the moment. The parser still doesnt like seeing "other gear"...it comes out as "no match" in the npc - but the good news is that it doesnt stop the parse and doesnt make a practical difference.
    Looks like "Gear" slipped through my "do comparisons case insensitive" code. I'll update in the next release. Before then, if you want to avoid "no match" appearing, use "Gear", "Combat Gear" and "Other Gear" (leading capitals on all).
    Quote Originally Posted by Talen
    Also, Im sure this was a further down the road point - but traps will stop the parse if you try to get them in.
    Yep, I'm sure anything other than creature stat blocks will break the parser. I've no plans to bring in traps - basically, because there is nowhere to put them in Fantasy Grounds! I suppose they could be put in as freeform story entries, but you may as well copy/paste them directly into FG yourself...

  9. #9
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291

    HeroLab "Output Active Hero Statblock" parsing

    I've done some testing with the HeroLab statblock output (File -> Output Active Hero Statblock -> Plain Text -> Save to File) and this parses fine with a couple of minor changes to the HeroLab exported file:
    1. Add an XP line between the Name/CR line and Type line.
    2. Remove the --------- lines around the section titles. (remove the whole line)
    3. Remove the HeroLab notice at the bottom.

  10. #10
    Is the hero lab use just a validation or is there some other use?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in