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

[Script] Aura/Tint HealthColor

DXWarlock said: 2. It wont work currently because you are over the threshold, if its set to show at below for example: 99%, anything over 99% means "off". So say 105% would be over the limit set to show any status. You want it to show over heal regardless? As in say its set to 70%. it wont show up until below 70, but if overhealed turn on and show it? 3. I will look into it, not sure whats causing that.   Regarding point 3, thanks! Regarding point 2, I guess my thought was if I have a token that has 100HP and the tint threshold is set to 50/50.  Below 50 health would obviously start turning the character yellow/red.  50-99HP, there would be no tinting.  101+ HP would be blue tinting.  Again not sure it is feasible, but that was my thought on how it should work. Kevin 
1491842604

Edited 1491842683
DXWarlock
Sheet Author
API Scripter
Ah no current the threshold is either 100% (basically always on) or a lower percentage that anything above that is not shown. I can change it, not that much work. Just not if it will have adverse affects for other people in the way they use it.  For example: They dont want players knowing how hurt something is until 50%. Players beat on it a while, its health never shows up so they have no idea if they are being effective or not. It gets healed and goes blue, they would know right away all the damage did was nullified, and then some.
1491843457
DXWarlock
Sheet Author
API Scripter
On the playlist issue, doesn't seem something I can change, its a limit of the Roll20 audio :\ (someone correct me if I'm wrong, I might be..or a way around it) Just using the audio interface itself: Playing any playlist, and playing a random sound upsets the playlist. Testing it I had a playlist playing. Clicked play on a random sound not in the playlist, and the playlist decided to stop and let the sound play.
I now that the Roll20 Audio Manager script by Scott has some fade in and fade out functionality... I will need to test that because I thought it didn't interrupt existing playlists, but it has been a while since I used it.
1492101249

Edited 1492101287
DXWarlock
Sheet Author
API Scripter
Its now on the Roll20 Script Library for dropdown install! Well it was before but always a version or 2 behind, as I had 3 places to edit (my game, my github, and the roll20 one), but now finally got it updated to match the current version [1.5.1]. On next Github update from roll20 for the scripts it will be available to pick in the dropdown.
1492118611

Edited 1492120235
So I briefly tested TINT, and it changed every single creatures TINT.  I didn't like it, turned it off and it left everything tinted.  Please tell me I don't have to manually undo 500+ tokens? Never mind reducing the PERCENTAGE where it appears and replying the effect turned them all off... Is there anyway to have this automatically apply the PRONE status?  Since downed PCs don't typically auto die it's far more likely they are proned. Another question though why doesn't the heal FX go off when life is readded does a + have to be used in order to achieve this FX?
1492120957

Edited 1492121089
DXWarlock
Sheet Author
API Scripter
Are you on 1.5.1? the aura/tint should toggle when you change to the other if the color it is matches the color it expects for the health level. I could add an option to pick which status gets applied on death, but then NPC would get prone also, would that be ok? If not you can just set "SHOW PC DEATH" to off, and it wont get the dead status. For the heal, it should trigger anytime the value goes up. It doesn't care about if + was used. It takes previous value and current value and if its positive do heal, if negative do damage. Does yours not do this?
1492135513

Edited 1492136495
No it only applies the heal fx when I add a + rather than the number just going up.  It's strangely not an issue with losing life. I could mess with it some more but it seems to be heavily delayed like the animation lags so maybe some conflict?  I'm using blood and honor which has a unique blood animation when a player hits 0.  I'm guessing that's part of it but doesnt make sense. Ya currently I have the PC DEATH OFF it'd be cool if there was a PC only proned option, since most PCs don't die outright.  There's no way to apply it to only PCs?  The death X makes sense on NPCs not so much on PCs. The tint thing I fixed by lowering the % where it shows up and then turning it back on, which removed the tint.  Then I turned the tint off and reset the %.  I was perplexed that turning it off didn't auto remove the tint and stressed when it did it to 521 tokens. Overall awesome script.
1492172032
DXWarlock
Sheet Author
API Scripter
Very strange, it has no way of knowing if you just changed the value, or used math to do it. It triggers off the attribute changing, not how it was changed. Is there anything else that could be interfering with it?
Not sure I'll try to mess with it and disable other scripts to see.
1496706840

