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

Rolling random HP for monster tokens when adding them to a map

Greetings! I wanted to see if anyone could give me some ideas on how to do this. I was thinking of having an attribute for each of the monster character sheets that would be something like 3d8+2 or whatever the case may be and then having a script read that attribute, roll the dice and then set the rolled value as the token's HP (in bar 1). This way I would get random HP for every monster placed automatically. This is for D&D 5E if it makes any difference :-) Thanks!
Which sheet are you using, the default sheet or the shaped sheet? &nbsp;Either way there are scripts that do this for both versions of the sheet. Normal Sheet: <a href="https://github.com/shdwjk/Roll20API/tree/master/Mo" rel="nofollow">https://github.com/shdwjk/Roll20API/tree/master/Mo</a>... Shaped-Sheet: <a href="https://app.roll20.net/forum/post/1816031/script-d" rel="nofollow">https://app.roll20.net/forum/post/1816031/script-d</a>... The shaped-sheet is a multi-function script that includes the functionality that you are looking for (and then a whole lot more).
Very cool! I'm using the normal sheet for now. Going to check this out right now, thanks! I just noticed that this is on the script index page...I feel silly having missed it.
1440159415
The Aaron
Pro
API Scripter
There are many scripts, it's hard to spot the ones you want sometimes. :) Let me know if you need any help with that first one. :)
I do have one question that just came to mind...why does the script add a CON bonus to the rolled hit point dice? I thought that the hit point dice in the monster stat blocks are all that need to be rolled to get a random HP...or am I missing something? I'm guessing that this would be used for when you don't put a bonus in the "npc_HP_hit_dice" variable.&nbsp;I actually took out the CON bonus code and have it just roll the dice as they are in the MM stat blocks. Thanks for creating this script by the way :-)
1440169462
The Aaron
Pro
API Scripter
So, there were some users that wanted that functionality (some importers import the hit dice without the con bonus, some do it with). &nbsp;You can just change line 13 to be = '', and it will ignore the possibility of a con bonus.
Got it all working as I wanted to...thanks again!
Guys, I'm pretty stupid with this stuff. 1. I copied the normal sheet script and made a new script in the API Scrips section. I named it: randomHPgenerator.js 2. I pressed save 3. I dragged a Skeleton NPC I made onto the board Where do I put the [[2d8+4]] for the skeletons HP? Sorry if this is a dumb question, but this isn't my strong point :(
If you are using the NPC Sheet part of the character sheet, then your dice formula goes into the HP Hit Dice field (it's just above swim speed). At least that's how I'm using it and it works for me :-)
Thank you!
1444684844
The Aaron
Pro
API Scripter
Glad you got it working! &nbsp;Definitely post back if you run into any more issues.&nbsp;