Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Pathfinder Statblock Import to Character Sheet Script

1422830237
vÍnce
Pro
Sheet Author
Feats are working nice Jason. I can't break them by just using stock statblocks. :-)
Well, I'm stuck :-) Maybe the problem is that I actually have no idea about all this stuff. Im just that sort of dumb copy-and-paste-user when it comes to programming :-/. Here's my problem: I "updated" to the version 2.23 (copying the code from above into the API script window of my campaign and saved the script). Now I put the Statblock - taken from d20pfsrd - in the GM-Notes of the token and saved it. Then I selected the token and in the chat entered !PathfinderImport. Nothing happens and I get the following error (in the API-Window of the campaign): Error: Firebase.set failed: First argument contains NaN in property 'current' at Error (<anonymous>) at Aa (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:9:186) at Aa (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:196) at za (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:8:468) at G.W.set (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:128:98) at createObj ( What should I do?
1422832590
vÍnce
Pro
Sheet Author
Hi Daniel. Does this happen if you try a different stat block? If it doesn't, then there may be something in the stat block that's causing the script to fail.
Daniel, could you link me the Stat block you were trying to use? I'll have a look and see what i can do. Please note the Pathfinder Reference Document works the best because of its format, where as the D20pfsrd tends to do bothersome things with tables and need copying via notepad etc first. Also version 2.25 out, completed the repeating weapons section and fixed crits :-)
Jason, another option for those using chrome is to "paste as plain text". This essentially does the same thing as copying to notepad.
1422849044

Edited 1422849163
Hi there, got up a little early today, so i had time to run a few tests. I actually was using the statblocks from d20pfsrd. I now switched over to those from the paizo prd . And I tried to use different stat blocks as well. I always copied the stat block over to a plain-text editor first before copying it into the Tokens GM-Notes (so it's been plain-text only all the time). When I use a different stat block (that for a goblin) it works just fine! But it seems the script doesn't like dire rats, because when using this stat block dire rat statblock from the paizo prd . It produces the following error all the time: Error: Firebase.set failed: First argument contains NaN in property 'current' at Error (<anonymous>) at Aa (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:9:186) at Aa (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:196) at za (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:8:468) at G.W.set (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:128:98) at createObj ( So it looks like there is something wrong with the stat block.. Just to make sure it's not me doing something wrong on my end as well thats the content of my tokens GM-Notes field is as follows: DIRE RAT CR 1/3 XP 135 N Small animal Init +3; Senses low-light vision, scent; Perception +4 DEFENSE AC 14, touch 14, flat-footed 11 (+3 Dex, +1 size) hp 5 (1d8+1) Fort +3, Ref +5, Will +1 OFFENSE Speed 40 ft., climb 20 ft., swim 20 ft. Melee bite +1 (1d4 plus disease) Special Attacks disease STATISTICS Str 10, Dex 17, Con 13, Int 2, Wis 13, Cha 4 Base Atk +0; CMB –1; CMD 12 (16 vs. trip) Feats Skill Focus (Perception) Skills Climb +11, Perception +4, Stealth +11, Swim +11; Racial Modifiers uses Dex to modify Climb and Swim ECOLOGY Environment any urban Organization solitary or pack (2–20) Treasure none SPECIAL ABILITIES Disease (Ex) Filth fever: Bite—injury; save Fort DC 11; onset 1d3 days; frequency 1/day; effect 1d3 Dex damage and 1d3 Con damage; cure 2 consecutive saves. The save DC is Constitution-based. Many thanks for the quick help, Jason.
1422850890

Edited 1422851346
vÍnce
Pro
Sheet Author
Something in this line of the Skills causes the error. Finding movement types more than once in the statblock...? UPDATE: I removed the semi-colon and it works. ; Racial Modifiers uses Dex to modify Climb and Swim
1422851407
vÍnce
Pro
Sheet Author
Jason P. said: Also version 2.25 out, completed the repeating weapons section and fixed crits :-) Very nice Jason.
Thanks Vince for the support! The old Dire Rat again eh... I'll put my thinking cap on and try to work out a way to make it so that duplicates don't cause such issues, but for the mean time just keep an eye on the stat blocks for anything that doesn't fit the standard layout.
I've just been testing it during my work-break and removing that semicolon did the trick :-) Many thanks to you, Vince. And special thanks to you, Jason, for this awesome script. This is pure magic :-)
I'm loving the script, but I wanted to let you know that creatures without attack bonuses (like swarms) make it stop working. It doesn't throw an error in chat, but there was one in the API output console because the .length of the attack bonus string was null.
Ahh, yep, that'd do it too haha. Thanks for the heads up, i'll keep it in mind for future updates - i'm kinda hanging out until this update of holding. For the mean time you can get around it by putting in a dummy attack :-)
1425712397
vÍnce
Pro
Sheet Author
Getting an error trying to run the script. v2.25 for some reason. This was working like a champ a few weeks ago. Doesn't seem to matter what the statblock I throw at it. Suggestions? TypeError: Cannot call method 'split' of undefined at evalmachine. :4767:28 at eval (
1425882616
vÍnce
Pro
Sheet Author
Vince said: Getting an error trying to run the script. v2.25 for some reason. This was working like a champ a few weeks ago. Doesn't seem to matter what the statblock I throw at it. Suggestions? TypeError: Cannot call method 'split' of undefined at evalmachine.:4767:28 at eval ( Nevermind. The issue seems to have fixed itself... :-)
1427296651

Edited 1427311356
I keep getting this error. TypeError: Cannot call method 'replace' of undefined at evalmachine.:3047:33 at eval ( I've tried lots of different monsters from Paizo SRD and even got it when I copy and pasted the block from another token which had run successfully before. I also got this one a couple of times. Error: Firebase.set failed: First argument contains NaN in property 'current' at Error (<anonymous>) at Aa (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:9:186) at Aa (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:196) at za (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:8:468) at G.W.set (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:128:98) at createObj ( Still with a Paizo critter, a leopard. Everything was working last time I used the importer a week or so ago. Any ideas?
I get the 2nd error Dawn gets (First argument contains NaN in property 'current') when trying to import Amiri. Simply removing this line Raging Statistics When raging, Amiri's stats are AC 13; hp 17; Fort +6, Will +3; Melee Large bastard sword +5 (2d8+9/19–20); CMB +7; Skills Climb +7. from her Tactics section fixes it. Amazing stuff! I guess ill create her raging stuff by hand... or something. not 100pct sure how to handle it
Well that wasnt too bad. I just changed her Melee attacks line to be Melee Large bastard sword +3 (2d8+6/19–20), Raging Large bastard sword +5 (2d8+9/19–20) and deleted the Raging line from Tactics. youll still have to remember to change her CMD, AC, HP, etc manually, but its better than nothing
Any reason ?{Hits-Landed|0} isnt ?{Hits-Landed|1} ? I cant think of a case where youd click the damage macro without having hit at least once. I can edit mine by hand if its a style thing, but with a value onf one, i can just click the dmg macro and a quick enter-enter to accept defaults of 1 hit, 0 crits for most (non-crit heh) cases.
Does this create only NPC characters? Or would this work for importing actual Player Character stats if I turned them into a typical PRD block?
Try it out? :-P - I've used it for player characters, but because the GM has to do the copying to GM notes it also works to just let players input their own data, unless of course you're using pregens in which case this tool would still be very handy for t he GM.
1428242299
vÍnce
Pro
Sheet Author
I would think that any relevant stat that you add to a statblock "template" would be imported. So in theory you could import/create a character. Obviously, there will be many attributes used when creating a character manually that will not get created when using this script in this manner, so you will have to make changes/additions after import. That said, I could see how this could possibly speed up character creation as well. Goodluck
1428310732

Edited 1428310902
The code assumed positive attack values - poor Lini with her -1 sickle attack broke it, as i suspect small monsters will. (Side note,m similar changes need to be made around line 322 if we want to handle cursed weapons hehe) changed line 302 to attackName = attackNoBrackets[i].match(/(.*) \+/) || attackNoBrackets[i].match(/(.*) \-/); 334: attackString = attackNoBrackets[i].match(/\+(\d+)/g) || attackNoBrackets[i].match(/\-(\d+)/g); and 338 attackValues[n] = parseInt(attackString[n].replace("+",""),10) || parseInt(attackString[n].replace("-",""),10);
1428374602
vÍnce
Pro
Sheet Author
I guess you modify the "cursed" items so they'll not break the import script and then adjust back to cursed after the fact. Workaround, but still worth it.
I didnt implement the cursed items idea as almost no one needs it. I just modified it so it can handle normal entries such as a low-str character trying to melee (poor Lini the druid) Melee sickle –1 (1d4–2)