PF statblock importer

Discussion concerning lmarkus' campaign framework for D&D3.x and Pathfinder.

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice, lmarkus001

Forum rules
Discussion regarding lmarkus001's framework only. Other posts deleted without notice! :)
Imper1um
Cave Troll
Posts: 92
Joined: Mon Sep 28, 2009 7:46 am

Re: PF statblock importer

Post by Imper1um »

Well, if something says (+grab) then, I would put it in the Attack Name, appended to the end.

Also, noticed one other thing: Knowledge, Profession, Craft and Perform checks are not added to the list. :P

Good job on the parsing so far, though. It's great!

User avatar
Cosworth
Cave Troll
Posts: 31
Joined: Thu Nov 19, 2009 1:17 pm
Location: Denmark
Contact:

Re: PF statblock importer

Post by Cosworth »

Neofax you need to increase the memory for maptool.

neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Re: PF statblock importer

Post by neofax »

Cosworth wrote:Neofax you need to increase the memory for maptool.
To what? I run at 1024/32/8. Also, the below are giving me an error of:

Illegal argument type java.lang.String, expecting java.math.BigDecimal
Spoiler
Hobgoblin CR 1/2
XP 200
Hobgoblin fighter 1
LE Medium humanoid (goblinoid)
Init +2; Senses darkvision 60 ft.; Perception +2
Defense
AC 16, touch 12, flat-footed 14 (+3 armor, +2 Dex, +1 shield)
hp 11 (1d10+6)
Fort +5, Ref +2, Will +1
Offense
Speed 30 ft.
Melee longsword +3 (1d8+2/19–20)
Ranged longbow +2 (1d8/×3)
Statistics
Str 15, Dex 15, Con 16, Int 10, Wis 12, Cha 8
Base Atk +1; CMB +3; CMD 15
Feats Toughness, Weapon Focus (longsword)
Skills Perception +2, Stealth +6; Racial Modifiers +4 Stealth
Languages Common, Goblin
Ecology
Environment temperate hills
Organization gang (4–9), warband (10–24), or tribe (25+ plus 50% noncombatants, 1 sergeant of 3rd level per 20 adults, 1 or 2 lieutenants of 4th or 5th level, 1 leader of 6th–8th level, 6–12 leopards, and 1–4 ogres or 1–2 trolls)
Treasure NPC Gear (studded leather armor, light steel shield, longsword, longbow with 20 arrows, other treasure)


Orc CR 1/3
XP 135
Orc warrior 1
CE Medium humanoid
Init +0; Senses darkvision 60 ft., low-light vision; Perception –1
Defense
AC 13, touch 10, flat-footed 13 (+3 armor)
hp 6 (1d10+1)
Fort +3, Ref +0, Will –1
Defensive Abilities ferocity
Offense
Speed 30 ft.
Melee falchion +4 (2d4+4/18–20)
Ranged javelin +1 (1d6+3)
Statistics
Str 17, Dex 11, Con 12, Int 7, Wis 8, Cha 6
Base Atk +1; CMB +4; CMD 14
Feats Weapon Focus (falchion)
Skills Intimidate +2
Languages Common, Orc
Ecology
Environment temperate hills, mountains, or underground
Organization solitary, gang (2–4), squad (11–20 plus 2 sergeants of 3rd level and 1 leader of 3rd–6th level), or band (30–100 plus 150% noncombatants plus 1 sergeant of 3rd level per 10 adults, 1 lieutenant of 5th level per 20 adults, and 1 leader of 7th level per 30 adults)
Treasure NPC gear (studded leather armor, falchion, 4 javelins, other treasure)

User avatar
Zaro
Cave Troll
Posts: 61
Joined: Fri Apr 17, 2009 1:34 pm

Re: PF statblock importer

Post by Zaro »

