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

Request for (hopefully) simple API: Auto-roll NPC token health

Hello, all. I GM a Stars Without Numbers game, and I often use vast quantities of NPCs. To keep it interesting and less of a numbers game, I usually roll health for every token individually, even though they share the same sheet. It's a time consuming process. I tried using MonsterHitDice but because of the way an SWN sheet is built, they don't play nice together and I lack the skill to make the necessary alterations. All hit dice are D8's, and the sheet has an attribute that determines how many hit dice an NPC has. I'll try to sum up what I need as logically as possible: When I drag an npc onto the map: If [attribute "npc"] = 1 Roll ([attribute "npc_hd"]d8) quietly Set result as both value and max value in bar 1 of the token Enable "see" permission for bar 1, disable "edit" permission That is all. I'd be forever grateful if someone could cook this up for me, or point me in the right direction. Much appreciated.
I personally would recommend checking out Tokenmod for this. I've used Tokenmod to write up a simple macro with the API call to auto roll and auto set a token's HP from the Rolled formula listed on the 5e D&amp;D NPC stat block. (Granted, I understand you're not DMing a 5e game, provided whatever stat block your NPC has, you should be able to reference that formula in the stats somewhere in your macro.) This would essentially set it so that all you need to do is have your token selected, then click your macro either in the bar or set as a token action to roll the macro and set the HP from the formula that's set in the statblock. Link to the script:&nbsp; <a href="https://app.roll20.net/forum/post/1257490/script-tokenmod-an-interface-to-adjusting-properties-of-a-token-from-a-macro-or-the-chat-area" rel="nofollow">https://app.roll20.net/forum/post/1257490/script-tokenmod-an-interface-to-adjusting-properties-of-a-token-from-a-macro-or-the-chat-area</a> Hope this helps!
1611694204
The Aaron
Roll20 Production Team
API Scripter
TokenMod can certainly work for a manual method.&nbsp; I'll see about extending MonsterHitDice with an option to specify a die size or perhaps a formula.
1611743970

Edited 1611744180
Thanks for the tips, both! And for being willing to implement my request into your API :)&nbsp; Still though, should that magic little API suddenly appear...