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 .
×
This post has been closed. You can still view previous posts, but you can't post any new replies.

Access Status Marker values in macros

1403113849
The Aaron
Roll20 Production Team
API Scripter
It would be great if we could access the value of a status marker in a macro. That would let you give token specific benefits without needing to prompt constantly for a potential bonus. Something like: /r 1d20+@{selected_status|blue} While I can duplicate this functionality with an API script, it would be so much more useful if character sheets could take advantage of this directly.
1403118299
Lithl
Pro
Sheet Author
API Scripter
That's a pretty neat idea! A lot of people don't realize how to set the number on a statusmarker, though -- but that's an issue of training. If it's implemented, I do think that a statusmarker without a number on it should count as "1" while absence of a marker counts as "0"; that would let you use the markers as a flag in addition to using it as a simple number, eg /r 1d10 + @{selected_status|blue} * 1d6
1403120467
The Aaron
Roll20 Production Team
API Scripter
Ooh! Totally agree.. (adding that to my notes on a script to do just this...)
1403120912
The Aaron
Roll20 Production Team
API Scripter
Could have and extra qualifier: /r 1d10+@{selected_status|blue|on} * 1d6 Results in 1d10 + (1 * 1d6) for having the marker, 1d10 + (0 * 1d6) for not having it Then have: /r 1d10+@{selected_status|blue}d6 just using the value from 0-9.
1403122284

Edited 1403122299
I don't think the 'on' tag is necisary. if you want it to have a !blue functionality, then you could just make it: (1-@selected)status|blue})*d6 That way, if it's 'true' it becomes 0 and if it's 'false' it becomes 1.
1403122311
The Aaron
Roll20 Production Team
API Scripter
One thing to note is that status markers are specific to tokens and not characters, so it would have to be tied to the @{selected} token in the current sense, unless there was a way to introduce keeping the status markers at the character level similar to the way the bars can be tied to representing an attribute on the character.
1403122568
The Aaron
Roll20 Production Team
API Scripter
Epsilon, Brian is talking about the fact that turning on a status marker has the value of 0. What you've got would (ostensibly) be true if the marker was either missing or set with no value (0), but not if it was set with a value of 1-9. The best indicator of this relation ship is from the API docs: obj.get("status_red"); //Will return false if the marker is not active, true if it is, and a string (e.g. "2" or "5") if there is currently a badge set on the marker
1403123443
Lithl
Pro
Sheet Author
API Scripter
Aaron said: One thing to note is that status markers are specific to tokens and not characters, so it would have to be tied to the @{selected} token in the current sense, unless there was a way to introduce keeping the status markers at the character level similar to the way the bars can be tied to representing an attribute on the character. @{selected} is tied to tokens already, it simply lets you tunnel into the character that token represents, if there is one. @{selected|token_id} and @{selected|character_id} are both valid values, for example (assuming the token is representing a character).
1403125133
The Aaron
Roll20 Production Team
API Scripter
Yeah. I was just thinking about the possible confusion if you set a status on your character on one page (with the intent to use it in a macro), but then it isn't propagated to another. With @{selecterd...}, you're generally getting a value for a character or getting from something that could be backed by a character. (Like a bar) Since there is no way to have the statuses "represent" statuses on a character, this is a deviation from past conventions. A conceptually simple way of handling this would be to add represents as an option for status markers. I wonder if that automated status tracker API script has that problem.
1403152174
Lithl
Pro
Sheet Author
API Scripter
The status tracker script (at least, the one I use) simply updates whenever the token changes; that includes movement.
1403153656
The Aaron
Roll20 Production Team
API Scripter
Yeah, can't explain it... I think the ToFront() is being preempted by the set in the status script.
1403158056
The Aaron
Roll20 Production Team
API Scripter
Whoops. Totally thought you were replying to another post I made. Pardon my crazy. :)
+1
1403185232
The Aaron
Roll20 Production Team
API Scripter
It would also be most effective if you could set them to negative values as well as positive.