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

Making all creatures start with more HP

So this doesn't need to be the tidiest thing but what i'm looking for is a API for 5th edition dungeons and dragons npc's to all have 1 more hit die to their health or something like that.  The method would be as follows:  I go to the put in an API script:  Something sorta like "NPC creature health = Standard + >insert value here<" It affects all creatures and maybe even the PC's but I can fix that afterwards.  If mr goblin has 1d6+2 rolled for his health, then when I put "1" into "insert value here" in the formula it'll become 2d6+2, the average will update and so on.  The purpose for this is so I can quickly "beef up" all creatures based on the team composition.  I have a team of 6, all the creatures mysteriously beef up abit. If the team drops back to 4, I just set the value to "0" so nothing changes.  Anyone got a possible solution for me?
1577052318
The Aaron
Roll20 Production Team
API Scripter
You could use TokenMod to just set all the tokens to have some percentage higher hit points, or add some base value across the board: !token-mod --set bar1|*1.2 !token-mod --set bar1|+8 bar1 will adjust the current and max values by the same amount.
The Aaron said: You could use TokenMod to just set all the tokens to have some percentage higher hit points, or add some base value across the board: !token-mod --set bar1|*1.2 !token-mod --set bar1|+8 bar1 will adjust the current and max values by the same amount. Hey you! Lovely to see your manning the front-lines of this site still!  Let me give it a try let you know how it went!  (trying now) I must say that this didn't work sorry!  I tried both functions to NPC's and PC's. In both cases neither caused any noticeable change. It looks like this is meant to be done in game chat-box as a function but wasn't quite the case so I'm trying it now in the game API section (trying now)  When trying to create a script out of it, it said: " SyntaxError: Unexpected identifier " Same with the other command.  So none of these have worked so far as an input command, a macro or a script. I don't fully understand what a TokenMod really is but I feel it must be covered through one of the steps I took.  Any advice?
1577137835
The Aaron
Roll20 Production Team
API Scripter
You'll need to install TokenMod in the API Scripts section.  Using the Script Library is the easiest way: Once you do that, you can run the commands above.  Be sure to pick the right bar. Before: After:
1577140811
GiGs
Pro
Sheet Author
API Scripter
It sounds like you might not have installed the script properly. Go to the API scripts page for your campaign, delete whatever you added there, and make sure you are on the tab named Script Library (it should be the only tab). Click in the droppdown and start typing tokenmod - when it appears, click on it to select it. Then scroll to the bottom of the page and click the Add Script button. Now you can enter your campaign, and use the commands Aaron posted above - with some tokens selected, just paste them into chat. or make them macros, and use when desired.
It's working now!  The problem was I didn't understand or appreciate what a TokenMod script was or where to find it.  I was thinking that it was a "Token modifier" which isn't untrue!  But yes all works now, pretty great stuff :D 
Thanks for the help :D I'll promptly be opening a new question!