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

Herolab: Import .por into Roll20 to fill char sheet

I was wondering if this was at all possible to import a .por file into roll20 to automatically fill out the character sheet? I love the look of the character sheets in roll20; but, as it stands right now, my players all use Herolab and having them to fill out a char sheet can be tedious (especially when we have limited time as is). Or instead of .por maybe a PDF to Roll20? Have it look for the specific statblocks (Str, Dex, Int, Char, Wis)?
1404308200
The Aaron
Roll20 Production Team
API Scripter
HoneyBadger has done some work with importing standard formats for monsters. If .por is a text format and you understand it, you could probably create at least partial solution, but a full solution isn't possible as not all fields for a character sheet are accessible.
Once I have some money I can spare... I'm going to buy a copy of HeroLab and work on making the D&D 4e importer work with that too.... but I don't know when I'll have that extra money.
Honey, I'm sure a lot of us who use Herolab (or just me...haha) would be willing to donate a Herolab package to you so you could get it to import to Roll20. :}
1404315285
The Aaron
Roll20 Production Team
API Scripter
You can start a Crowd Tilt campaign: <a href="https://www.crowdtilt.com" rel="nofollow">https://www.crowdtilt.com</a> It's like KickStarter for pizza sized purchases. =D
@HoneyBadger, I sent you a PM saying I can provide you a license with almost every single package. Don't know if you read it/saw it...
.por files are binary. However, you can output XML in Hero Lab. File-&gt;Save Custom Output; Select 'Generate XML file' I don't know if all Hero Lab Game systems support this. My question is how would you then import this into Roll20? I've written converters for my Castles & Crusades Hero Lab plugin, to import the XML into Fantasy Grounds, but I'm new to Roll20 and have no idea how to go about this.
I have started on a HeroLab Pathfinder Character Importer via the XML output. It is definitely feasible, but there will also be limitations based largely on the actual information available in the XML vs. what the sheet requires. For example the class information section is breaks down HP, BAB, Saves, etc... by class and the Hero Lab simply doesn't have this data. Sure you could look to figure some of this out based on classes... but when there are soon to be 39 classes and lord knows how many archetypes, so it feels like quite a bit of work (for a fledgling coder like me) for little gain. I likely will just include the totals on the "class-0" line. As mentioned above though, I am a fledgling coder and have just been slowly working my way through this as time permits, so it won't be something that I will complete in the near term.
Can you perhaps give me a hint on how you're getting the data into Roll20? Is there something in the API to read in an external XML file, and somehow parse the data? (I just became a mentor a few days ago so that I can create a character sheet for Castles & Crusades, of which my Hero Lab plugin has been around for a couple months now) I'm an old geezer in programming circles. My first programming class in college was FORTRAN on punch-cards.
HoneyBadger has written a mob importer for 4E here: <a href="https://app.roll20.net/forum/post/703974/script-d-" rel="nofollow">https://app.roll20.net/forum/post/703974/script-d-</a>... The basic premise is to cut and paste the XML output to the 'gmnotes' section of the token, then select the token and execute the API script command. You need to do some pre-processing to clean up special character... then from there you just start using regular expressions to start pulling the information you need out. I have actually been meaning to PM HoneyBadger because basically StatBlock special character replacement code works nearly perfectly (needed to add one item), so I have been using this as the basis to my script (hopefully he is ok with that as he deserves full credit for that section). What I have been doing is focusing on just getting the information I need, as the functions to update the actual attributes on the sheet are pretty straight forward, so before I work on actually updating the sheet I would like to know that I can actually get all of the required data out of the XML files. Having some challenges though as there are simply areas where the XML is missing expected things...
Fantasic, thanks for the link Kevin. Since I'm building the character sheet for Castles&Crusades for Roll20, as well as wrote the Hero Lab plugin for C&C, this shouldn't take but a couple hours play.
Please whatever you do...just do Pathfinder! Anyone! LOL.
Oh my gosh, it's freakin' working, it's really working. Takes output from my Castles & Crusades Hero Lab plugin, and creates a character with the stats pulled from the Custom XML Output. Thanks and credz go to HoneyBadger and Kevin for helping me get it working.
Maybe someone can help with the current challenge I have... Here is the XML string for Initiative: &lt;initiative total="+5" attrname="Dexterity" misctext="+0" attrtext="+3"&gt; &lt;situationalmodifiers text=""/&gt; &lt;/initiative&gt; The challenge that I have is that HeroLabs is not including the trait bonus as a miscellaneous bonus, nor is this bonus shown anywhere else except in descriptive text (which is not helpful at all). So what I am trying to figure out is a way to determine the total miscellaneous bonus. Now in the example above I can simply take the difference between the total and the attrtext values... however the problem I have is how exactly should I handle a situation where either the total or the attrtext are negative value? So first problem is mathematically how can I handle that, second problem is actually from a .js coding side what is the simplest way to handle it?
1404994204
Sam M.
Pro
Sheet Author
Misc init = total init + -dex ?
@Sam, thanks! I think that will indeed work. I figured it was simple but for some reason I couldn't wrap my head around it last night. Now to figure out how to do that in js...
1404998646

