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

Custom version of C&C sheet not showing calculated values

I have been using a slightly customized version of the C&C character sheet for a few years now, and it has been working well.  However, now when I drag a character to the map, and go to set the 2nd bar to the character's AC, it does not show any value.  HP, which is a standard input, still shows as normal, but not the AC which is a calculated value, code below.  Existing tokens are showing the value that they were last set at, but if you change the fields that are used in the calculation, they do not update.  I am not sure when this first started, I built my last map and populated it not that long ago, a couple of weeks probably.                 <td><input name="attr_AC" class="short" value="10+@{ArmorAC}+@{ShieldAC}+@{ModAC}+@{MagicAC}+@{MiscAC}"                   disabled="true" type="number">= 10 +</td> Anyone have any ideas, or did I miss a change in the requirements for calculated fields somewhere?
1586596257

Edited 1586599075
GiGs
Pro
Sheet Author
API Scripter
Autocalc attributes like that are unreliable in tokenbars. Though I think it should display. My recommendation would be to change that to a sheet worker. Change this line < td > < input type =" number " name =" attr_AC " class =" short " value =" 10+@{ArmorAC}+@{ShieldAC}+@{ModAC}+@{MagicAC}+@{MiscAC} " disabled =" true " />= 10 + </ td > to < td > < input type =" number " name =" attr_AC " class =" short " value =" " readonly /> </ td > And add this to the very end of the html sheet. <script type="text/worker">     const int = (n, error = 0) => parseInt(n) || error;     on('change:armorac change:shieldac change:modac change:magicac change:miscac', function(eventInfo) {           getAttrs(['ArmorAC',  'ShieldAC',  'ModAC',  'MagicAC',  'MiscAC'], function(v) {             setAttrs({                 AC: 10 + int(v.ArmorAC) + int(v.ShieldAC) + int(v.ModAC) + int(v.MagicAC) + int(v.MiscAC)             });         });     }); </script> That should generate your AC properly and work with the token bubble.