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] Automatic Status Markers

April 29 (12 years ago)
Eric D.
KS Backer

This script will automatically toggle status markers based on the value/max ratio in any of the three bars. Comments are included in the script for how to set it up.

https://gist.github.com/edalquist/5488958


April 30 (12 years ago)

Awesome script. Just had a fiddle around with it on a dev copy of my campaign and it works brilliantly. 

Huge thanks for the share!

April 30 (12 years ago)
Eric D.
KS Backer

Thanks :)

May 04 (12 years ago)

Eric, does an empty string, aka "", return as NaN?

May 05 (12 years ago)
Eric D.
KS Backer

Yes it does, would you like "" to resolve to 0 instead?

May 05 (12 years ago)

I was just curious for my own script. I had to put a check in to see if the token was set to (isdrawing, true). Otherwise my drawings were ending up bloodied and dead even though they don't have any hit points in any of their attributes or bars.

May 05 (12 years ago)
Alex L.
Pro
Sheet Author

drawings don't have the _subtype "token" do they?

edit: apparently so.

May 05 (12 years ago)
Eric D.
KS Backer

Interesting, I'll add that in as well. I'm actually going to give these a try in my real game on Tuesday. Next thing I'm going to try is movement trails.

Just curious, have been using this script fine with bar1, but attempting to get it to work with bar2 (I use spell points in my campaign) seems to crash the api with an unexpected token return.... I haven't managed to figure out the reason behind it. I have tried flat relplacing the barid, adding it in as another line in the existing array and several other variations of the same. Ran it was with all my other scripts in disabled mode so it was def this script (and by that I mean my failed attempt at recoding it) that was returning the unexpected error

ok

so got it working 

also managed to fix it so that the red icon replaces the brown one when its below a 1/4 life, instead of having both up at the same time. 

July 07 (12 years ago)
GManator
KS Backer

Instead of changing the various status dots, would it be possible to modify this script to pull specific cards from a deck and apply them to a players hand? We are using cards for wound status at the moment.

July 07 (12 years ago)
Alex L.
Pro
Sheet Author

GManator said:

Instead of changing the various status dots, would it be possible to modify this script to pull specific cards from a deck and apply them to a players hand? We are using cards for wound status at the moment.

not at this time no.


July 22 (12 years ago)
Mister Sinister
Sheet Author

Hi, I'm new to Roll20 and am setting up to run Trail of Cthulhu. Would it be possible to use this script to auto change status based on a current number rather than the bar ratio? In the ToC example players become seriously hurt at health -6, however I am unsure how to represent this as a ration due to varying starting Health. Thanks

I am interested in the answer to Isembard's question too, but also is there away to toggle a status marker with a player's macro? That way a macro could do everything from a spedicif D&D power. It would roll the attack and turn on an aura of a certain color and size. It's probably too hard, but it would be great if that can also be on a time limit, like for one round or until initiative is rerolled. Thanks!