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 .
×
Stuck in a login loop? Try manually signing out and back in before launching your game. Otherwise, contact the Help Center!
Create a free account

Attribute (MAX) having issues adding on Character Sheets / Bubbles

1473895790
Falcon
Pro
Sheet Author
I will post a longer thread with repeatable examples but I wanted to see if anyone else is having this issue: Attributes that are being added up such as @{XP-Class1|max}+@{XP-Class2|max}+@{XP-Class3|max} Will not add up UNLESS you get out of the character sheet and come back in.  I have found this problem on multiple character sheets. This is really frustrating around HP not updating.  I also see this problem on Token Bubbles.
1473896288
Tetsuo
Forum Champion
I've had this issue with a few of the buff bars. Idk what sheet you're using, but the pathfinder one has a recalc button that calculates all non editable fields and updates them.
1473897207
Falcon
Pro
Sheet Author
Interesting.  Will have to look into the code.  It's my own sheets
If you can give us a reproducible test case we'll certainly look into it. There are probably a lot of factors at play (like is it a sheet worker field, auto-calculated field, default field value..) that make it hard to know what might be going on without seeing some code that causes it to happen.
1473955755
Falcon
Pro
Sheet Author
I would have to give you my entire character sheet code.  Is there another way - such as giving you access to the campaign with the custom character sheet.  I only have this issue on a character sheet.  Let me see if I can create a small snippet of code on a new character sheet and test it out there. The error seems to come up when I have sheet worker doing some calcs and completely unrelated normal calculations using |max attribute.  For example [[(@{XP1|max}+@{XP2|max}+@{XP3|max})]]" Here is the code for the sheet workers: <div class="sheet-row"> <div class="sheet-col-5-16 sheet-center"><input class="sheet-underlined sheet-center" type="number" name="attr_gained_xp"/></div> <span class="sheet-col-5-16 sheet-center sheet-underlined" style="text-align:center;font-weight:bolder;font-size:100%" name="attr_total_xp_display"></span> <div class="sheet-col-5-14 sheet-center"><input class="sheet-center" style="font-weight:bolder;font-size:100%" type="text" name="attr_xp_total_needed" disabled value="[[(@{XP1|max}+@{XP2|max}+@{XP3|max})]]"/>Total Needed</div> </div>  The other issue I am having is that my Class CSS code isn't working with the INPUT of a sheet worker field.  Do I need to create a new CSS code specific to a readonly Input field? Picture below: As you can see above the sheetworker field is not affecting the XP1.2.3 variables.  Here is my sheetworker code: <script type="text/worker"> on('change:gained_xp', function() {     getAttrs(['gained_xp', 'total_xp_display'], function(values) {         var total_xp = parseInt((values.total_xp_display || '').toString().split(',').join('')) || 0;         total_xp += parseInt(values.gained_xp) || 0;         if (total_xp.toString().length >= 4) {             total_xp = total_xp.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');         }         setAttrs({             total_xp_display: total_xp,             gained_xp: ''         });     }); }); </script>
1474043281
Falcon
Pro
Sheet Author
Here is what it does.  As you can see from the token below the STA and SEU attributes are both not showing their |MAX value.  instead I have to go to each token and go to another attribute and then back to STA for them to show up correctly.  Do you know what is causing this?  The issue is that it forces the bars to disappear from the tokens when the MAX value isn't showing up?
1474043408
Falcon
Pro
Sheet Author
Here is the character sheet which is showing the max value for both.  (on the top row)
1474352766
Falcon
Pro
Sheet Author
I believe I may have fixed my issue.  Will report back.