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

Attribute over Attribute for Bar 1

May 25 (7 years ago)
Leon X.
Plus
Sheet Author
Hello!
I made a character sheet. In the sheet, I have a place for HP and HP Max. How do I make HP's value be ?/HP Max. The ultimate goal is to have it so I can just put use HP for bar one without typing in the denominator. 

Thanks~
May 25 (7 years ago)

Edited May 25 (7 years ago)
vÍnce
Pro
Sheet Author
If you create an attribute for hp ie attr_hp, make sure to append "_max" onto the name ie hp_max because token status bars will automatically use the "_max" version of the attribute to auto-fill the denominator.  Same goes for macros that use @{hp|max}.  If your using a different name for max ie attr_hp-max, attr_hpmax, attr_hp|max, etc. the token bars and macros including "|max" will not show a denominator.
May 25 (7 years ago)
GiGs
Pro
Sheet Author
API Scripter
You dont need two separate stats for HP and HP max.
Every attribute has two values: current, and max. Current is displayed by default, but Max is used by the token bars. By the way, If you look at the Attributes and Abilities tab, you can see every stat has a Current and Max score. They are both shown automatically there, but if you want both displayed on the character sheet, you need to set it up. 

So Vince's suggestion: create a box on the character sheet to display the max value, which allows it to be edited. If you have a stat cakked HP, you display the current value as normal with name='attr_HP', and the max would be shown  with 'name=attr_HP_max'.


May 25 (7 years ago)
DXWarlock
Sheet Author
API Scripter
An example of what they both are explaining:
<input type="number" name="attr_HP">
<input type="number" name="attr_HP_max">
It will set the attribute as:
May 25 (7 years ago)
vÍnce
Pro
Sheet Author

DXWarlock said:

An example of what they both are explaining:
<input type="number" name="attr_HP">
<input type="number" name="attr_HP_max">
It will set the attribute as:
Exactly. 
;-P

May 25 (7 years ago)
Leon X.
Plus
Sheet Author
Thanks, everyone! Problem Solved