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

PCGen importer for Pathfinder

Starting a new game, Pathfinder, character creation via PCGen (v6.08 RC8).&nbsp; I need to import player characters made in PCGen over to a character sheets in Roll20. Not a new problem, as forum citations attest to. However, they tend to end with, "it's working", so hope lives.&nbsp; Have tried all the different character sheet options (community, roll20, old(legacy)). Resolved to use old based on reddit thread. Placed the java ftl file in the correct PCGen folder, export works fine. Placed the resulting export file into the GM notes block of a newly created player icon. Not the character, the icon. Leave it selected. Have had the PCGenPFImport.js added to my list of scripts for the game in the api webpage, with it open I can see the console output. Run !PCGenPFImport.js from game chat... error message spits out on api webpage. I've included it in the github gist link at the bottom, but it's small so here it is: Spinning up new sandbox... Error: Firebase.set failed: First argument contains undefined in property 'name' Error: Firebase.set failed: First argument contains undefined in property 'name' &nbsp; &nbsp; at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:9:49) &nbsp; &nbsp; at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:207) &nbsp; &nbsp; at Aa (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:8:462) &nbsp; &nbsp; at J.set (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:146:98) &nbsp; &nbsp; at createObj (/home/node/d20-api-server/api.js:2725:26) &nbsp; &nbsp; at apiscript.js:126:21 &nbsp; &nbsp; at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:154:1), &lt;anonymous&gt;:65:16) &nbsp; &nbsp; at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.j<a href="s:154:1), s:154:1), us&gt;:70:8) &nbsp; &nbsp; at /home/node/d20-api-server/api.js:1648:12 &nbsp; &nbsp; at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 Any help in getting this resolved is greatly appreciated! https://app.roll20.net/forum/post/2595554/pf-pcgen-output-to-pathfinder-character-sheet https://www.reddit.com/r/Roll20/comments/5rgi08/upgraded_to_pro_to_use_api_but_script_not_working/ https://gist.github.com/mystrzy/61b9822f6283555eb9d2705f281997a7
1589082944

Edited 1589083470
vÍnce
Pro
Sheet Author
I'm fairly certain(looking at the attribute names used in the pcgen exporter code) this script was written to work with the "Pathfinder Community Sheet" only.&nbsp; Do you have the same error using the Community Sheet? Update: Nevermind.&nbsp; After reading the reddit posts it looks like the Legacy Sheet is the only option.
1589091374

Edited 1589091497
David Z.
KS Backer
Interestingly, I tried the Community Sheet and ,besides the large header splash that looks like it thought I was invoking HeroLabs ("The Aaron Sheet v0.2.5" ... "HLImport module loaded"), the exact same error was posted: Error: Firebase.set failed: First argument contains undefined in property 'name' Error: Firebase.set failed: First argument contains undefined in property 'name' &nbsp; &nbsp; at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:9:49) &nbsp; &nbsp; at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:207) &nbsp; &nbsp; at Aa (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:8:462) &nbsp; &nbsp; at J.set (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:146:98) &nbsp; &nbsp; at createObj (/home/node/d20-api-server/api.js:2725:26) &nbsp; &nbsp; at apiscript.js:126:21 &nbsp; &nbsp; at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:154:1), &lt;anonymous&gt;:65:16) &nbsp; &nbsp; at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.j s:154:1), us&gt;:70:8) &nbsp; &nbsp; at /home/node/d20-api-server/api.js:1648:12 &nbsp; &nbsp; at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 ... and debugging this, it's giving out line and column locations where the error occurs in files that do I have access to?&nbsp;&nbsp; I added the character txt file that gets added to the GM notes block into the git gist. And the error log mentions "property 'name'" , there is no variable 'name' being declared. Is this reproducible?&nbsp;
1589091740

