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

Looking for a solution/feedback on an API script I'm looking to have made.

1646996401

Edited 1646996464
I'm currently running a 5e game where we're using a homebrew rule that when any creature is below 50% hit points, they are subjected to a wounded condition, which holds a few effects. This is obviously not too difficult to track, but I had the idea of perhaps helping tracking it with an API, or any other solution really. What I'm looking for is to have a clear indication on a token when a creature is below the 50% hp threshold. First off I'd like to ask anyone knowledgeable: Would there be a simple solution for this? Could TokenMod perhaps accomplish this somehow? And then as for my own idea: I know character sheets have the "hp" attribute, which when assigned to one of the three bars can be shown to everyone. Would there be a way perhaps to make an attribute like "hp_wounded", which would automatically calculate and show in the current and max fields "half of the full hp" / "full hp", assign that to a differently colored bar, and then have that appear instead of the normal "hp" bar when a creature falls below 50%? I have no idea if this is a long shot or not, but I'd be interested to hear any solutions or feedback.
1647000656
Andrew R.
Pro
Sheet Author
It’s certainly doable. The 13th Age Character Sheet Companion script will automatically mark tokens with a “bloodied” marker when it drops to 50% HP or below, and with the “dead” marker when it drops to 0 HP or below. I don’t use this functionality, but it’s there. 
I've actually wished to have a better safer way to mod max hps for the cases where monsters temporarily adjust them and the aid spell.  I thought of using the tooltip as a way to track things but the tooltip is still a buggy feature that doesn't really behave well for live play for me yet.  The Health auras api does stuff related to the health% of a token but I'm no script writer.  I'd imagine though that some of the nuts and bolts of that script would be useful references.  
1647013311
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
This script (by the Aaron) handles the "bloodied" condition by putting a token marker on creatures at or below half HP. It also handles Temp HP by subtracting from those first, but it should do what you want it to do. <a href="https://github.com/shdwjk/Roll20API/blob/master/TempHPAndStatus/TempHPAndStatus.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/TempHPAndStatus/TempHPAndStatus.js</a> You'll have to edit the bar assignment (line 10) and token assignments near the top (lines 13-15) with their full names, which you can get by installing token mod and looking in the help handout.
Thanks for the recommendations, I think I'll be able to find a good solution between all of these.