Edited 1496707290
Thorsten
KS Backer
Can you think of a way of making Aura and Bump work better together, without requiring the use of Tint? Right now, aura sets auras to visible, so if a token gets bumped, the token is no longer visible to players, but the health aura applied to the slave token is. Could aura have a default - or a setting - to detect bump slave tokens and not apply to those? [Edit] In case that helps: Bump's slave tokens use a clear img which is, as of the current version, "<a href="https://s3.amazonaws.com/files.d20.io/images/4277467/iQYjFOsYC5JsuOPUCI9RGA/thumb.png?1401938659" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4277467/iQYjFOsYC5JsuOPUCI9RGA/thumb.png?1401938659</a>" for each slave.
1496708375
The Aaron
Pro
API Scripter
Thorsten B. said: Can you think of a way of making Aura and Bump work better together, without requiring the use of Tint? Right now, aura sets auras to visible, so if a token gets bumped, the token is no longer visible to players, but the health aura applied to the slave token is. Could aura have a default - or a setting - to detect bump slave tokens and not apply to those? [Edit] In case that helps: Bump's slave tokens use a clear img which is, as of the current version, " <a href="https://s3.amazonaws.com/files.d20.io/images/4277467/iQYjFOsYC5JsuOPUCI9RGA/thumb.png?1401938659" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/4277467/iQYjFOsYC5JsuOPUCI9RGA/thumb.png?1401938659</a> " for each slave. Add this on line 21 (right above //**CHECK BARS----------) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(obj.get('imgsrc').match(/files.d20.io\/images\/4277467\/iQYjFOsYC5JsuOPUCI9RGA\//)) return;
Thanks a ton, that did it!
1496713907
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks, Aaron. And thanks for spotting that, Thorsten. I don't think I would have noticed until the middle of a game in progress.
1496719179
The Aaron
Pro
API Scripter
Thorsten B. said: Thanks a ton, that did it! No worries! &nbsp;I had made the change in my local copy so easy enough to share it. :) Happy Rolling!
Is it possible to only have the script use 1 aura so that the other can still be used for other effects (such as spirit guardians and the like)
I love this idea! Pally aura will be happy.
1497378504
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
+1!
1497378869
The Aaron
Pro
API Scripter
The major issue is likely to be the additive nature of the auras. &nbsp;Who's got more health?:
Hmm.. in that case, is it possible to use the script for auto blood effect and marking X over dead tokens but not use auras?
Nevermind. Using tint works well :)
I guess the only other thing I would suggest is to make the tint colors adjustable. Instead of green at top health, I'd like to set it white/transparent and gradually turn red, then black and white when dead.
1497388334
Alicia
Sheet Author
Soul said: I guess the only other thing I would suggest is to make the tint colors adjustable. Instead of green at top health, I'd like to set it white/transparent and gradually turn red, then black and white when dead. You can set the minimum of when it starts to appear.. mine is set to 50%. Not home right now, but can send you a screenshot later of what the settings look like.
Trying to set Aura Size to zero disables the auras. Unfortunately, size zero looks best with square auras.
I use this script in a few games to quickly mark damage and healing with these two simple macros: !alter --target|@{selected|token_id} --bar|3 --amount|-?{Damage Taken|0} & !alter --target|@{selected|token_id} --bar|3 --amount|+?{Amount Healed|0} It's worked fine for months. Oddly, last week, one token would not adjust using the script properly. The number on the token would not change but the script thought it had sequenced. (The token still showed 60 hit points while the script reported back "0 damage taken."). During the course of the game I used the script on 37 other tokens, both before and after the odd one. Has anyone else every experienced this?
Can't say that I have and I wrote that script, lol.
I am having a weird interaction as of late with this and ApplyChange, It USED to work. but for some reason as of late when i press a button to deal damage to Bar1 it doesn't apply the effects or change the aura color or anything... any ideas?
Can someone help? The script worked fine a while ago, but now it seems to have broken. My API Sandbox is giving me these messages, and the script is just non-functional in the game, even though it was fine a while ago... Error: Firebase.update failed: First argument contains NaN in property 'current' Error: Firebase.update failed: First argument contains NaN in property 'current' at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:9:186) at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:207) at Aa (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:8:462) at Ea (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:403) at J.update (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:146:318) at TrackedObj._doSave (/home/node/d20-api-server/api.js:766:27) at Timeout.later [as _onTimeout] (/home/node/d20-api-server/node_modules/underscore/underscore.js:828:25) at ontimeout (timers.js:380:14) at tryOnTimeout (timers.js:244:5) at Timer.listOnTimeout (timers.js:214:5)
1506619815