Edited 1589091804
vÍnce
Pro
Sheet Author
I played around with this script a little using the legacy sheet and had the same error you did. ;-( I think there may be something in the API script that is no longer compatible with roll20.&nbsp; But, I don't know enough on js and the API to say for sure.&nbsp; Maybe someone with a higher level of programming can look at this and easily spot something astray..? var RegExpEscapeSpecial =/([\/\\\/\[\]\(\)\{\}\?\+\*\|\.\^\$])/g; var AddAttribute = AddAttribute || {}; function AddAttribute(attr, value, charID) { if (value === undefined ) { log(attr + " has returned an undefined value."); sendChat("Error on " + attr + " attribute", "This attribute has been ignored."); } else { createObj("attribute", { name: attr, current: value, characterid: charID }); //use the line below for diagnostics! //log(attr + ", " + value); return; } } function AddAttributeMax(attr, value, max, charID) { if (value === undefined ) { log(attr + " has returned an undefined value."); sendChat("Error on " + attr + " attribute", "This attribute has been ignored."); } else { createObj("attribute", { name: attr, current: value, max: max, characterid: charID }); //use the line below for diagnostics! //log(attr + ", " + value); return; } } // function that adds the various abilities var AddAbility = AddAbility || {}; function addAbility(ability, text, charID) { createObj("ability", { name: ability, description: "", action: text, istokenaction: true, characterid: charID }); } function stripString(str, removeStr, replaceWith) { var r= new RegExp(removeStr.replace(RegExpEscapeSpecial,"\\$1"),'g'); return str.replace(r,replaceWith); } function getValueFromText(lines, key) { for (var i = 0; i &lt; lines.length; i++) { pair = lines[i].split(':') if (pair[0] == 'character_name'){ return pair[1] } } } on('chat:message', function (msg) { // Only run when message is an api type and contains "!PCGenPFImport" if (msg.type == 'api' &amp;&amp; msg.content.indexOf('!PCGenPFImport') !== -1) { if (!(msg.selected &amp;&amp; msg.selected.length &gt; 0)) return; // Make sure there's a selected object var token = getObj('graphic', msg.selected[0]._id); if (token.get('subtype') != 'token') return; // Don't try to set the light radius of a drawing or card //************* START CREATING CHARACTER**************** // get notes from token var originalGmNotes = token.get('gmnotes'); var gmNotes = token.get('gmnotes'); //break the string down by line returns var data = gmNotes.split("%3Cbr"); // gmNotes = stripString(gmNotes, "%3E", ""); for (var i = 0; i &lt; data.length; i++) { data[i] = data[i].replace(/%3E/g,""); data[i] = data[i].replace(/%3A/g,":"); data[i] = data[i].replace(/%3C/g,"&lt;"); data[i] = data[i].replace(/%3E/g,"&gt;"); data[i] = data[i].replace(/%23/g,"#"); data[i] = data[i].replace(/%3A/g,":"); data[i] = data[i].replace(/%3B/g,","); data[i] = data[i].replace(/%3D/g,"="); data[i] = data[i].replace(/%20/g," "); data[i] = data[i].replace(/%22/g,"\""); data[i] = data[i].replace(/%29/g,")"); data[i] = data[i].replace(/%28/g,"("); data[i] = data[i].replace(/%2C/g,","); data[i] = data[i].replace(/%7C/g,"|"); data[i] = data[i].replace(/%27/g,"'"); data[i] = data[i].replace(/%40/g,"@"); data[i] = data[i].replace(/%7B/g,"{"); data[i] = data[i].replace(/%7D/g,"}"); } var charName = getValueFromText(data,'character_name'); // check if the character entry already exists, if so error and exit. var CheckSheet = findObjs({ _type: "character", name: charName }); if (CheckSheet.length &gt; 0) { sendChat("ERROR", "This character already exists."); return; }; //Create character entry in journal, assign token var character = createObj("character", { avatar: token.get("imgsrc"), name: charName, bio: token.get('gmnotes'), gmnotes: token.get('gmnotes'), archived: false }); var charID = character.get('_id'); token.set("represents", charID); var HP = 0 var ac = 0 for (var i = 0; i &lt; data.length; i++) { pair = data[i].split(':') if (pair.length == 2){ AddAttribute(pair[0],pair[1],charID); } if (pair.length == 3){ AddAttributeMax(pair[0],pair[1],pair[2],charID); } if (pair[0] === "NPC-HD-misc"){ HP = pair[1]; } } token.set("name", charName||''); token.set("showname", true); token.set("bar3_value", HP||0); token.set("bar3_max", HP||0); token.set("bar2_value", ac||0); token.set("showplayers_bar3", true); token.set("status_blue",true); } });
Thanks for the confirmation, truly. I've seen you post on this before and it's appreciated. My programming experience is in C on embedded systems, not Java (PCGen), nor Javascript, databases.. back end stuff; this is just all relatively new to me.&nbsp; So between Feb 2, 2017 and now, something changed and this process no longer works. The ftl export script, and the js importing script have not changed.. something else has. The characters to be imported are Pathfinder, Advanced Class (a Warpriest and an Arcanist at this point). So the Advanced book line should be supported. I need this to work somehow. Immediate gratification is not a sustainable solution (although a quick fix would be nice to get my campaign rolling). It should be a seamless process for anyone that wants it can use it. Whatever is on the (PCGen) character sheet should be importable into a Roll20 character sheet. I've linked my Piazo account to here, as I was prompted on my account page, so my content library is knowable, right? The Pathfinder SRD seems to be only accessible at the "Archives of Nethys" and only in human readable form.. a shame really for what's needed here, being the database accessible by scripts. It seems that the Community Character Sheet version supports (to what extent I do not know), HeroLab. I feel it would be great if the sheet was more agnostic, and also supported PCGen. But perhaps there were embedded, historical interests of the participants, or more simply, no one has bothered to step up and help in this direction. I really do not know. So I guess there are several paths: 1) Fix what used to work. Possibly the fastest, but stuck in the past using the old sheet. 2) Use the Community version. HeroLab import already exists, maybe that functionality can be duplicated and massaged to work with a PCGen export file. Ownership being community; direction and maintenance is not supported by Roll20, and may imply more uncertainty? 3) Use Roll20 version. Official, implies stability, updates should not break things, people are paid to test before rollout.. etc. But then there are less eyes and fingers on the codebase so, more vanilla? While I've been here since the beginning, I've really just taken the passive route as a player. Now I'm stepping up here as a GM, I'm trying to coordinate my expectations (started DnD play '75) vs. current state of the art. Any feedback and/or help or kick in the general direction is greatly appreciated.&nbsp; ;)&nbsp;
1589180156

Edited 1589180188
vÍnce
Pro
Sheet Author
The community sheet has a herolab import feature built-in(some limitations apply).&nbsp; There is also Scott C's Pathfinder Companion Script aka PFC (a must if you are using the community sheet IMO) which has a text-based SRD statblock import feature included.&nbsp; Maybe you can export from PCGen a standard PF style statblock and try to import it using the PFC script?&nbsp; Not sure how that will work out.&nbsp; The parser is very finicky and was written specifically for Paizo's SRD.&nbsp; I think I had to manually edit some lines if I tried using a statblock from the d20pfsrd site and such. The newer sheet is nice but doesn't have all the features/options of the Community sheet.&nbsp; That said, development on the community sheet has pretty much come to a standstill.&nbsp; It's a very complicated sheet to work on and as-is, rather large and inefficient.&nbsp; &nbsp;But, it's hard not to still love it.&nbsp; Unless you are heading to PF2e, the future looks a little bleak for PF1e support moving forward.&nbsp; Luckily, if you play using your own materials, no worries.&nbsp;&nbsp;
1589859512
vÍnce
Pro
Sheet Author
Just reposting your solution here in case anyone follows this; David Z. &nbsp;said: I've just got my PCGen characters imported into the community PF sheet. I'd been bumping my head on the scripts not working with the targeted sheet for one reason or another for weeks, frankly. I finally went to Discord, the PCGen channel, and and asked.. a guy named Llisandur replied with&nbsp; @mystrzy &nbsp;You can try this. Drop it in outputsheets\d20\fantasy\htmlxml. csheet_roll20_HL_PF.xml.ftl 32.84 KB [ 6:54 PM ] You take the exported xml file, paste the text into " <a href="https://codebeautify.org/xmltojson" rel="nofollow">https://codebeautify.org/xmltojson</a> " and save the results file to a&nbsp; json text file. You then open up the person's character sheet near the bottom , and paste as text from the json file into the Hero Lab import text block. Your PC is just about ready to play, the spells are organized in the correct order, under the appropriate level tabs. You'll have to massage in a few areas.. descriptions like size, weight and hair color don't make it over.. inventory has to be resorted into slots.. weapons have to be manually added with appropriate damage.. but it's pretty straight forward. Just click through all the action buttons (dice icon next to effect) your PC will take to verify proper operation. Good to go. Best wishes.&nbsp; Johnathan S. &nbsp;said: I am using an updated version of the old PCGen PFImport-script to import characters exported from PCGen. My coder managed to get spells imported, but for some reason the level-sorting doesn't work even though spell levels are imported. If I change the spell level using the dropdown away from the actual spell level, then back to the correct one sorting starts to work.&nbsp; I am noticing the same behaviour on all similar sorting-tabs (Abilities, Equipment List, etc.) Is there anything my coder can do to make it work from the get-go? Best regards.