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

3.5 Max Hit Points

I am having some trouble with a macro. I am trying to pull the maximum Hit Points of a target, but it comes up with the message that no such attribute exists. If I put it as pulling from a selected token it works, just not from a targeted token. So the following works: [[(ceil(@{selected|hitpoints|max}/@{target|hitdie}))*(1d3)]] But this doesn't: [[(ceil(@{target|hitpoints|max}/@{target|hitdie}))*(1d3)]] Can anyone figure out why it works with selected tokens and not targeted tokens?
1553804146

Edited 1553804243
The syntax of target is slightly different:  @{target | < target_name > | < attribute_name > | < optional_flags > } Your roll should be like: [[(ceil(@{target|foo|hitpoints|max}/@{target|foo|hitdie}))*(1d3)]] More info on the Wiki .
Weird, but thanks
1553824180

Edited 1553824254
GiGs
Pro
Sheet Author
API Scripter
Weird. Target should work the same as selected, when you are only targeting a single token. You only need the token|foo| style syntax when targeting multiple tokens in the same macro. Note the first example of using target in the wiki page linked up (scroll up a bit to see it: @{target|strength}) doesn't use the target_name parameter. Maybe its needed when using the attribute|max syntax? Edit: ah it does say that on the page: Again, the "target" keyword is almost identical in usage to the "selected" keyword as outlined above in the ways it can be employed -   the two primary difference being that it allows players to utilize values from tokens they are not controlling and that the syntax is slightly different for referencing a "max" part of an attribute.