Edited 1506620067
DXWarlock
Sheet Author
API Scripter
Sorry just saw these replies. Dont check the forum near as much now-a-days and I never get mails letting me know :) B14d3r11 That sounds like an issue with&nbsp;ApplyChange script perhaps? Or the way token updates are processed back end in roll20 (if that changed)? If changing the value manually works with it, I dont think it would be my script. As it simply triggers off a token update it doesn't know/care what updates it, it simply runs when roll20 sends out a 'ping' saying a token updated something on itself. Inkcharm I dont think that's my script throwing the error. I dont have any variables called " Ba, Ea " ect.&nbsp;
1506620699
The Aaron
Pro
API Scripter
Inkcharm said: Can someone help? The script worked fine a while ago, but now it seems to have broken. My API Sandbox is giving me these messages, and the script is just non-functional in the game, even though it was fine a while ago... Error: Firebase.update failed: First argument contains NaN in property 'current' Error: Firebase.update failed: First argument contains NaN in property 'current' at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:9:186) at Ba (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:207) at Aa (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:8:462) at Ea (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:10:403) at J.update (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:146:318) at TrackedObj._doSave (/home/node/d20-api-server/api.js:766:27) at Timeout.later [as _onTimeout] (/home/node/d20-api-server/node_modules/underscore/underscore.js:828:25) at ontimeout (timers.js:380:14) at tryOnTimeout (timers.js:244:5) at Timer.listOnTimeout (timers.js:214:5) DXWarlock said: Inkcharm I dont think that's my script throwing the error. I dont have any variables called " Ba, Ea " ect.&nbsp; That error occurs when a token has NaN set in one of it's bars. &nbsp;That usually happens when a script is making a calculation to store data there and ends up with NaN because of a type issue/assumption in the calculation.
1506984780

Edited 1506985032
Is it possible to have a heal SFX and hurt SFX with the visual FX?
1511577218
DK Heinrich
Marketplace Creator
Sheet Author
Is it possible to have the smaller aura (player/dice color) sit on top of the larger aura (health) so that the smaller one's color is not alterted? Is it possible to flip the math so that it is green at 0 and more red the larger it gets? Shadow of the Demon Lord adds damage (compared to a non-changing health score) instead of subtraciting hit points from a max number. Either as a toggle-able option would be very cool addition.&nbsp;
1512219671

Edited 1512219747
Jakob
Sheet Author
API Scripter
DK Heinrich you can probably just hack the script and invert the math on line 31 to achieve the second request: var percReal = 100 - Math.round((curValue / maxValue) * 100);
1512406262

Edited 1512407534
DK Heinrich
Marketplace Creator
Sheet Author
perfect, thanks Jakob.&nbsp; Ok, now I am hunting the 'X' on death line so I can remove it... then change the colors of the splatters and I should be good to go.&nbsp; EDIT: - the 'X' has a switch so its done, and color of splatters was easy. So all good.&nbsp;
is it possible to keep the FX of this API but remove the usage of Aura and Tint? I am using auras and tints for other purposes. I just want to use the blood spurt and healing visual fx.