Edited 1404999622
Boomer, can you tell us what you did? I'm noob. :o edit: Will see if it works for Pathfinder...thanks Kevin.
Kuriin... As I said before there will be limitations... what I have so far: 1) HP, BAB, Saves cannot be broken down by class, the XML output simply provides totals for these and trying to write something to account for each class and archetype would be overly complicated. 2) I am not familiar with Fame/Prestige (as I don't use this system) so I don't know if it will be possible to implement this, hopefully isn't a big deal as it is just a couple of manual fields to fill in. 3) There is no way to know if the HP Formula is correct, so if for some reason this is not based on @CON-mod or something unusual, the formula will need to be manually updated to account for this. 4) Armor Class Penalties and Max Dex in XML output are cumulative for the armor equipped, so there is no way for me to break this down per armor piece... 5) Armor Type is not specified in the XML and will need to be set manually, but I am not sure if this is specifically a major problem. 6) Armor and shield identification is rudimentary at best... so it may not work well in all cases. I still have quite a lot yet to go through as I haven't touched Worn Magical Equipment (Not sure this can even be implemented), Skills, Feats, Weapons, and Spells. So as you can see there will be quite a few limitations and there is quite a lot to still handle. I am sure a veteran programmer could handle it much quicker (and likely much more eloquently) than I am, but as I do see real value in this and haven't seen anyone else wanting to pick it up, I am slowly picking away at it.
&lt;3 Thanks, Kevin. You rock!
Next question: I haven't looked through all of HoneyBadgers code, just enough to get me started filling in pre-defined boxes. On the character sheet I created, I'm using a repeating fieldset for racial/class abilities. Is it possible to programmatically add another field, so that I can then fill it with an entry from my XML? (If this is already being done in HB's code, no need to point me to it, just say yes and I'll search his code.)
I can't answer that honestly as I haven't gotten to the main repeating sections of the Pathfinder section. I have been under the assumption that you simply need to create the fields based on the sheet definition. For example on the Pathfinder sheet weapons are "repeating_weapon_X_field" where "X" starts at 0 and increments with each one, and "field" is the field on the sheet, like name, attack-type, etc... I could be completely wrong in how that works though.
1405016139
Sam M.
Pro
Sheet Author
I think you got it Kevin, though I don't remember if the system actually shows those attributes in the attributes and abilities page. If it doesn't, then repeating sections could be a problem for importing.
1405018527

Edited 1405018571
BoomerET said: Next question: I haven't looked through all of HoneyBadgers code, just enough to get me started filling in pre-defined boxes. On the character sheet I created, I'm using a repeating fieldset for racial/class abilities. Is it possible to programmatically add another field, so that I can then fill it with an entry from my XML? (If this is already being done in HB's code, no need to point me to it, just say yes and I'll search his code.) My character importer pre-dates the character sheets in Roll20. It was written using attributes only. I do intend to update the attributes it creates based on the D&D 4e sheet here on Roll20 eventually. Just have not had the time or motivation lately due to a new job and new work schedule. I do not know if you can simply create the right attribute in the api and have it propagate to the character sheet. I have done absolutely no work with character sheets./
Well, HoneyBadger, you'll be happy to know that your script fills out character sheets just dandy. (Which I would suspect, since all character sheet input files are attributes) Thanks again for your work.
Tried doing it...think I'm getting a little confused. I copy and pasted the XML output (Example:) &lt;/program&gt; &lt;localization language="eng" units="imperial"/&gt; &lt;character active="yes" nature="normal" role="pc" relationship="ally" type="Hero" name="Lady Ardath" playername="Vvoid"&gt; &lt;race racetext="Aasimar" name="Aasimar" ethnicity=""/&gt; &lt;alignment name="Neutral Good"/&gt; &lt;templates summary=""/&gt; &lt;size name="Medium"&gt; &lt;space text="5'" value="5"/&gt; &lt;reach text="5'" value="5"/&gt; &lt;/size&gt; &lt;deity name="Ragathiel"/&gt; &lt;challengerating value="4" text="CR 4"/&gt; &lt;xpaward value="1200" text="1,200 XP"/&gt; &lt;classes level="4" summary="Summoner (Synthesist) 4/Champion 1" summaryabbr="Sum 4/Champ 1"&gt; And click the token, use the command that was in the original thread that HoneyBadger posted...and nothing happens. Am I doing something wrong?
It's not that simple Kuriin. You will need a custom script to basically process the xml file and pick bits and pieces out of it, then take those bits and pieces and add them to the attributes section of the journal entry. My script is currently at 250 lines and does nothing but pull the bits and pieces out (well still under halfway through)... I still have to take those bits and pieces and build the functions to add them to the sheet, then go back through each section and insert that function. I have been at this off and on for 3 weeks and figure I am probably less than 50% completed. Again I am a novice, every line I write I have to check it and test it with many values and variables to make sure it works. The script that I am working on will only work for Hero Lab Portfolio's created for Pathfinder... every individual system will need to have it's own customer script to scrape the required details out of the xml and copy it into the sheet.
OK. I will wait for yours then since I am only looking for Pathfinder. Let me know if I can help -- such as buying any of the packages.
1405268178
Paul S.
Sheet Author
API Scripter
Ok. Something that might make life easier. Not sure. You can, in Herolab, output the Hero Stat Block. Below is what it looks like. Basically this stat block is the same format needed for current Pathfinder Mob Importer API. Now- that API just needs to be modified to strip out the Statistics block and make attributes from them. This would then auto-fill the sheet. Don't know about Defense block and filling the character sheet - Seems that it would take a bit more work the way the character sheet is setup. But perhaps since it does have "armor", "shield", and what not broken out - those fields could be filled in... Anyway. Just posted this because perhaps you will find it easier than dealing with the messy XML from Hero Labs. Unnamed Hero Human (Varisian) Swashbuckler 9 N Medium humanoid (human) Init +9; Senses Perception +11 -------------------- Defense -------------------- AC 28, touch 17, flat-footed 21 (+9 armor, +2 shield, +5 Dex, +2 dodge) hp 107 (9d10+45) Fort +9, Ref +14, Will +7 Defensive Abilities charmed life -------------------- Offense -------------------- Speed 30 ft., deed: kip-up Melee +1 scimitar +19/+14 (1d6+6/15-20+9 Precision) Ranged shortbow +14/+9 (1d6/×3) Special Attacks deed: menacing swordplay, deed: opportune parry and riposte, deed: precise strike, deed: targeted strike, panache -------------------- Statistics -------------------- Str 13, Dex 20, Con 16, Int 12, Wis 10, Cha 16 Base Atk +9; CMB +10; CMD 27 (27 vs. disarm, 27 vs. steal, 27 vs. sunder) ISWG Feats Combat Reflexes, Critical Focus, Dervish Dance , Greater Weapon Focus (scimitar), Toughness, Weapon ........
I had originally wanted to use the stat block and the original pathfinder mob importer as the basis, but the reality is that the statblock is just a summary of the character/mob and important details are missing. I am hoping to have a more complete solution that leverages the tremendous power of the sheet that Sam built, and for that I need details for every important "fillable" entry on the sheet.
I really wish WolfLair would work with Roll20 in this regard. That would be amazing.
1405354696
Paul S.
Sheet Author
API Scripter
Kevin - have you looked at some of the custom HTML output sheets for herolab? There's one .... and I can't recall which... that should have everything you need (skills and all).
Paul S. - I have looked at the custom HTML output. "AncientOne's" is the best... but realize that ALL of the custom output HTML are still based on the XML output, so the same limitations would apply. As someone who is just learning Javascript it will take a long time for me to complete the script, besides I still have a family, a full time job, and two campaigns to run.
1405390773
Paul S.
Sheet Author
API Scripter
I'm in the same boat Kevin. I'm putting some thought into it when I have brain cells to spare....not many of those left at the moment.
Any updates on this? :)
No progress. As I am trying to be responsible based on item 2 of THIS thread, I don't have many "non-primetime" hours to work on this. Not to mention family summer activities, don't expect it for quite a long time (or not at all if further limitations are required to keep the API stable for all users.
1406056869

Edited 1406056973
BoomerET
KS Backer
Kevin, A tool that might help you in creating the regular expressions is called 'Expresso'. <a href="http://www.ultrapico.com/expresso.htm" rel="nofollow">http://www.ultrapico.com/expresso.htm</a> (You are using regex to get values, right?) That's what I'm using for my Castles&Crusades importer, saves a lot of time. As to the thread you mentioned, I just looked at one of my PFS characters, and the resulting XML is only 72k, so the dev's have said that's acceptable. At least until they come up with an alternative.
1406064823
The Aaron
Roll20 Production Team
API Scripter
You might consider pre processing the file into a more terse representation. I do something similar with my walls script. I parse the SVG for the path into a series of small commands using PHP and then just post them all into the chat: <a href="https://app.roll20.net/forum/post/949734/script-walls-svg-path-importer-for-dynamic-lighting#post-954175" rel="nofollow">https://app.roll20.net/forum/post/949734/script-walls-svg-path-importer-for-dynamic-lighting#post-954175</a>
Aaron, Just to be clear what you are suggesting, basically you have an "On Chat" listener looking for GM and then if the GM posts things in a specific format you strip the value and add it to the sheet? If my understanding is correct, do you happen to know the chat box line limitations? (Pardon improper terminology as I am still slowly learning)
1406073831
The Aaron
Roll20 Production Team
API Scripter
No worries. Thats pretty much what I'm suggesting. In my case, I extract all the line data from the SVG file and spit out a list of commands like this: !walls begin !walls viewbox 1151 1151 !walls moveto 105.00 0.00 !walls curveto 105.00 0.00 105.00 45.00 105.00 45.00 !walls curveto 105.00 45.00 565.00 45.00 565.00 45.00 !walls curveto 565.00 45.00 672.00 45.00 672.00 45.00 ... !walls curveto 645.00 393.00 645.00 305.00 645.00 305.00 !walls curveto 645.00 305.00 505.00 305.00 505.00 305.00 !walls curveto 505.00 305.00 505.00 345.00 505.00 345.00 !walls end I've pasted 1-2 thousand lines this way with out issue. It does bog down the whole campaign while it's parsing them. Each ! walls command stores data in the state, and the !walls end causes that data to be turned into lines on the dynamic light layer. In your case, I was thinking you could parse that 72k of data in XML (which is extremely verbose, I'm sure you know...) down into something more manageable. Perhaps a JSON structure of just the data you need. You could then either paste that into the API via the chat (you'd need to strip all the carriage returns as it would otherwise send each line as it's own command with only the first one going to the API and the rest being chat messages), or you could load it into a handout as you have already, then parse it with the API (which is probably a better idea). Terminology: "On Chat" listener would probably be called a chat event handler , or maybe just a chat message processor . Speaking of GMs, I have a script that I think handles checking for GMs about as gracefully as is possible. Full description in this chat thread, but basically, it automatically determines who is a GM (isn't fooled by shenanigans by players changing their name), and caches the info for later checks. All that is required is that any GM speaks as themselves one time after installation of the script or after resetting the isGM module: <a href="https://app.roll20.net/forum/post/920764/script-is" rel="nofollow">https://app.roll20.net/forum/post/920764/script-is</a>... All that is required to use it from your own script is: if( isGM( player_id ) ) { // do some GM only things } (Some day, I'll expand on it to handle permissions that are grantable by the GM to players, but I'm not there yet. =D)
Aaron, thanks, that helps quite a bit. I have a .js script that pull 90% of what I need to populate the sheet, but I have slowed down as I was concerned about impacting the API environment as I would hate that anything I do disrupt someone else's gaming. Can you suggest a tool or method where I could use the current javascript that I have created in Roll20, and run it on my own PC using the xml file as an input? Basically what I am hoping to do is pre-process the file down to minimal output, then be able to cut and paste that into the journal/gmnotes and read it in. Thanks for any advice you could give.
1406079973
The Aaron
Roll20 Production Team
API Scripter
Sure! You can do that with Node.js. Here's a link to a tutorial I found on Google that looks reasonable: <a href="http://javascript.cs.lmu.edu/notes/commandlinejs/" rel="nofollow">http://javascript.cs.lmu.edu/notes/commandlinejs/</a> I had been trying to setup a REPL environment that I could run Roll20 API scripts in that would mock out the interfaces and allow me to do some offline testing. Getting a script running under Node.js locally (at least on the Mac) was very straight forward. I don't have a windows computer, but if you run into any issues, I'm happy to try and help you suss out the problem. Also, I wouldn't worry too much about disrupting anyone else's games. Riley has been putting a ton of hard work into preventing that from happening.
Aaron said: I've pasted 1-2 thousand lines this way with out issue. It does bog down the whole campaign while it's parsing them. Each ! walls command stores data in the state, and the !walls end causes that data to be turned into lines on the dynamic light layer. Have you done this since the new restrictions were put into place? Just curious if it triggers the CPU one. Kevin said: No progress. As I am trying to be responsible based on item 2 of THIS thread, I don't have many "non-primetime" hours to work on this. Not to mention family summer activities, don't expect it for quite a long time (or not at all if further limitations are required to keep the API stable for all users. And I appreciate your effort in that regard :-). Note that with the new API restrictions in place, you don't necessarily have to worry too much about affecting other people because if you are, it's just going to kill your sandbox anyway (basically it will no longer *let* you interfere with other people). That said, I still think getting the data as small as possible is a good course of action.
1406170650
The Aaron
Roll20 Production Team
API Scripter
Riley, I haven't tried it since you started working on the API changes. I'll try a nice big fat one first thing in the morning when I get to work, about 6:00am CST, and post back. =D
1406205464
The Aaron
Roll20 Production Team
API Scripter
Ok Riley, back with some results. My standard test file is 1133 lines of commands. I pasted that in and it actually seemed to ran faster than it has in the past. I only have anecdotal evidence, but it appeared to be 2-3 times faster, taking only about 20 seconds. No errors or stops from the API. I then pasted 4 copies of my standard test file in (4532 lines) and ran that. Doing so really bogged the play page down (to the point where chrome asked if I wanted to wait or kill it), but it recovered after the 4 copies of the walls were created. I ran the standard set one more time and looked at some profiling, here's a snapshot: Unsurprisingly, it spent most of the time in firebase.js:52 W.onmessage() Recorded timeline data during the standard set: Hope that's useful. Let me know if you want me to try anything else! --aaron
It might be useful to move this to a new thread, since it's no longer about importing a character. Just a suggestion.
1406229041

Edited 1406229086
The Aaron
Roll20 Production Team
API Scripter
Well.. it's tangentially related... It does show that if you wanted to do your import of some large amount of data (272k in the larger case above), you could do it via a long block of: !command &lt;data&gt; &lt;data&gt; &lt;data&gt; ... !command &lt;data&gt; &lt;data&gt; &lt;data&gt; ... ... !command &lt;data&gt; &lt;data&gt; &lt;data&gt; ... :without negatively impacting cpu and memory performance. Regardless, I don't think I'll need to post more about it here. =D
I would still like to find a way to import a character from Herolab to Roll20. ;[
The only way to import something is to paste text into a token or chat window at the moment. I just tested my D&D 4e Monster Importer which weighs in at 310 lines on a 30 kilobyte xml monster and it still works with the api restrictions in place.
I think I tried that, but it wouldn't work. Though, I think Kevin mentioned it's more complicated than just copy and pasting the XML into the token GM notes. Not to mention, it only works for D&D ?
I don't know the structure of the herolab xml file, but if it can be done for D&D... it can be done for other games too. It's just a matter of writing the script.
Kuriin... either I am not clear or you are misunderstanding. I am working on a script specifically for Pathfinder that will do exactly what you want. You will go into Hero Lab, export the xml, copy and paste that into the gmnotes of the token and execute the script. Another point that I feel needs clarified because I get the sense you might not understand, there will not be a "universal importer" from Hero Labs into Roll20, it will need to be system specific (and character sheet specific). So when I complete the one I am working on for Pathfinder, someone else will likely need to make one for D&D or Savage Worlds or whatever... The goal has been to create this script for Pathfinder and I am working on it, but as I stated from the beginning, I am a NOVICE, who has a full time job, 2 kids and still runs 2 campaigns on Roll20. I can't sit down and dedicate a large chunk of time to this, so it is going to take me a significant amount of time because I am learning, iterating, re-writing sections of code to make it more efficient when I run into trouble or learn something new. So unless a veteran coder who has time would like to take this up, please be patient, or you could start learning javascript and the API to write this for yourself.