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

How to alter attributes with macros?

February 26 (7 years ago)

Edited February 26 (7 years ago)
In my custom game there are atleast 20 tokens on the map - 10 each side - battling each other. The main function of the tokens is to reduce the opponent tokens' health bar. Right now I am using macros to automatically calculate the damage and then I add the result to the health bar of the target. This process is extremely slow because I have to remove manually the HP of each target so I am wondering; is there a way that a macro can automatically alter a token's attributes? The main process would be: calculate damage -> announce it in chat -> add the result in the target's bar1. I guess something simillar to &{tracker:-}.If this is not possible then do you have any tip for me to hasten the manual process of reducing health bars of multiple targets?
February 26 (7 years ago)

Edited February 26 (7 years ago)
Arthur B
API Scripter
There are a couple of scripts that could do that, but you would need to upgrade to Pro to be able to use the API.

ChatSetAttr comes to my mind, or TokenMod (as long as you only want to change the attribute of the "bubbles").
February 26 (7 years ago)
GiGs
Pro
Sheet Author
API Scripter
Just to be absolutely clear: macros cannot alter attributes, they are read only. That means there's no way to automate applying damage to multiple targets at once, either.
If you want a way to alter attributes, token bars, etc., automatically, you need to be at the Pro level.
February 26 (7 years ago)
Jakob
Sheet Author
API Scripter

G G said:

Just to be absolutely clear: macros cannot alter attributes, they are read only. That means there's no way to automate applying damage to multiple targets at once, either.
If you want a way to alter attributes, token bars, etc., automatically, you need to be at the Pro level.

However, to be even clearer for the sake of OP, macros can trigger certain API scripts, which can change attributes (which is what Arthur was alluding to).
February 26 (7 years ago)
GiGs
Pro
Sheet Author
API Scripter
I'm not sure that makes things clearer, hehe. Arthur didn't explicitly state that at the free account level, macros couldnt do what he was needing. I just wanted to clarify that. 
February 26 (7 years ago)
Arthur B
API Scripter
Ok, to make it absolutely, absolutely clear:

Macros alone can't do what Tritalas wants to do: Changing the health attribute of his tokens. Macros can only read values (with the one exception of the tracker).

API scripts on the other hand can change attributes, but the game creator needs to have a Pro account to use them.
With the proper script in place one can create a macro that triggers a script, hands over values etc.. Which then is what the OP wanted: A macro to change health attributes of his tokens.