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

[Token] Reset Bar to Attribute Max

January 18 (11 years ago)
Tom
Plus
Sheet Author
How would I write a macro script to reset the value of a radial bar to the max of a linked Attribute in concert with an action.

Specifically, my characters have a stat called Avoidance, which is the target number of successes needed to hit them. Depending on the player's actions, this can fluctuate by a few points one way or another until their next turn. So what I'd like to do is tie a nested macro to an attack macro that resets the value of the bar to the default when executed.

I'm sure this can be done with the API, but can it be done through a macro? I know you can roll dice based on the Attribute max, but can you force the bar to reset from the current value?

Thanks.
January 18 (11 years ago)
No, it cannot be done with a macro.
more specifically, Macros can't modify attributes or token values. With the sole exception of the Turn Order tracker, they're strictly read-only.

If you have Mentor level access, you can write/use an API script in your game that can do what you want, as you mentioned.
January 19 (11 years ago)
Tom
Plus
Sheet Author
Right. I knew they couldn't modify attributes and bars in the traditional sense. But having a macro that says bar=2d6-1 is different from saying bar=attribute|max. It's fine that it can't. It's actually easier that way.