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 .
×
The team is currently investigating an issue impacting user logins.
Create a free account

[Script] Statblock import for 5e character sheet

Keith said: Would it be possible to have this script add the additional die rolls for possible critical damage to the attack actions? This would be a helpful addition as I generally do it manually now after importing.
Hi all. Glad to know you like my work. One thing to consider is that my script "create or update" character sheet, but dont delete anything. So if for examle you have an 3 actions for a token and you parse a statblock that contains 2 actions, the first 2 action will be replaced but the third won't be changed. So maybe Rorary that was your problem. I case of doubt, delete the character sheet and run command to create a completely fresh character sheet. Concerning Bio, I'm gonna check why the B are stripped out. I also plan to add setting value for the 3 bar of the token ,and include my random HP code in the next version. Adding damage for critical is a good idea.
New update. Corrected bug that strip first character from bio and remove some forgotten debug log. Added option to set token bar to any character sheet attributs. Just set the jf.parsebarX option to '' if you don't want to use that bar. Added option to auto roll HP when dragging character sheet to board. you can also use the !jf-rollhp command and every token selected will have their HP rolled. You need to set one of the bar option to 'npc_HP'. FInally another option to specify if creature random HP should not be lower than the average value from the statblock. Don't have much time to test so pls post back here if you encounter some bug. Thank you.
The rolls for HP are public, if you choose to include the rolls (the other RandomHP on the forum doesn't) it would be nice if it was hoverable like the [[]] boxes, and if you've decided to go with average it should say like /gm rolled [[HP ROLL]], too low so HP [[AVERAGE CALCULATION]]. At the moment for a goblin I'm just getting the average of 7 back for half my rolls and it's not really telling me much by giving that information. It's obviously something you can change but IMO having the average as the minimum is silly because the enemies are just going to be harder, I would suggest that the other API had it right in that a range of minimum 1/3rd of max to max hp is best, providing variation rather than just making them harder. When it automatically fills the token bars it makes them all min and max, so for example on a skeleton that has AC 13, HP 13, PP 9 it does 9/9, 13/13, 13/13. It also simply takes the numbers from there rather than making the token use the bar link instead, while I can understand people wanting it different I think the default should be have the token linking to the char sheet at least for AC and PP which is highly unlikely to change on a token to token basis. I don't know if it did it before because now that I think about it I never checked but the name of the token isn't filled in from the character sheet, some people like show name plate to be on even with the fact that the token should represent it. I also got this back in the code, didn't do anything but I just saw it while looking at the log ""ERROR: You cannot set the imgsrc or avatar of an object unless you use an image that is in your Roll20 Library. See the API documentation for more info.", suppose that's about setting the profile picture thing then. Thanks for the work you do for free
Very awesome work Jean-Francois! Love this script!
RMcD said: The rolls for HP are public, if you choose to include the rolls (the other RandomHP on the forum doesn't) it would be nice if it was hoverable like the [[]] boxes, and if you've decided to go with average it should say like /gm rolled [[HP ROLL]], too low so HP [[AVERAGE CALCULATION]]. At the moment for a goblin I'm just getting the average of 7 back for half my rolls and it's not really telling me much by giving that information. OK, sending HP roll to chat is definitely not something we want :) Update script again to correct this, and also show orginal result if you use the minHp oprion and your roll was lower. It's obviously something you can change but IMO having the average as the minimum is silly because the enemies are just going to be harder, I would suggest that the other API had it right in that a range of minimum 1/3rd of max to max hp is best, providing variation rather than just making them harder. I'm thinking about changing this option from boolean(true/false) to a percentage, but I dont understand the 1/3 thing that give you more variation. Is it a range of 1/3 below average and 1/3 over avegrage? My formula take into account the number of hitDice and CON modifier has if you rolled the creature HP by the rule. So the variation was not has big has if, for exemple, the roll take any random number between [Average hp] - 1/3 AND [Average hp]. When it automatically fills the token bars it makes them all min and max, so for example on a skeleton that has AC 13, HP 13, PP 9 it does 9/9, 13/13, 13/13. That is wanted. If value change, you want to know the original (like HP) but if not, that dosen't break anything to have the max set anyway. It also simply takes the numbers from there rather than making the token use the bar link instead, while I can understand people wanting it different I think the default should be have the token linking to the char sheet at least for AC and PP which is highly unlikely to change on a token to token basis. No, because creature are not unique. Linking bar to character is something you want for Player character, or unique NPC only. If you set the token bar value before setting the token as default for that character sheet, every time you add this character, it will have those value set anyway, so I don't see the point about linking, except if you wan't problem later if you change the value from the token or the character sheet. I don't know if it did it before because now that I think about it I never checked but the name of the token isn't filled in from the character sheet, some people like show name plate to be on even with the fact that the token should represent it. Good point here. Updated to set the name of token now. I also got this back in the code, didn't do anything but I just saw it while looking at the log ""ERROR: You cannot set the imgsrc or avatar of an object unless you use an image that is in your Roll20 Library. See the API documentation for more info.", suppose that's about setting the profile picture thing then. Yep Thanks for the work you do for free
Take note that in script 2.3, Bar1 (Green) set to HP, Bar2 (Blue) set to AC, Bar3 (Red) set to Speed by default. Should I disable those by default? Poll for DM here: wich value do you set for those token bar in your game?
That is exactly how I have mine set.
It would be great if you could set a configuration for it. I use Red as HP, Blue as AC, currently don't have anything in Green, but speed sounds reasonable to me.
1427395220
Kryx
Pro
Sheet Author
API Scripter
bar 3 (red) is hp Bar 1 (green) is ac. Configurable seems like the best option.
It is configurable. Just check the first line of the script. You can even set one to 'npc_passive_perception' for instance and the script will use the inline roll to get the actual value from the sheet, even if it's auto calculated and not present on the character ability tab.
I just logged in to my campaign tonight to finish adding monsters and !jf-parse does nothing now. As if my API was no longer there. I checked, it is there. Has Roll20 done something that might stop the API from working?
Found the problem. Error message at the bottom of the API said the script detected an error and stopped working. "Unexpected Token s". Fix and resave.
Jean-Francois, I was finally able to work with the newest script (as I am prepping for a new campaign), and I like all of the improvements. I would like to make one suggestion regarding setting the bar values, is it possible to set a configuration flag in the script to determine if the max value should be set? Because obviously it makes sense for max to be set for HP, but not so much for say speed or AC. Also, I came across a monster that doesn't parse well, the Galeb Duhr. The reason is due to the Speed line, which reads as follows: Speed 15ft. (30ft. when rolling, 60ft. rolling downhill) Thanks, this script truly is a huge time saver!
I ran into the "Unexpected Token s" error again which locked me out of the API. Does anyone know what's causing this?
Such a huge time saver, thank you so much, Jean-Francois R. I do have one request though, as it doesn't seem to be implemented yet, maybe it is now but things need to be updated on the npc character sheet for it.. Anyways, Crit Damage, I can add them easy enough to the character sheet. Hit: 5 [[1d10]] piercing damage. Crit: [[2d10]] But if the same functionality could be in with the PC sheets, and maybe this is more of a question of the NPC Monster sheet you are using. So when the "monster" rolls a crit, it automatically generates double dice. So I don't have to overload the effect with crit damage on each roll. Thanks, Greg
@Greg - I think unless Jean-Francois wants to get into the business of creating custom macros using roll templates the current version of the NPC sheet does not accommodate the ability to hide a critical hits like the standard PC sheet does.
Understood thanks Kevin, I guess then perhaps just an option with the generated "actions" to also include a critical hit function? I mean I can add them manually, but I'm guessing more people would want them than wouldn't. Saves me from looking up what the damage is and then doing my own /roll. Just my .02.
@Greg, yes I agree adding a critical is important. I generally roll behind the screen, so for me adding it to the action itself would be sufficient, In my opinion I don't feel that separating it to it's own action would be beneficial when it can simply be ignored unless a critical occurs (purely my opinion, others may feel strongly that it should be separated somehow).
1427987690

Edited 1428015625
Kryx
Pro
Sheet Author
API Scripter
Jean-Francois, Any interest in supporting the D&D 5e Shaped Sheet ? I have documented all the NPC changes here: <a href="https://app.roll20.net/forum/post/1734923/new-d-an" rel="nofollow">https://app.roll20.net/forum/post/1734923/new-d-an</a>... . You can actually include both attributes and both the default sheet and mine will work. If not, I could fork this and change the attributes, but I'd rather not maintain it if you'd be willing to add the extra attributes. :) @Greg: I am working on monster attacks that are much like the layout of spells and weapon attacks on the default sheet. They will be able to crit the same way. If you're interested you can follow my sheet's progress here: [New] D&D 5e Shaped Character Sheet . I'm open to suggestions on the templates if you have any ideas.
Cool, I'll take a look Mark
1428015499

Edited 1428015545
Kryx
Pro
Sheet Author
API Scripter
Jean-Francois, For rolling hp of monsters you don't allow for cases like "7d10 + 24". It only allows XdX. I find the "XdX + X" syntax to be very common. Are you planning on supporting that?
This is inherently supported with the script. From every monster I have seen the formula is XdY + (X*con mod). So during import he is stripping the everything after the +, then simply multiplying number of hit die times the con mod.
1428018016
Kryx
Pro
Sheet Author
API Scripter
Kevin said: This is inherently supported with the script. From every monster I have seen the formula is XdY + (X*con mod). So during import he is stripping the everything after the +, then simply multiplying number of hit die times the con mod. Interesting. I didn't notice that con ALWAYS matched the bonus. Cool.
Mark said: Jean-Francois, Any interest in supporting the D&D 5e Shaped Sheet ? I have documented all the NPC changes here: <a href="https://app.roll20.net/forum/post/1734923/new-d-an" rel="nofollow">https://app.roll20.net/forum/post/1734923/new-d-an</a>... . You can actually include both attributes and both the default sheet and mine will work. If not, I could fork this and change the attributes, but I'd rather not maintain it if you'd be willing to add the extra attributes. :) Yes, your sheet is nice. No time to work on this now but something I would like to do.
1428160523
Kryx
Pro
Sheet Author
API Scripter
Jean-Francois R. said: Yes, your sheet is nice. No time to work on this now but something I would like to do. Btw I really appreciate the work you did with the importer. It made writing my conversion script a lot easier. I'll likely fork your version then for my shaped sheet and add additional items for the NPC Attacks then. Thanks again for your work. :)
Hi Jean-Francois R. I love the sheet, any chance it could grab the entire HD of the monster rather than cutting off the con bonus? I've also noted that a few of the monsters that I've imported with an INT saving throw bonus doesn't apply the proficiency bonus when imported.
1428388085
Kryx
Pro
Sheet Author
API Scripter
Greg, as mentioned above (in response to me) the hd bonus is cut off as it is calculated by the sheet. Also save throw bonus and proficiency are different. Not all monsters match.
Thanks Mark. I don't see the sheet doing any calculation just the NPC_HP. Guard has 2d8+2 Hit Dice but when it gets imported to NPC_HP_Hit_Dice the +2 is cut off. So when I use the Aaron's script to generate random HP for monsters it doesn't have the con bonus added. So i've been updating every sheet with that value; not a big thing but since it was different than what was captured I thought I would mention it. As for the saving throw bonuses I am very aware that not monsters receive the proficiency bonus to INT Saves. Try importing the stat block of ArchMage or Mage, it will read the Wisdom +3 Prof ok, but it won't read the +3 for Int. Think its a bug, wanted to share.
Greg B. - I was using Aaron's MonsterHitDie script previously, but switched over to using the automatic HP rolling associated with the latest revisions of this script and it works well and automatically accounts for how the Hit Dice are calculated. Basically what I am saying is that the functionality in this script can replace Aaron's MonsterHitDie script. However I still use Aaron's TokenNameNumber script and have made slight modifications to Jean-Francois work to automatically set the token name appropriately to use this script. This way I have essentially a 3-4 step process to configure monsters: 1. Copy statblock to GM Notes manually correcting any inconsistencies. 2. Run !build-monster 3. (optional) Run my macro creation script (I like having saving throws, initiative, and traits buttons automatically created as token actions, again personal preference). 4. Link the token to the sheet and set the journal image. Then in my case every time I pull a monster out onto the board it is automatically numbered (by TokenNameNumber) and HP are automatically rolled (by the Build-Monster/JF-Parse).
1428427540
Kryx
Pro
Sheet Author
API Scripter
@Greg: I agree that the HD note should have the full HD (XdY + Z) if it is shown. I plan to do so on my shaped importer. @Kevin: Can you link to the auto numberer? I'd love to include it as an optional param.
1428429742

Edited 1428430185
@Kevin Ah I must have missed that functionality as I only use the MonsterStat Block import script in my Storage Campaign and then I just move them from there. Where is where I have aaron's scripts to generate the number and hp. Also mind sharing your Macro script to generate the token action macros? Does this work with only the NPC_Sheet or will it also work with the Player Sheet as well? @Mark - Here is the link, I also use it. It works great.
1428431083
The Aaron
Pro
API Scripter
Kevin said: Basically what I am saying is that the functionality in this script can replace Aaron's MonsterHitDie script. [...] Then in my case every time I pull a monster out onto the board it is automatically numbered (by TokenNameNumber) and HP are automatically rolled (by the Build-Monster/JF-Parse). So, this script automatically rolls individual hit points for monsters dragged into the VTT?
1428431726
Kryx
Pro
Sheet Author
API Scripter
The Aaron said: So, this script automatically rolls individual hit points for monsters dragged into the VTT? Correct
Yes, and it factors in the con bonus which is different, why doesn't your script factor in the con bonus "the Aaron" :)
1428433683
The Aaron
Pro
API Scripter
Because back when I wrote it, there weren't character sheets, so people put that stuff in manually based on whatever attributes they set up. =D That's pretty cool, I'll have to look at using this one. =D
@Greg B. - Let me clean it up a bit and make it a little less "customized" for my game. It is really just a simple script that creates ability macros for most buttons automatically for both PC and NPC (based on the command run) as well as a few common macros (cure wounds, divine smite, etc...). After I do, I will post it for people to use. I am a complete code hack who hasn't had the time to put in to become better, so once it's posted, pardon the very simple code used... it works... it's just not as pretty or efficient as it should be.
@The Aaron HAHA, yeah I use a lot of your stuff, be sure to let me know when you decided to calculate the con bonus so I can then stop adding it into my NPC sheets and removing it from the old ones lol. @Kevin Ok great thanks.
So i'm a big dumbie. I thought I upgraded to the newest version of the script but I was still using an old one.. SMH.. So yeah I got the new version working but its putting values in all 3 bars with High/low settings any way to tune it so its only putting in the first value and/or a place I can "link" the bar1, 2, 3. I looked through the script but it escapes me.
CreateMacro script here . "!createmacro --ExactCharacterName" for PC generic ability macros. "!createmacro --ExactMonsterName --npc" for NPC generic ability macros. The current version of the script will only set both the min and max values. It also does not bar_link (which frankly I have found few reasons to bar_link except unique NPC, but for them I manually set them anyway). Again this was an area that I tweaked Jean-Francois script for personal use automatically adding "%%NUMBERED%%" token name reference and manually eliminating the max values for the bars that I didn't need max values for.
1428448070

Edited 1428449215
Anyone know why after I upgraded to version 2.3 I am no longer getting Actions? I just did 3 Animals: Boar, Constrictor Snake, and Crocodile and each one, no actions.
Well took me a while but looks like the issue is related to the npc_passive_perception value in bar2, took that out and now it seems to finish running the script. (Shrugs)
This would've been helpful to know about before I created 5e NPC sheets for every single monster in the monster manual myself!
1428518930
The Aaron
Pro
API Scripter
I ran into an issue with the Cultist Fanatic, but haven't had the chance to track it down yet. It feels sacrilegious to report a problem without a solution, but I've been a little busy... =/
@Jose P. I started on a few, and then came across this.. Jean did great job with it.. @TheAaron only for you, I don't have the skills to offer a solution; I just identify issues. Truth be told the 2.3 script seems to still sometimes miss the actions when its doing its bar parsing, so i've reverted back to 1.6 and then just ended up using your token mod to finish the creature. Thank you for the help on that The Aaron, got it perfect and streamlined now. and thanks to @Kevin I can even populate it with a ton of macros too. Life is good, for now...
1428520195
The Aaron
Pro
API Scripter
=D
The Aaron said: I ran into an issue with the Cultist Fanatic, but haven't had the chance to track it down yet. It feels sacrilegious to report a problem without a solution, but I've been a little busy... =/ Check the console for any error. I parse the Cult Fanatic from my source and get "Skill reli gion is not a valid skill" warning because of the space.
Greg B. said: Anyone know why after I upgraded to version 2.3 I am no longer getting Actions? I just did 3 Animals: Boar, Constrictor Snake, and Crocodile and each one, no actions. Well took me a while but looks like the issue is related to the npc_passive_perception value in bar2, took that out and now it seems to finish running the script. (Shrugs) I tried to parse the boar, with the bar2 set to npc_passive_perception and all goes well. No error.... Did you see some error in console or chat? Also, bar setup come after the statblock get parsed so it should not have any impact.