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

Another silly question: What are the bubbles called?

So I'm trying to set up a macro where the players can tell the health of a token, in a relative way. I'm using Bar 1 for hit points, for what that's worth. I need to access the actual stats of the token itself, not the journal entry, because it needs to work on Mooks. I thought this would work: [[((@{target|Bar1})/(@{target|Bar1-max})*100)]] but it doesn't. Bar1 pulls up the proper info. Bar1_max, Bar1-max, etc. doesn't. What am I doing wrong? Anyone? I'm sure it's something super-simple but I couldn't find the answer, even though I know I've seen it before somewhere. Thanks. -Phnord
/w gm @{selected|bar1} HP of @{selected|bar1|max} I think if you drop the In line roll it should work.
Thanks al e. I knew it was something like that. So I tried using bar1|max but it gave me a weird error... [[((@{target|Bar1})/(@{target|Bar1|max})*100)]] % health. It asks me to choose a target: Bar 1 Then gives me the output SyntaxError: Expected "[" but "A" found. I hate to drop the inline roll part, because I want a percentage result instead of straight numbers. Anyone think of a way to make this work? -Phnord ps: Removing the inline brackets gives me this: It still asks for a target: Bar 1 No attribute was found for @{TARGET:Bar1|max} ((11)/(TARGET:Bar1|max|max)*100)
Ok, here's the workaround I found: Instead of Bar1|max, I pull the max HP value from the Pathfinder sheet, which is called HP_max. So my final formula looks like: [[((@{target|Bar1})/(@{target|HP_max})*100)]] Not a perfect solution, as in the cases where an individual Mook has a greater max HP than the generic ones, it'll give an odd result. But at least I get my percentage, which is what I was going for. I'd still like to know why the formula above didn't work. That... seems like something that should be fixed. Thanks anyway. -Phnord
1421782027

Edited 1421782036
The Aaron
Roll20 Production Team
API Scripter
Should be: [[ ((@{target|Choose|Bar1})/(@{target|Choose|Bar1|max}) * 100) ]] % health There are 3 syntaxes for @{target}: @{target|&lt;property name&gt;} -- For the clicked token, substitute the named property . @{target|&lt;label&gt;|&lt;property name&gt;} -- Ask for a token identified by label and for the clicked token, substitute the named property . @{target|&lt;label&gt;|&lt;property name&gt;|&lt;max&gt;} -- Ask for a token identified by label and for the clicked token, substitute the named property's max field. When you used @{target|Bar1|max}, it asked for the Label "Bar1" and then looked for the Property "max". You have to use a label if you want to use max. See: <a href="https://wiki.roll20.net/Macros#Using_a_Targeted_To" rel="nofollow">https://wiki.roll20.net/Macros#Using_a_Targeted_To</a>... The part under Advanced Usage .
Brilliant, The Aaron! I knew I'd seen that somewhere, thanks for the link. This works perfectly; the only downside is that a second click is required (for the 'choose' part). The final macro, for those who would like to use it, looks like this: @{target|token_name} seems to have [[ceil((@{target|choose|Bar1})/(@{target|choose|bar1|max})*100)]] % health. Orc 4 seems to have [45]% health! This divides the max HP of the token by the current HP, then rounds it up to the nearest whole number, and presents it as a percentage. The benefit of this is that the player can tell how damaged something is, without learning the exact number of hit points remaining (Much like the bar shows, but with a numerical value.) Thanks again, everyone. -Phnord
1421783464
The Aaron
Roll20 Production Team
API Scripter
If you use @{target|choose|token_name} , it will eliminate that other click. Basically, all @{target} that share the same label in a macro will only be clicked once, but different properties can be access anywhere across a macro, even a multi-line one. =D
First off, really cool, and nice macro work there. One thing though, the notion that the players wouldn't learn the exact number of HP on a target... can't they just mouse over the result in the chat window to see the data of the formula? Or is there something in this that suppresses that info that I am not understanding?
1421792639
Lithl
Pro
Sheet Author
API Scripter
No, you're correct; the player could see the exact numbers by hovering their mouse over the inline roll.
Hmm. You're right... hadn't thought of that! Oh well! Hope they don't either!!
Well, its ok... :) The marco is awesome...really clever, and a GM could easily use as a quick check for his/her own purposes. I am sure in the case of a Mentor too, you can somehow mask that in an api. Pass the result and just print it as a hard number rather than an expression. lol... you can see, I don't have api access, so I don't know what I am talking about there.
1421796525
The Aaron
Pro
API Scripter
It's ok, enterprising players can just do: /w myname @{target|choose|token_name} has @{target|choose|Bar1}/@{target|choose|bar1|max} hp
1421796971
Gen Kitty
Forum Champion
Yeah, it's part of the unwritten social contract that players don't cheat and try to get information which is thinly hidden from them. :/