I tired all 3 of the stat blocks you put up Neo and they worked without any problems or errors. I dropped the token on the field, clicked and ran the macro. Pasted the stat block and no problems. I also tried overwriting a token already setup for pathfinder with no problems. In addition I tried a fresh download of the newest framework and an older edition that has been updated many times with the same results.

neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Re: PF statblock importer

Post by neofax »

The problem is in Lindsay's FW B63R4. The ECL value is causing the problem. Removing this portion of the code solves my problem:

Code: Select all

[H: id = strfind(statblock, "\\bCR ([0-9]/?[0-9]?)")]
[H, IF(0<getFindCount(id)),CODE:
  { 
  [CR=getGroup(id, 1, 1)]
  [Levels =  setStrProp(Levels, "ECL", CR)]
  [Level = max(1,CR)]
  [output=output+"CR: "+CR+"<br>"]
  }]

User avatar
lmarkus001
Great Wyrm
Posts: 1867
Joined: Sat Mar 29, 2008 12:30 am
Location: Layfayette Hill, PA

Re: PF statblock importer

Post by lmarkus001 »

That is weird, I have not touched Level or ECL at all....

User avatar
Cosworth
Cave Troll
Posts: 31
Joined: Thu Nov 19, 2009 1:17 pm
Location: Denmark
Contact:

Re: PF statblock importer

Post by Cosworth »

neofax wrote: To what? I run at 1024/32/8.
Try this setting
javaw -Xmx1024M -Xss2048K -jar maptool-*.jar run

neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Re: PF statblock importer

Post by neofax »

Cosworth wrote:
neofax wrote: To what? I run at 1024/32/8.
Try this setting
javaw -Xmx1024M -Xss2048K -jar maptool-*.jar run
Same error. Using the above settings. I normally run with a -Xss8192K which should be fine.

Even just trying to run the Skills only, I get the error

Code: Select all

java.lang.NullPointerException error executing expression s = json.set( s, "rank", skVal-eval(skStat)).
. Here is the skills line:

Code: Select all

Skills Acrobatics +3, Climb +8, Escape Artist +2, Fly +2, Heal +6, Intimidate +4, Perception +10, Ride +8, Sense Motive +2, Stealth +8, Survival +8, Swim +6

User avatar
Cosworth
Cave Troll
Posts: 31
Joined: Thu Nov 19, 2009 1:17 pm
Location: Denmark
Contact:

Re: PF statblock importer

Post by Cosworth »

Sorry but none of your samples fail for me, so I can't help you. There's nothing in the macro that should cause floating point exceptions apart from the usual memory issues.

Imper1um
Cave Troll
Posts: 92
Joined: Mon Sep 28, 2009 7:46 am

Re: PF statblock importer

Post by Imper1um »

Make sure you have the latest version of the Pathfinder Property Sets.

neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Re: PF statblock importer

Post by neofax »

