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

Blood Splatter FX?

I was recently playing in a game and it had these effects that caused a little blood splatter effect whenever a token's HP was reduced and little green sparkles when it increased.  I know the script must be out there somewhere, but I am not finding it, and not sure I'd know how to implement it if did.  Can anyone offer any help and insight?
1607095340
The Aaron
Roll20 Production Team
API Scripter
It might be Aura HealthColors.  It could be something custom.  Easiest would be to ask the person running the game what script they used for it.  If nothing else, it wouldn't be too hard to write a script that does just that.
I tried that, but she had no idea, she just said it had done that automatically. I have the issue that I have zero scriptwriting ability so I have no idea how to implement anything beyond clicking the add to game button.
1607099466
The Aaron
Roll20 Production Team
API Scripter
No worries, I actually mean it would be pretty easy for someone in the community to write it for you. =D I'm pretty sure it was Aura Health, you might play around with that in a test game and see what you think.
1607107631
Gold
Forum Champion
you can put the Roll20 Special FX into a macro without it having an API. What you're looking for may have used an API, but it's not required to install an API just to put the Blood Splatter fx command-line into a Hit or Damage macro. the fx commands are documented in other threads & ummm maybe a wiki
1607114878

Edited 1607114963
Using Token Mod: !token-mod --set bar1_value|[[ {(@{selected|bar1}+[[?{Healing|0}]]),0}kh1 ]] --report all|"/em {name} takes ?{Healing|0} Healing.喝+" /fx glow-acid !token-mod --set bar1_value|[[ {(@{selected|bar1}-[[?{Damage|0}]]),0}kh1 ]] --report all|"/em {name} takes ?{Damage|0} Damage.喝-" /fx glow-blood
1607122361
Gold
Forum Champion
Hey, I didn't know about token-mod have a --report command. Writes things into chat? I will have to try that on my (otherwise similar) token-mod macro. That said, still, what I said above applies to that: /fx glow-acid This ^^ alone does not require token-mod or any API. al e. said: Using Token Mod: !token-mod --set bar1_value|[[ {(@{selected|bar1}+[[?{Healing|0}]]),0}kh1 ]] --report all|"/em {name} takes ?{Healing|0} Healing.喝+" /fx glow-acid !token-mod --set bar1_value|[[ {(@{selected|bar1}-[[?{Damage|0}]]),0}kh1 ]] --report all|"/em {name} takes ?{Damage|0} Damage.喝-" /fx glow-blood
I assume that in order to automate it though you need the API and hence, the pro subscription?
1607582573

Edited 1607683321
Werner D.
API Scripter
Here's a very basic script that will show the effects when bar_1's value changes. You can change which bar you use to check by changing the hpBarId value at the top of the script (1, 2 or 3). I tested this on my "script test game" where it was the only script running and it worked as expected... on my own actual game for some reason spawnFx functionality has stopped working (even if I disable all the other scripts... so no idea what's going on there). But here's the script, hope it helps (EDIT:  Added David M's check, to make sure it just runs on the current page) : var HitPointsChangeEffect = HitPointsChangeEffect || (function() { 'use strict'; const version = '1.0.0', hpBarId = 1, checkInstall = function() { log(`-=> HitPointsChangeEffect v${version} <=-`); }, handleToken = function(obj, prev) { const currentHP = obj.get(`bar${hpBarId}_value`); const prevHP = prev[`bar${hpBarId}_value`]; const playerPage = Campaign().get('playerpageid'); if (obj.get('pageid') === playerPage) { if (currentHP < prevHP) { log('took damage'); spawnFx(obj.get('left'), obj.get('top'), 'glow-blood'); } else if (currentHP > prevHP) { log('healed'); spawnFx(obj.get("left"), obj.get("top"), "burn-acid"); } } }, registerEventHandlers = function() { on(`change:graphic:bar${hpBarId}_value`, handleToken); }; return { CheckInstall: checkInstall, RegisterEventHandlers: registerEventHandlers }; })(); on('ready',function() { 'use strict'; HitPointsChangeEffect.CheckInstall(); HitPointsChangeEffect.RegisterEventHandlers(); });
1607606044
David M.
Pro
API Scripter
FYI, looks like when there are copies of character tokens on multiple maps, the script as written will spawnFX on the current map at each of the coordinates at which those copies exist. I tried it and blood erupted all over my map, haha! I might suggest a check for the player page ribbon in your handleToken function. Something like:     handleToken = function(obj, prev) { const currentHP = obj.get(`bar${hpBarId}_value`); const prevHP = prev[`bar${hpBarId}_value`]; const playerPage = Campaign().get('playerpageid'); if (obj.get('pageid') === playerPage) { if (currentHP < prevHP) { log('took damage - ' + obj.get('id')); spawnFx(obj.get('left'), obj.get('top'), 'glow-blood'); } else if (currentHP > prevHP) { log('healed'); spawnFx(obj.get("left"), obj.get("top"), "burn-acid"); } } }, Or better yet, also checking for player specific pages in case the party is split.
1607614603
Pat
Pro
API Scripter
I dunno - having fountains of blood erupt whenever anyone takes damage is a nice aesthetic - my vote is leave it as-is! 
1607625616

Edited 1607643178
It is part of the Aura/Tint HealthColor API by default: <a href="https://app.roll20.net/forum/post/2139713/script-aura-slash-tint-healthcolor/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/2139713/script-aura-slash-tint-healthcolor/?pagenum=1</a> They also have a death sound you program that is pretty cool but hidden in the settings. Great source for helpful tools: <a href="https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones" rel="nofollow">https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones</a>
Hmmmm, interesting @David M. I wonder if that is what might be causing my spawnFx no longer to work in my campaign, that it's doing it on all the pages and causing too many that it just doesn't show anywhere. Will add the check to anywhere that spawnFx is being used in other scripts and have a look.