Thread: PF2CreatureParser Extension
-
August 10th, 2019, 18:48 #31Private 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!
-
August 10th, 2019, 19:28 #32
I'm actually just doing direct character code replacement, but it's good to know the replacement syntax:
s = s:gsub("%[one%-action%]", string.char(141));
s = s:gsub("%[two%-actions%]", string.char(143));
s = s:gsub("%[three%-actions%]", string.char(144));
s = s:gsub("%[reaction%]", string.char(157));
s = s:gsub("%[free%-action%]", string.char(129));
-
August 10th, 2019, 19:38 #33Private 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!
-
August 10th, 2019, 19:59 #34
-
August 10th, 2019, 20:25 #35
any idea why the PFS npc's wont parse?
Script Error: [string "campaign/scripts/npc_parse.lua"]:34: attempt to index local 'sStatBlock' (a nil value)
this is the stat block im trying to parse and yes i know its alreadt in the SR beastairy but im just using this as an example as its in the srd
MITFLIT LEVEL –1
LE SMALL FEY GREMLIN
Perception +4; darkvision, scent (imprecise) 30 feet
Languages Undercommon
Skills Acrobatics +5, Diplomacy +1 (+7 vs. arthropods), Nature +3, Stealth +5, Thievery +5
Str –1, Dex +3, Con +0, Int –1, Wis +1, Cha –1
Self-Loathing (emotion, mental) A mitflit’s self-loathing makes it easy to influence. It takes a –4 penalty on its Will DC against checks to Coerce, Demoralize, Make an Impression, and Request.
Vermin Empathy Mitflits can use Diplomacy to Make an Impression on and Request things of arthropods (insects, spiders, scorpions, crabs, and similar invertebrate animals). Most arthropods have a starting attitude of indifferent to mitflits.
Items dart (10), shortsword
AC 15; Fort +2, Ref +7, Will +4
HP 10; Weaknesses cold iron 2
Speed 20 feet; climb 20 feet
[[A]]shortsword +8 (agile, finesse, versatile S), Damage 1d6–1 piercing
[[A]] dart +8 (agile, range increment 20 feet, thrown), Damage 1d4–1 piercing
Primal Innate Spells DC 16; 2nd speak with animals (at will;
arthropods only); 1st bane; Cantrips (1st) prestidigitation
Sneak Attack The mitflit sneak deals 1d6 extra precision damage to flat-footed creatures.
Vengeful Anger (emotion, mental) As long as it isn’t frightened, a mitflit gains a +2 status bonus to damage rolls against a creature that has previously damaged or tormented it.Last edited by hawkwind; August 11th, 2019 at 07:53.
Ultimate licence
GMT Time zone-UK
brawny hook bold thug
https://discord.gg/9MHgEqV
ON DMS Guild http://www.dmsguild.com/product/2246...&filters=45680
http://www.dmsguild.com/product/2205...&filters=45680
-
August 11th, 2019, 09:32 #36
- Join Date
- Jul 2016
- Posts
- 2,503
The parser does not seem to like "LEVEL –1". Replace the first line with e.g. "MITFLIT CREATURE 1" (it at least parses for me that way).
-
August 11th, 2019, 13:26 #37
Thanks
Ultimate licence
GMT Time zone-UK
brawny hook bold thug
https://discord.gg/9MHgEqV
ON DMS Guild http://www.dmsguild.com/product/2246...&filters=45680
http://www.dmsguild.com/product/2205...&filters=45680
-
August 11th, 2019, 23:20 #38
That's right. Level is not currently recognized on the first line. I'm pretty much going by the stat block format laid out in the Bestiary.
-
August 11th, 2019, 23:33 #39
@Trenloe: I'm having a minor issue parsing spells, creating all the correct caster classes, and adding spells on the actions tab. The first time I parse a creature that has spells, I end up with the correct spell classes and levels, but no spells. Then, if I manually delete all the caster classes and parse again, it works fine. I'm manually creating the "spellset" node and spell classes if needed, but using SpellManager.addSpell to add spells once I have a spell class node.
I took a look in the ruleset, and two things caught my eye. I'm wondering if either of these might be related to my issue:
- The PC record adds a DB handler for the "spellset" node, but I don't see any such handler being set up for the NPC record. Since I'm creating "spellset" manually, is it possible I'm confusing something in the ruleset?
- SpellManager.addSpell returns nil if the level and "spells" node have not yet been created. Currently I'm only creating those nodes in the case that I can't find the spell in the rulebook module, which generally isn't the case when parsing bestiary entries. But those nodes are being created at some point. I haven't figured out how.
I'll keep investigating, but if you can think of any reason for this behavior, please let me know.
EDIT: Here are some screen shots to illustrate.
First here's the result after the first parse, followed by the console output after turning on globaldebug:
firstparse.png
Code:Runtime Notice: Reloading ruleset Runtime Notice: s'srting_traits_line.lua - onInit. sTraitType = creature' Runtime Notice: s'SpellManager.addSpell. nodeSource, nodeSpellClass, nLevel = ' | databasenode = { reference.spells.command@Pathfinder Second Edition Core Rules } | databasenode = { npc.id-00030.spellset.id-00001 } | #1 | nil | nil | nil | nil | nil | nil | nil Runtime Notice: s'SpellManager.addSpell. nodeSource, nodeSpellClass, nLevel = ' | databasenode = { reference.spells.detectalignment@Pathfinder Second Edition Core Rules } | databasenode = { npc.id-00030.spellset.id-00001 } | #1 | nil | nil | nil | nil | nil | nil | nil Runtime Notice: s'SpellManager.addSpell. nodeSource, nodeSpellClass, nLevel = ' | databasenode = { reference.spells.mending@Pathfinder Second Edition Core Rules } | databasenode = { npc.id-00030.spellset.id-00001 } | #1 | nil | nil | nil | nil | nil | nil | nil Runtime Notice: s'SpellManager.addSpell. nodeSource, nodeSpellClass, nLevel = ' | databasenode = { reference.spells.readomens@Pathfinder Second Edition Core Rules } | databasenode = { npc.id-00030.spellset.id-00001 } | #4 | nil | nil | nil | nil | nil | nil | nil
Last edited by darrenan; August 11th, 2019 at 23:48.
-
August 12th, 2019, 00:06 #40
Hmm, I'm wondering if there's a different way I should be creating "spellset" and/or the spell class. Immediately after pushing the Parse button, the spell class looks like:
Code:<id-00001> <availablelevel1 type="number">5</availablelevel1> <availablelevel4 type="number">1</availablelevel4> <cl type="number">1</cl> <dc> <misc type="number">7</misc> </dc> <label type="string">Divine Innate Spells</label> <levels> </levels> <tradition type="string">divine</tradition> </id-00001>
Code:function CreateSpellClass(sSpellClassName, nodeRecord) -- Open or Create the root node for Spell Classes. local nodeSpellset = DB.createChild(nodeRecord, "spellset"); -- Find any existing SpellClass. local nodeSpellClass, nodeLabel; for _,v in pairs(nodeSpellset.getChildren()) do nodeLabel = v.getChild("label"); if nodeLabel and sSpellClassName == nodeLabel.getValue() then nodeSpellClass = v; break; end end -- SpellClass was not found, create it. if not nodeSpellClass then nodeSpellClass = nodeSpellset.createChild(); DB.setValue(nodeSpellClass, "label", "string", sSpellClassName); nodeSpellClass.createChild("levels"); end return nodeSpellClass; end
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks