STAR TREK 2d20
Page 19 of 21 First ... 91718192021 Last
  1. #181
    That would be pretty handy, and certainly less error-prone than the text parsing method. Obviously this only works with the data output from monster.pf2.tools. I'm not aware of any JSON 'standard' for representing PF2 creatures. I would want to refactor my code to allow a lot of the data setting stuff to be shared between the text and json parsing methods.

    How are you doing the JSON parsing?
    Last edited by darrenan; February 23rd, 2023 at 19:00.

  2. #182
    After you read the file in FG just use this.

    Utility.decodeJSON(json) sets it up as a lua Table. It is organized like this once you decode it . strength = {value=1, ... notes= ""}


    So no need to Parse it is exact. So you just do something like this:

    if rNPCData.strength.value == "" then sValue = 0 else sValue = rNPCData.strength.value end
    DB.setValue(nodeRecord, "strength", "number", tonumber(sValue));


    The skills will require concanation (haven't gotten that far) and the spells will require a look up in the ref manuals that are loaded.

    I can pass along the entire thing. I just merged it into your script. Its a side quest of a side quest so really need to be working on some main projects haha. If your on discord can message me there for the copy of your file.
    Last edited by bayne7400; February 23rd, 2023 at 19:31.

  3. #183
    That's straightforward, I'll start working on it.

  4. #184
    Let me know if you need anything it took me a minute to figure out how to get and read the file but it ended up being very simple. I just wanted to see if I could do it.

  5. #185
    Version 1.3, which has the ability to parse JSON stat blocks generated by https://monster.pf2.tools/ has been uploaded to the Forge. I'm sure there are bugs, but I've done as much testing as I can think of. Please post here if you get script errors, or find things that don't seem to be working correctly.

    There are some known issues with the web site, but the author of the site is no longer maintaining that version of the tool so I've done the best I can with the output. You will also see differences in the NPCs generated by parsing the text output and the json output from that web site because of the way it generates the text stat block which is incorrect in a few places.

  6. #186
    Version 1.3.1 has been pushed to the Forge. See post #1 for changes in this version.

  7. #187
    Version 1.3.2 has been pushed to the Forge. See post #1 for changes in this version.

  8. #188
    Hello, I have found out that following JSON doesn't parse properly. JSON in question is from the conversion github repository, which works perfectly when you put it into the monster.pf2e.tools. I have tried just copying this particular json to the parser and first uploading it to the monster.pf2e.tools, exporting a json from there and then copying it to the parser but it fails with the attached parse log and the partially parsed creature looks like the attached png file.

    Thanks for your work!
    Attached Images Attached Images
    Attached Files Attached Files

  9. #189
    The errors described in the previous post have been fixed and version 1.3.3 has been uploaded to the forge.

  10. #190
    I tried parsing the text from Nethys for the giant skunk
    https://2e.aonprd.com/Monsters.aspx?ID=1311
    It

    Giant Skunk
    Creature 1
    N Large Animal
    Source Bestiary 3 pg. 246
    Perception +6; low-light vision, scent (imprecise) 40 feet
    Skills Acrobatics +7, Athletics +6, Stealth +7
    Str +3, Dex +4, Con +3, Int -4, Wis +1, Cha +0
    AC 16; Fort +8, Ref +9, Will +4
    HP 21
    Speed 25 feet
    Melee [one-action] jaws +8 [+3/-2], Damage 1d6+3 piercing
    Melee [one-action] claw +8 [+4/+0] (agile), Damage 1d4+3 slashing

    Spray Blinding Musk [two-actions] (poison)
    The giant skunk propels potent, acrid musk in a 15-foot cone.
    Each creature in the line must attempt a DC 17 Fortitude save.
    Critical Success The target is unaffected.
    Success The target is sickened 1. Failure The target is sickened 3.
    Critical Failure The target is blinded for 1 round, becomes sickened 3, and takes a –2 penalty to Stealth checks from the horrific odor for 24 hours or until the musk is removed or neutralized, requiring 10 minutes of thorough scrubbing with soap.

    It seemed to parse that ok, but the Spray Blinding Musk had no clickable actions. Should there be actions after parsing for special effects or does the extension no create any of those?
    https://i.imgur.com/Mug5rrx.png

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