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] Bar Maxxer

As mentioned here, often times after playing with a map I like to reset all the tokens so I can use it in the future (and I'd rather not use the transmorgrifier before and after every session for every map (especially when I can make changes/improvements) to duplicate the map first), the only thing that changes about their tokens is the position and their health. I can't imagine that a script for position would be at all simple or even possible without being more worth than it's worth, but the health I hope is quite simple and quick.

So my request is for a script that automates the health being put to max on a layer inside a map. Click a button, and all tokens on the layer you're on get their red (or whatever one you have) bar filled up.
June 27 (9 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter
You could certainly use Aaron's TokenMod script to achieve something like this (resetting health). By selecting a token and running a command like
 !token-mod --set bar2|@{selected|bar2|max} 
it would set the current tokens health (replace bar 2 with whatever bar you use) back to the max.

I haven't found a way to do it with many tokens with various healths yet as if you have a lot selected and run it the bar will be set according to the one token it sees as being 'selected' but this would be a problem with large numbers of the same type of creature with the same health.

I'm also expecting there to be a way to do it that i just haven't seen yet having had limited time to test my theory.

Hope that helps a bit at least?
June 27 (9 years ago)
Actually it wouldn't be difficult at all to write something like this. Just a simple loop through all the objects on the object layer. I'm at work or else I would give it a go.
So with the token mod you click on every token individually, since I use random HP all the tokens have their own HP (or only a few are a similar).

That would be awesome HoneyBadger, exactly what I'm imagining.
June 28 (9 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter
Yeah, i'm afraid that currently to use TokenMod in this way you'd need to do them one by one if they have different max HP's but with a button set up in your macro bar it would be a matter of seconds to do...

That being said, if HB throws a solution together i'd fully suggest going for that! In the mean time... ^^ ;)
June 28 (9 years ago)
It'll have to wait at least until tomorrow. This is my long weekend to work.
June 28 (9 years ago)
The Aaron
Pro
API Scripter
This is a good idea, I rolled it into TokenMod: https://github.com/shdwjk/Roll20API/blob/master/To...

!token-mod --set bar3_reset|
That will set bar3_value to whatever is in bar3_max.

Enjoy! =D
June 28 (9 years ago)

Edited June 28 (9 years ago)
Thanks, just to confirm. Is that on a layer basis, map basis, whatever I have selected, or individually?

Edit: Looked at the TokenMod thread and saw you've said it's whatever selected. Awesome!
June 28 (9 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter

The Aaron said:

This is a good idea, I rolled it into TokenMod: https://github.com/shdwjk/Roll20API/blob/master/To...

!token-mod --set bar3_reset|
That will set bar3_value to whatever is in bar3_max.

Enjoy! =D

Thanks for making my hack a useable function :)

Now all you gotta do is find a way to reset the position of his tokens with a single click now ;)
June 28 (9 years ago)
The Aaron
Pro
API Scripter
That would require a different script.. =D