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

Using math within Attributes

1514220762
Mike W.
Pro
Sheet Author
I have what I hope is a simple question and yet I apologize if this has been addressed before. I am trying to do some math within an Attribute I have created on a character sheet and to have it up dynamically. Is this possible? The math references two existing Attributes that are imbedded into the character sheet. These are @(move) and @(CurrLoad). I created an Attribute named: Combat Move with the math of round(@{Move}+(@{Move}*(@{CurrLoad}*0.2))) in the Current field. I then link that Attribute to a Token Bubble of the attached Token, reattach the Token, and then place it on the VTT. Once placed, this value is calculated and all seems fine. However when I change the @(move) or the @(CurrLoad) values on the character sheet itself, the Combat Move value does not change. Is does not dynamically recalculate unless I do the following; Grab and place the Token again onto the VTT, in which case both the original token and the newly placed token values do change. Any help here would be greatly appreciated.
Do you see the @{CombatMove} attribute on the sheet? Does it update when you change @{Move} or @{CurrLoad}? My guess is that @{CombatMove} is not updating. If the attribute is properly linked to the token, the token should reflect it. Sheetworkers are more reliable for updating fields like this.
1514226149

Edited 1514226305
Mike W.
Pro
Sheet Author
There isn't a @(CombatMove) attribute on the sheet itself, it is one I added under Attributes as the sheet does not include it. I added the Attribute Combat Move and for the Current field I added the math of   r ound(@{Move}+(@{Move}*(@{CurrLoad}*0.2)))
1514230058
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Autocalc does not work in custom attributes, only in attributes created in the HTML of the sheet.
1514230884
Mike W.
Pro
Sheet Author
Thanks Scott. Is there any way to get it to recalculate or refresh using a macro or something?
1514242765
GiGs
Pro
Sheet Author
API Scripter
Standard macros cant alter values on a character. The only ways to do it are either using a Custom Character sheet (copy the one you are using, and make tweaks to it), or through an API script. Since youre a Pro user, either of those options are available to you. Both are a little trickier than making a simple macro. Are you the GM for the campaign?
1514244341

Edited 1514308583
Mike W.
Pro
Sheet Author
No I am not the GM and I wanted to make this as generic as possible, I wish there was a way to refresh the sheet. The only way I know is to grab and place it as a token on the VTT, that forces it to recalculate. So something does trigger that, I just wish I could use a macro to do that, sort of a refresh.
I too would like to know this too - if you can refresh the character sheet with a macro so those custom abilities will update.
1514344688
GiGs
Pro
Sheet Author
API Scripter
No, that's not possible, unfortunately
1514353423
Mike W.
Pro
Sheet Author
Thanks G G. Sad!!!
1514374742
Jakob
Sheet Author
API Scripter
You could have your GM install one of the scripts that can accomplish this, such as TokenMod.
1514378457
Mike W.
Pro
Sheet Author
Jakob, yeah I know but I actually need it for 3 different games and 2 of the GMs are using free accounts. I was hoping for something generic that would not require an API. Oh well, time to work on somethign else.