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

This has probably been asked before

Is it possible to update an Attribute or Token Bar directly from a Macro? In other words say I have a damage amount I want to apply to a Selected Token which would immediately update that Token's Health Bar (let's say bar1). Is this possible and if so what would be the Macro entry. @{selected|HPs} = @{selected|HPs} - ?{Modifier|0} How would I get the result of this to apply to the token automatically?
This is what the API is for. I doubt that we will ever extend to the rolling system to the point that it can modify values on tokens.
Alright, thanks for the quick response Riley.
No problem! Of course our understanding of these functions is always changing (I didn't think we'd be doing selected variables, either), so maybe a better statement would be: you can do this in the API right now, and it's not currently on the roadmap for the dice roller :-)
1380096555
Alex L.
Pro
Sheet Author
The problem with this sort of thing is it requires extensive permissioning, not to mention you then need basic if statements to make the best use of it. And as the real kicker you then need to think about what happens if someone runs the wrong macro,selects the wrong token or runs a macro more than once. As Riley has suggested before, there is a critical mass on macro systems when you get to a point where you may as well have just given people a API for an established scripting language (hence why mentors have been given a javascript API). If you are looking at going down the route of doing this sort of thing with the API then just pop over to the API forums (everyone tends to be very helpful) or you can give me a PM and I may be able to give you a hand depending on what you are trying to achieve.
I'm pretty happy with macros as they are now. I can get away with not using the API for a lot of stuff and don't have to pester my GM to upgrade or add something to a script, etc. The only thing I'd like as a GM myself, would be to run macros on every token selected instead of just the first one in the array of selected tokens.