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 .
×

Operate On Bar Values?

Hi, I'm trying to make a macro, using both Tokenmod and ChatSetAttr, to add a sort of second health bar to a token, which is then visually shown to the players via Aura/Tint Health Colors. Its homebrew rules for 5e I'm tinkering with. The idea is that the first hit die maximum is their real health, and then everything after that is a sort of portable force-field like Mass Effect or Dune. I have a macro that adds the attributes working fine, and for (N)PCs I have a macro that works for updating the values automatically. But for tokens that don't represent a character I'm running into a wall in how to macro out the process. If this requires an additional API script, that's fine, even better if it doesn't. Here's the working macros I've already made. HealthCalcSetupChar !setattr --silent --sel --evaluate --health|%hp_max%|%hp_max% !setattr --silent --sel --shields|0|0 !token-mod --set bar1_link|health bar3_link|hp HealthCalcSetupMook !setattr --silent --sel --health|%hp_max%|%hp_max% !setattr --silent --sel --shields|0|0 !token-mod --set bar1_link|health bar3_link|hp !token-mod --set bar1_link| bar3_link| HealthCalcChar !setattr --silent --sel --evaluate --health|%hp% + %hp_temp% + %shields%|%hp_max% + %shields_max% !token-mod --set aura1_color|transparent HealthCalcMook is the idea I'm getting lost on. I'm already thinking the way I've got its Setup macro set up (heh) is impossible to work with in the way I want, but I'm not sure how to get there. Is it possible to operate on bar values in this way? If so, how? Also if you're curious, setting the aura to be transparent was to immediately update the aura value via Aura/Tint Health Colors, as it forces an aura on even if anything else turns it off. Any help is appreciated greatly.
I'm not sure how this forum feels about double posts but I figured it out and for the benefit of any who might want to figure out the same thing I shall post the updated macros. Feel free to lock or delete this thread if I'm doing something wrong. HealthCalcSetupChar !setattr --silent --sel --evaluate --health|%hp_max%|%hp_max% !setattr --silent --sel --shields|?{How many shieldpoints?|0}|?{How many shieldpoints?|0} !token-mod --set bar1_link|health bar2_link|shields bar3_link|hp !token-mod --set tooltip|"AC = ?{Is NPC?|Yes,@{selected|npc_AC}|No,@{selected|AC}}" HealthCalcSetupMook !setattr --silent --sel --health|%hp_max%|%hp_max% !setattr --silent --sel --shields|?{How many shieldpoints?|0}|?{How many shieldpoints?|0} !token-mod --set bar1_link|health bar2_link|shields bar3_link|hp !token-mod --set bar1_link| bar2_link| bar3_link| !token-mod --set tooltip|"AC = @{selected|npc_AC}" HealthCalcChar !setattr --silent --sel --evaluate --health|%hp% + %hp_temp% + %shields%|%hp_max% + %shields_max% !token-mod --set aura1_color|transparent HealthCalcMook !token-mod --set bar1_max|=0 !token-mod --set bar1_max|+@{selected|bar3|max} !token-mod --set bar1_max|+@{selected|bar2|max} !token-mod --set bar1_current|=0 !token-mod --set bar1_current|+@{selected|bar3} !token-mod --set bar1_current|+@{selected|bar2} !token-mod --set aura1_color|transparent