DICE PACKS BUNDLE
Page 1 of 21 12311 ... Last
  1. #1

    PF2CreatureParser Extension

    This extension adds a new "Parse" tab to the NPC window. The intended usage is as follows:

    1. Create a new NPC record.
    2. Paste stat block into the string control on the "Parse" tab.
    3. Make any manual edits (see assumptions and caveats below).
    4. Click "PARSE" button.


    At this point the NPC fields should be filled out. There is no harm in making more edits in the stat block control and then clicking PARSE again. In this case the entire block will be parsed again and all fields will be overwritten.

    How much of the creature should I copy and paste?

    The entire stat block starting with the line containing the name and level. Do not include the creature's flavor text. I would include an example picture, but I think I would be violating copyright if I did so?


    CAVEATS AND ASSUMPTIONS
    With their new stat block format, Paizo has not made it easy to parse these things. There are less keywords to look for compared to PF1 stat blocks, therefore there will be cases where simply copying and pasting a stat block from a PDF and blindly clicking PARSE will not yield the correct results. To make matters worse, I've already found instances of Paizo statblocks violating their own rules in The Bestiary (to be expected in a v1 publication). Luckily, clicking the PARSE button can be an iterative process and it's easy to adjust the stat block and push the button again, all fields will be overwritten in that case.

    Here are some of the assumptions that the parser makes to be able do its job:
    • The "Items" entry is a single line terminated with a line feed.
    • HP, HP Abilities, Immunities, Weaknesses, and Resistances are all on the same line, terminated with a line feed.
    • Immunities, Weaknesses, and Resistances are in that exact order. If they are out of order you will get unexpected results.
    • Speed is on its own line, terminated with a line feed.
    • Each Melee and Ranged strike entry is its own complete line, terminated with a line feed (this is really only important for the last strike entry, as we search for and split on 'Melee' and 'Ranged').
    • All Melee lines come before any Ranged lines. All Ranged lines come before any Spells entries. All Spells entries come before any abilities.
    • Each creature ability (interaction, automatic, reactive, offensive, and/or proactive) should be terminated with two line feeds, and the title of the ability and the ability description should be separated by a single line feed. NOTE: This is new behavior as of version 1.2 of this extension and release 14 of the ruleset, currently in the Test channel. If you are using a previous version of the ruleset, the old behavior is that each creature ability (name, traits and description) be on its own line terminated with a line feed.


    If you have problems with a stat block, the first thing to do is to run through each of the items above to make sure you're not violating any of the assumptions. Helpful Hint: If you need to combine multiple lines into one, you can select all lines in the stat block control, and then press CTRL+J

    Link to The Forge for this extension is in post #2, below.

    Change History
    8/4/2019 0.0 Initial Version. Parses everything prior to 'Speed'.
    8/4/2019 0.1 Fix issue with Weaknesses and Resistances.
    8/4/2019 0.5 Everything except Spells and Rituals should be working now. Fixed a few bugs in the top sections.
    8/7/2019 0.6 Everything on the Main tab should now be populating correctly. Fixed all reported bugs. Handle lock/unlock button correctly.
    8/13/2019 0.9 Most everything should be working now, with a few caveats. See Known Issues below.
    3/4/2020 1.0 V1. Fixed negative level issue.
    3/6/2020 1.1 Resolve most spell parsing issues. Add parse log functionality.
    3/28/2020 1.1.1 The string 'creature' in the first line of the stat block is now compared case insensitively.
    3/27/2020 1.2 Change parsing logic for interaction, reactive, automatic, offensive, and proactive abilities for ruleset version 14. Do not use with rulesets prior to release 14!!!
    3/28/2020 1.2.1 The string 'creature' in the first line of the stat block is now compared case insensitively. Do not use with rulesets prior to release 14!!!
    3/28/2020 1.2.2 Fix nil reference script error. Do not use with rulesets prior to release 14!!!
    4/19/2020 1.2.3 Compensate for change in GameSystem.actionTextToSymbols function return signature (now returns two values). Check for long versions of saving throw names and shorten them before parsing.
    7/10/2020 1.2.4 Handle a case where a string could be nil and writing to the parse log in this case would cause a script error.
    11/22/2020 1.2.5 Spells should now parse correctly when using extension in FGU.
    12/16/2021 1.2.6 4.1.12 compatibility release
    06/25/2022 1.2.7 Improvements to spells parsing.
    02/16/2023 1.2.8 Remove onInit function and announcement text.
    Improve section parsing logic.
    Add one bad char replacement.
    Use getChildList and ipairs() instead of getChildren and pairs().
    Additional parse log output.
    Add focus spell tradition and type support for Magus, Oracle, Ranger, Summoner, and Witch.
    3/13/2023 1.3 Add the ability to parse JSON statblocks generated by https://monster.pf2.tools/.
    3/16/2023 1.3.1 - Add scrollbar to the text box on the Parse tab.
    - UI cleanup on the Parse tab.
    - Wrap some of the JSON values with tonumber() where they could be either string or number type.
    - Fix logic in buildSpellBlock that was causing a script error when the NPC being parsed did not have any spell blocks.
    - Parsed NPCs will now contain the Recall Knowledge DC for the NPCs level on the Other tab.
    5/21/2023 1.3.2 Fixed a data bug that would cause Acrobatics to show up twice in the skills list.
    7/22/2023 1.3.3 More logic-proofing for nil values.
    3/11/2024 1.4 Compatibility release for FG v4.5.0

    KNOWN ISSUES
    • If you create a new NPC record, go directly to the Parse tab, paste the statblock and hit PARSE, you will end up with spell classes and levels, but no spells on the Actions tab. I'm still trying to figure out exactly why, and how to fix this. As a workaround, it seems like you need to make the Actions tab visible at least once before parsing.
    • Formulas are not being parsed yet.
    • I'm not done with Rituals yet. It will create the spell class, but no levels or spells.
    Last edited by darrenan; March 11th, 2024 at 19:00.

  2. #2
    FGU users get it from The Forge: Pathfinder 2 Creature Parser

    FGC users download: PF2CreatureParser.ext
    Last edited by darrenan; June 25th, 2022 at 17:48.

  3. #3
    This will be awesome! Can't wait.
    Ultimate License Owner since 2011 and FG GM since 2008
    Game Systems: 5E, Pathfinder, Starfinder, Call of Cthulhu, RoleMaster, C&C, Pathfinder 2, Old School Essentials

    Home Page: ShadeRaven Sorceries (Blog, Fantasy & Campaign Stories, Cat Tales, and more)

  4. #4
    REPORTING BUGS/ISSUES
    When reporting bugs or issues with this extension please make sure that you have a way to reproduce the issue 100% of the time. Explain the symptom in this thread so other users can see what has been reported. Please send me the stat block that generated the error/issue via PM directly to me, so we don't clutter up this thread with lots of walls of text. I will get to bugs and issues as quickly as my schedule allows. Thank you for your patience!

  5. #5
    @Trenloe can we get a community extensions post spun up for PF2?

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    Quote Originally Posted by darrenan View Post
    @Trenloe can we get a community extensions post spun up for PF2?
    Done. And your extensions is the first one to be listed. Nice one!
    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!

  7. #7
    Can you point me to the character code mappings for the action icons? I found 141 for single action, but having trouble tracking down the equivalents for the other action types. Thanks!

  8. #8
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    Quote Originally Posted by darrenan View Post
    Can you point me to the character code mappings for the action icons? I found 141 for single action, but having trouble tracking down the equivalents for the other action types. Thanks!
    They're a bit all over the place to not use other characters that might be needed.

    • Free Action - 129
    • One Action - 141
    • Two Actions - 143
    • Three Actions - 144
    • Reaction - 157
    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!

  9. #9
    Having just finished Creature 2s, I thought to try this out. Put the .ext file into the extensions folder and loaded up FG. However, I am not finding a listing for that extension among my many options so wondering if I have done something wrong?
    Ultimate License Owner since 2011 and FG GM since 2008
    Game Systems: 5E, Pathfinder, Starfinder, Call of Cthulhu, RoleMaster, C&C, Pathfinder 2, Old School Essentials

    Home Page: ShadeRaven Sorceries (Blog, Fantasy & Campaign Stories, Cat Tales, and more)

  10. #10
    This extension file is empty, the reason for it not showing up in the load screen. can't extract nor read content when converted to a .zip file, the extract menu says the file is empty.

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
  •  
STAR TREK 2d20

Log in

Log in