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

Token Icon / Status Overlay Indicator use in macro?

Hi, everyone--not sure if this is a general macro question or a full-fledged API question. I'm currently using the little icons that you can put on tokens (the flag, the broken shield, the target, etc.) to represent some conditions or bonuses that characters can put on enemies/allies (vulnerable, weakened, etc.) I use TheAaron's excellent "tokenmod" to make it easier to assign those to tokens reliably. However, I was wondering if there was a way to have a macro check a given token for one of those properties--i.e. pull the value or the on/off setting of one of those items. Is that possible using the @{target|...} and/or @selected{...} sort of thing, at all, or some other method? What I'm thinking of doing is having conditions that would cause effects on rolls be able to be automatically included. That is, if Weakness causes a character to suffer -4 to attack, then if that marker goes on, the token has -4 to attack. I'm pretty sure that I can figure out the way to use general macro code and the Powercards stuff to make that work... if it's possible to even pull the data I'm looking for, which is the part I can't determine. Thank you!
Sorry; the macro system can't make any changes to values or status' with the sole exception of the turn tracker. You'll need to leverage the API to make those changes.
1439573860

Edited 1439574333
Sorry, I think I was unclear. I don't want to change the values--I want to read the values. I know how I can use TokenMod to handle setting the values, and PowerCards and general macros to handle displaying the proper thing based on the value. I just don't know how to tell Roll20 "tell me if this token has the broken shield icon set on it." As an example of what I want to do...say you have a character attribute called "Vulnerable." In your system (in this case, 13th Age), a character with Vulnerable set is more prone to being critically hit, represented by a 2 point expansion in an attacker's crit range. If I were doing that with a character sheet, what I would do is have Vulnerable equal to 1 for Yes and 0 for No. Then, in a macro, I'd have something like Crit At: [[20-[[(@{target|Target1|Vulnerable}*2)]] to tell me what number the natural roll has to be to crit. (Using PowerCards i can do more than that, but let's keep that simple). If Vulnerable is No (0), then it works out to 20. If Vulnerable is Yes (1), it works out to 18. What I want to do is instead of using a character attribute, use a token status marker. This would prevent having to duplicate characters in the journal. So, for instance...I know this isn't right, because I've tried something like it, but: Crit At: [[20-[[(@{target|Target1|broken-shield}*2)]] Presumably, if "broken-shield" were to pull 1 if the token had that marker on it and 0 if it did not, it would work out the same way as using Vulnerable as a character attribute...except that it would apply at the token level rather than the character level.
1439574375
Silvyre
Forum Champion
This question would be better received in the API subforum , or the tokenmod thread .
Didn't feel it was directly related to TokenMod and didn't know if the API would be necessary, but...I'll check there, then.
1439575080
DK Heinrich
Marketplace Creator
Sheet Author
there is a conditions script floating around, not sure if its been updated since last api update. if I see the thread I will come back and link.
1439575223

Edited 1439594157
Indeed, reading status markers, the state of the token, it's location, etc  would be managed through the API. At current, I believe the macros system can only read the token ID, its name, and the value of the three bars.
1439582819
DK Heinrich
Marketplace Creator
Sheet Author
link to conditions script thread. not sure it will do what you need, but I think its the closest. 
Thank you, will take a look.
1439640644
Lithl
Pro
Sheet Author
API Scripter
Mark G. said: Indeed, reading status markers, the state of the token, it's location, etc  would be managed through the API. At current, I believe the macros system can only read the token ID, its name, and the value of the three bars. And, if the token is linked to a character sheet, the system can also read that character's name and any attributes of that character.
Yeah--the reason I'm looking to see if there are alternatives, though, is that that can become a problem if you, say, have four copies of Orc soldiers using the same character sheet, and only one of them should have a curse of Weakness on him. Obviously one option is to make extra character copies in the journal, but that gets messy. Being able to read token status markers would let the narrator use one sheet for each monster type for a clean journal but still be able to store a host of conditions and have them have their game effects. Obviously that's not possible now at least in base Roll20, unfortunately, but just wanted to explain my reasoning there.
1439665788
Ziechael
Forum Champion
Sheet Author
API Scripter
You could link the token to the sheet but have all of the bars unlinked so that you could track bonuses and penalties as well as hitpoints without affecting the core sheet? Bar 1 - defaulted to 0 but can easily change it to -2 when weakened for example Bar 2 - the weakened orc then gets inspired by an orcish bard so can set this to 1 to show the bonus Bar 3 - set as hitpoints then unlink to get the bar in place easily (or manually set the health token by token if desired). Then it could be as simple as having the attack macro set up as something like [[1d20 + 5 [combat bonus for token] + @{selected|bar1} + @{selected|bar2}]] to have a quickly adaptable macro that is unique for each token?