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 .
×
Cloudflare is experiencing elevated issues across all platforms. Load times for pages and images may be longer than expected. We are continuing to monitor the situation.

Help with NPC resource tracking

I'm trying to use ChatSetAttr in order to track NPC resources in a DnD 5e campaing. Namely, right now, I am trying to track the number of heads that a hydra has. I've pulled the hydra sheet from the compendium, and have added a "heads" attribute into its sheet and set the value to five, and one of the circles above the token is supposed to display how many heads the hydra has. I would like to create a token macro, which will either decrease the "heads" value by one every time a head is destroyed, and increase the "heads" value by two every time the heads regenerate, ideally as a prompt box which will ask if I am removing or adding a head. I'm not very competent at writing code or whatever; I've been able to decipher how some other macros work and adjust them to do different things, but I'm just not able to get it to work. So it's not really just about tracking the heads of this hydra for this one encounter; if I can get some help figuring this out, then I will likely be able to copy and adjust this macro for tracking other resources of other NPCs.
1686239180
timmaugh
Forum Champion
API Scripter
Hey, Anthony... try this: !modattr --sel --heads|?{Head action|Destroy,-1|Regenerate,2} That would require the Hydra to be selected, and it assumes the attribute on the Hydra sheet is called "heads." You can adjust both of those assumptions as necessary
That is exactly  what I was looking for. Thank you so much!