First, with the current B63R4(haven't checked lower versions), any NPC with a CR less than 1, it fails. Second, Escape Artist skill does not have a corresponding skStat and causes the macro to fail. I figured this out using zEal's debugger. So, how do I go about fixing the skStat error and the CR problem?

EDIT: For the Escape Artist problem(probably any two word skills as well), the macro is looking for Escape Artist in the SkillStat property, but it is EscapeArtist. Therefore, the variable is true, but the macro cannot get the corresponding Ability Bonus of DexB and fails.

User avatar
Zaro
Cave Troll
Posts: 61
Joined: Fri Apr 17, 2009 1:34 pm

Re: PF statblock importer

Post by Zaro »

I just tried using the same setup you have reported with the current release of the framework B63R04 and used a Weasel as my test case. Has a CR of 1/2 and ranks in Escape Artist fulfilling both reported problems.
Weasel stat block
Weasel CR 1/2
XP 200
N Tiny animal
Init +2; Senses low-light vision, scent; Perception +1
Defense
AC 15, touch 14, flat-footed 13 (+2 Dex, +1 natural, +2 size)
hp 4 (1d8)
Fort +2, Ref +4, Will +1
Offense
Speed 20 ft., climb 20 ft.
Melee bite +4 (1d3–4 plus attach)
Space 2-1/2 ft.; Reach 0 ft.
Statistics
Str 3, Dex 15, Con 10, Int 2, Wis 12, Cha 5
Base Atk +0; CMB +0; CMD 6 (10 vs. trip)
Feats Weapon Finesse
Skills Acrobatics +10, Climb +10, Escape Artist +6, Stealth +14; Racial Modifiers +4 Stealth, +8 Acrobatics
Ecology
Environment temperate hills
Organization solitary
Treasure none
Special Abilities
Attach (Ex) When a weasel hits with a bite attack, it automatically grapples its foe, inflicting automatic bite damage each round.

Weasels are predators content with raiding chicken coops or attacking pets when they encounter civilization.
The macro completed perfectly fine, though the ranks in escape artist did not register, no macro errors at all. Checked the token to make sure it registered the correct settings and the CR was correct.
Reported Result
Weasel: Token Updated: Name: Weasel , CR: 1/2
Size: Tiny, type: Animal , subtypes: Sighttype: Lowlight, Reach: 0, Str: 3, Dex: 15, Con: 10, Int: 2, Wis: 12, Cha: 5 Fort: 2, Ref: 2, Will: 0 HP: 4 Base Atk: 0, AC/tch/FF/CMD/CMDFF: 15/15/13/6/4 Spd: 20, Climb: 20 Skills: Acrobatics 10, Climb 10, Escape Artist 6, Perception 1, Stealth 14, Feats: Weapon Finesse, Weapons: ["bite +4 (1d3–4 plus attach)"]

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: PF statblock importer

Post by Azhrei »

It appears that the token I used had some left-over properties on it, so they were not receiving the default values as set in the campaign properties. That screwed up a couple of different fields. I'm thinking that there should be a loop at the top of the macro that clears all existing properties (using resetProperty) before parsing the statblock.

For the skill problem, I was trying to paste a 3.5 block into the PF statblock tool and it wasn't finding the skills and throwing an error. I've modified my version to simply skip any skills that it doesn't recognize and add them to a list so that they can be reported to the user when the import process is complete (so the user knows which skills to check manually).

Skills won't work if they are two words in the statblock because they appear as only a single word in the SkillStat property. An easy solution is to delete all spaces, but this won't work for the subskills (such as Craft and Knowledge). I'm thinking that removing all spaces and parentheses will produce the correct result before doing the lookup. I actually have this macro open for editing in MT right now, but I need to fix my wife's Windows box before I can work on this more. :(

Otherwise, I'm diggin' this tool!

neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Re: PF statblock importer

Post by neofax »

Here is exactly what is happening:
Fail

As you can see, skStat is blank as it cannot find "Escape Artist"(doesn't exist in the list with the space between words) and output is trying to process Escape Artist +2. If there is a way to remove the space, it would work.

User avatar
Cosworth
Cave Troll
Posts: 31
Joined: Thu Nov 19, 2009 1:17 pm
Location: Denmark
Contact:

Re: PF statblock importer

Post by Cosworth »

I have fixes ready for cleaning tokens, HD calc, And Skills with spaces in them. Knowledge and craft skills are not done yet.

I've had some trouble tuning the attacks interpretation in the framework, so I've changed strategy a bit in this version.
Instead of trying to identify all relevant feats and whether an attack is a light weapon or not I'm now simply marking all weapons "not multiattack" and instead calculate the statblocks penalties into the attack bonus.

Although this is wrong in principle it yields the correct rolls.

The framework creates a dependancy between weapons by requiring the primary weapon to indicate whether a secondary weapon is being used. Since this dependancy exists, there's little point in trying to be accurate as long as the die rolls are correct.
Attachments
Statblock2Token1_6.mtmacro
v1.6
(5.17 KiB) Downloaded 175 times

Post Reply

Return to “D&D 3.5/Pathfinder 1e Campaign Macros”