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

Calculating a New Attribute Max

March 11 (1 year ago)
Taz
Pro

Hi

I am adding a new attribute to my Everyday Heroes characters... Sanity. I have decided to calculate the Max Sanity as (Int + Wis + Cha) * 1.666 as this would, for straight 20's (the max I allow attributes to reach), result in a Sanity of 100. So, can someone help me with how I would add this as a formula to the Sanity max field on the Attributes and Abilities tab for the character so it will not need to be manually updated if the player ups one of those stats?  I need it to be (Int + Wis + Cha) * 1.6666 with a max of 99.

Many Thanks!

March 11 (1 year ago)
GiGs
Pro
Sheet Author
API Scripter

You would need to manually add this to every character. Are you editing the character sheet code, or just editing individual character sheets?

If editing the character sheet code, you can make this a sheet worker that gets calculated automatically for every character in your game, but if the sheet is still be updated, you wont see those updates.

March 11 (1 year ago)
Taz
Pro


GiGs said:

You would need to manually add this to every character. Are you editing the character sheet code, or just editing individual character sheets?

If editing the character sheet code, you can make this a sheet worker that gets calculated automatically for every character in your game, but if the sheet is still be updated, you wont see those updates.

Hey GiGs, I have added this to every PC sheet manually - not playing in the character sheet code. I was just wondering if it's possible to put a formula in the "max" entry of the custom attribute?

March 11 (1 year ago)
Gauss
Forum Champion

Hi Taz, 

Yes, you can put formulas into attributes, including the max section of an attribute. However, that formula doesn't display as a number unless it is part of a calculation somewhere. 

So, the question becomes, what are you doing with the formula? 

March 11 (1 year ago)

Edited March 11 (1 year ago)
Taz
Pro


Gauss said:

Hi Taz, 

Yes, you can put formulas into attributes, including the max section of an attribute. However, that formula doesn't display as a number unless it is part of a calculation somewhere. 

So, the question becomes, what are you doing with the formula? 

Hey Gauss - I'm using the calculates attribute to populate Bar 3 on the character token - then have a macro to reduce (or increase) it as the PC loses or (rarely) recovers Sanity. the point of the formula in the attribute was to calculate the Max Sanity a PC has - so, when they boost one of the key stats (at an appropriate level up - this is a 5E based system), the Max Sanity automatically recalculates.

March 11 (1 year ago)

Edited March 11 (1 year ago)
Gauss
Forum Champion

Alright, you cannot use a formula to populate a bar without an intermediate step such as something in the back end of a character sheet or via a Mod (API Script). 

My suggestion is to use a Mod (API Script) that pushes the value to another attribute, and then Bar 3 uses that attribute. 
ChatSetAttr can do that, but it is manually fired. I don't know which API Script can listen for changes in value and push the change. I'd ask the Mods (API Scripts) forum. 

Put another way: 
Attribute name: SanityCalc
SanityCalc box: contains the formula

Then you have another attribute named Sanity.
The API Script pushes the calculated result of SanityCalc into Sanity's maximum box. 

Then on the token, Bar3's attribute is Sanity. 

March 11 (1 year ago)
Taz
Pro


Gauss said:

Alright, you cannot use a formula to populate a bar without an intermediate step such as something in the back end of a character sheet or via a Mod (API Script). 

My suggestion is to use a Mod (API Script) that pushes the value to another attribute, and then Bar 3 uses that attribute. 
ChatSetAttr can do that, but it is manually fired. I don't know which API Script can listen for changes in value and push the change. I'd ask the Mods (API Scripts) forum. 

Put another way: 
Attribute name: SanityCalc
SanityCalc box: contains the formula

Then you have another attribute named Sanity.
The API Script pushes the calculated result of SanityCalc into Sanity's maximum box. 

Then on the token, Bar3's attribute is Sanity. 


Thanks Gauss - It was an outside chance in the first place and not worth that level of effort. Thanks for thinking it through though!