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

Accessing the MAX value of an attribute?

1377159080
Lithl
Pro
Sheet Author
API Scripter
Getting the current value of an attribute is trivial: @{Brian's Character|Health} Using API scripts, you can get the max with relative ease: findObjs({_type: "attribute", _characterid: briansCharacter.id, name: "Health"})[0].get("max"); Is there any way to get an attribute's max value without scripting it, though?
1377159530
Gauss
Forum Champion
Sorry, not that I am aware of. Could you describe what you need it for and so I could see if there is a workaround? - Gauss
1377179999
Lithl
Pro
Sheet Author
API Scripter
There wasn't anything specific I had in mind; I thought about it while messing around in my script-testing campaign. But, for the sake of argument, let's say using it as a means to post the current percentage of the attribute (health, for example). There are also a select few times in some d20 systems where you use the actual value of the attribute, rather than the modifier. (Our group has been using current value for attribute modifiers and max value for their actual value, so STR:4/18 for a character with 18 strength.) I suppose a workaround could be to have a separate attribute as the "max," but then you run into problems with linking attributes to a token's bars, so that isn't 100%.
1377204472

Edited 1377204516
creating a second attribute called STRMAX? edit: What kind of problems does that create?
1377207918
Lithl
Pro
Sheet Author
API Scripter
Emile l. said: creating a second attribute called STRMAX? edit: What kind of problems does that create? If you link a bar to an attribute, it's only linked to one attribute. If you have a second attribute to hold the max value, you no longer have a single attribute. Like I said, I thought about it when just messing around (and it is possible to get the max value via API), I don't actually have a need for it atm.