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

Adding up several units Mana or Health bar

Hey hey! I'm being thorough and asking here if there is a possibility to (with a macro?) sum several units Mana points, or Health Points and display the result? I wish to simulate maintenance cost, and was going to use the Health or Mana bar to have the individual units maintenance cost, most units with a negative value, and some city tokens with a positive value. Is this already implemented in some way, or should I head to the API forum to start coding? :D
1444421553

Edited 1444482186
You would have to use the target feature but you will have a set number of targets per macro. The standard targeting system is pretty limited that way. So say that bar 1 is the Mana points and bar 2 is the Health points and you have 5 tokens representing your resources we would write a macro targeting 5 tokens and summing those bars up.  &{template:default} {{name=Resources (5) total}} {{Mana Total=[[@{target|target1|bar1} + @{target|target2|bar1} + @{target|target3|bar1} + @{target|target4|bar1} + @{target|target5|bar1}]]}} {{Health Total=[[@{target|target1|bar2} + @{target|target2|bar2} + @{target|target3|bar2} + @{target|target4|bar2} + @{target|target5|bar2}]]}} I added a space in the header for a second line there. Hope that helps. edit: removed the extra +'s 
Thanks Ed! That was pretty instructive,  there is an extra "+" sign at the end of each sum that would be nice if you could edit in your post for posterity :) Otherwise, this is more than what I was expecting macros to be capable of, but still less than what's asked of them by me :), I'll head over to the API forum in search of automatic selection of all tokens for this sum Cheers!
Aah, yes, copy past fever there