Lavaeolous / PF1-StatBlock-Converter-Module

FoundryVTT Module to convert PF1 Statblocks into Foundry Actors (PC or NPC).
MIT License
14 stars 12 forks source link

Iron Gods: Part 3: Ilarris Zeleshi does not import (hero lab = n, aonprd.com = n/a, d20pfsrd = n/a, AP pdf = n) #321

Closed adventuremagic123 closed 3 years ago

adventuremagic123 commented 3 years ago

The following statblock does not import:

Ilarris Zeleshi

classicrp commented 3 years ago

Using Furkas_Xoud_raw_PZO9087-p54.txt as source, sbc.js bogs down at #1280 let splitInit = splitGeneralData.match(/(?:Init\s*)(\+\d+|-\d+|\d+)/)[1];

The raw input is too messy to get data into the formattedInput object.

Using Furkas_Xoud_cleaned as source, sbc.js bogs down at #2581 let classEntry = JSON.parse(JSON.stringify(enumClassData[classKey[i].toLowerCase().replace(/npc/,"Npc")]));. It cannot find technomancer and throws an error. Perhaps a test against enumClassData[] first to put a placeholder in for the class prior to the assignment to dataOutput?

Included are the JSON for 'formattedInput" and 'dataOutput" and the two error messages.

20201105-sbc_js-1280_raw 20201105-sbc_js-2581_cleaned formattedInput_raw.txt formattedInput_cleaned_corrected.txt dataOutput_cleaned_corrected-error.txt

classicrp commented 3 years ago

Oh forgot the 'raw' and 'cleaned' statblocks. Included now. Furkas_Xoud_raw_PZO9087-p54.txt Furkas_Xoud_cleaned.txt

adventuremagic123 commented 3 years ago

The Iron Gods Part 3 PDF statblock shows:

sbc-pf1 | resetSBC()
sbc.js:761 sbc-pf1 | initializeSBC()
sbc.js:1026 sbc-pf1 | Parsing general data
sbc.js:1317 sbc-pf1 | Parsing defense data
sbc.js:1625 sbc-pf1 | Parsing offense data
sbc.js:1925 sbc-pf1 | Parsing tactics data
sbc.js:1975 sbc-pf1 | Parsing statistics data
sbc.js:745 sbc-pf1 | resetSBC()
sbc.js:761 sbc-pf1 | initializeSBC()
sbc.js:1026 sbc-pf1 | Parsing general data
sbc.js:1317 sbc-pf1 | Parsing defense data
sbc.js:1625 sbc-pf1 | Parsing offense data
sbc.js:1925 sbc-pf1 | Parsing tactics data
sbc.js:1975 sbc-pf1 | Parsing statistics data
4look-at-that.js:32 pullfocus keyDown
sbc.js:745 sbc-pf1 | resetSBC()
sbc.js:761 sbc-pf1 | initializeSBC()
sbc.js:1026 sbc-pf1 | Parsing general data
sbc.js:1317 sbc-pf1 | Parsing defense data
sbc.js:1625 sbc-pf1 | Parsing offense data
sbc.js:1925 sbc-pf1 | Parsing tactics data
sbc.js:1975 sbc-pf1 | Parsing statistics data
sbc.js:745 sbc-pf1 | resetSBC()
sbc.js:761 sbc-pf1 | initializeSBC()
sbc.js:1026 sbc-pf1 | Parsing general data
sbc.js:1317 sbc-pf1 | Parsing defense data
sbc.js:1625 sbc-pf1 | Parsing offense data
sbc.js:1925 sbc-pf1 | Parsing tactics data
sbc.js:1975 sbc-pf1 | Parsing statistics data
sbc.js:542 sbc-pf1 | Pushing Custom Error to Error Log
sbc.js:547 sbc-pf1 | Returning Error Log
sbc.js:2580 Uncaught (in promise) SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at setClassData (sbc.js:2580)
    at mapInputToTemplateFoundryVTT (sbc.js:2393)
    at async convertStatBlock (sbc.js:988)
    at async HTMLDivElement.<anonymous> (sbc.js:701)
adventuremagic123 commented 3 years ago

The statblock from Hero Lab shows:

sbc-pf1 | resetSBC()
sbc.js:761 sbc-pf1 | initializeSBC()
sbc.js:1026 sbc-pf1 | Parsing general data
sbc.js:1317 sbc-pf1 | Parsing defense data
sbc.js:1625 sbc-pf1 | Parsing offense data
sbc.js:1925 sbc-pf1 | Parsing tactics data
sbc.js:1975 sbc-pf1 | Parsing statistics data
sbc.js:745 sbc-pf1 | resetSBC()
sbc.js:761 sbc-pf1 | initializeSBC()
sbc.js:1026 sbc-pf1 | Parsing general data
sbc.js:1317 sbc-pf1 | Parsing defense data
sbc.js:1625 sbc-pf1 | Parsing offense data
sbc.js:1925 sbc-pf1 | Parsing tactics data
sbc.js:1975 sbc-pf1 | Parsing statistics data
sbc.js:542 sbc-pf1 | Pushing Custom Error to Error Log
sbc.js:547 sbc-pf1 | Returning Error Log
sbc.js:2580 Uncaught (in promise) SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at setClassData (sbc.js:2580)
    at mapInputToTemplateFoundryVTT (sbc.js:2393)
    at async convertStatBlock (sbc.js:988)
    at async HTMLDivElement.<anonymous> (sbc.js:701)
setClassData @ sbc.js:2580
mapInputToTemplateFoundryVTT @ sbc.js:2393
async function (async)
(anonymous) @ sbc.js:701
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2
AlphaQup2nite commented 3 years ago

as far as ive been able to figure out, its the technomancer class that is making it throw errors. A lot of PRCs tend to do that, most commonly Assassin (ive run into it like 15 times). For now, you can replace it and increase the base class a corresponding number of levels, and since all the actual level dependent data is pulled from the stat block, it doesn't matter 95% of the time, since abilites are still parsed, and you are getting proper usages and levels anyways. If you have a PRC/non common class in the statblock, try replacing them. I know i had this exact issue with this statblock, and removing technomancer made it workable.