
Hi all, One last question (I think) for my custom sheet. I have a variable that I call at a couple different places and that seems to have the intended value everywhere, except in one particular message. Not only does it not work, I'm quite convinced that it absolutely used to work just a few days ago, and I have no idea what I could possibly have changed that would affect it since then. It's a simple max hp variable. Here is what my HP display looks like: Pretty straightforward. The -/+ buttons obviously just increase or decrease the current value. When I use the + button's sheetworker contains a condition that uses the max value to cap the value. My problem is with this show button. Players in my team often display their HPs after they were modified both for transparency and so that other players know of their conditions (not really needed anymore now that I've manage to have it display properly on the health bar, but whatever). The values you see displayed in that table are those: < input type = "hidden" name = "attr_hp_bar" value = "0" /> < input type = "hidden" name = "attr_hp_bar_max" value = "0" /> < input type = "number" name = "attr_Current_HP_Display" value = "@{hp_bar}" disabled /> < input type = "number" name = "attr_Max_HP_HEALTH_Display" value = "@{Current_HP_Max}" disabled /> Here is the button's code: < button type = "roll" name = "roll_HPDisplay" value = "@{template} {{talent=Health}} {{talentdescription=Health: @{hp_bar} / @{hp_bar_max}}}" > < span data-i18n = "Show" > Show </ span > </ button > Here is the code for the sheetworker of the + button. // Heal HP on("clicked:heal_hp", function() { getAttrs( [ "hp_bar", "hp_bar_max" ], function(v) { let present_hp = parseFloat(v["hp_bar"]); let max_hp = parseFloat(v["hp_bar_max"]); let u = {}; if (present_hp < max_hp) { present_hp = present_hp + 1; } else { present_hp = max_hp; } u["hp_bar"] = present_hp; setAttrs(u); }); }); And here is the sheetworker I use to update the hp_bar_max value whenever the sheet is opened (I had to use that because I spent forever trying other ways of accessing the value of Current_HP_Max, and I think the fact that it is an auto-calc value makes it somehow unusable. Whenever I tried using Current_HP_Max, it simply wasn't being treated as a numerical value. So instead the workaround I found was to use separate hidden hp_bar and hp_bar_max attributes of which the value is not auto-calc but sheetworkers-calculated. Because hp_bar_max doesn't update often, I just created a worker that triggers when the sheet opens. I'll explain what that is relevant in a minute. Here's the code of that sheetworker: on("sheet:opened", function() { getAttrs([ "Initial_HP_Max", "Talent_HP_Max", "Advances_HP_Max", "Modifier_HP_Max" ], function(v) { let max_hp = Math.floor( parseFloat(v.Initial_HP_Max) + parseFloat(v.Talent_HP_Max) + parseFloat(v.Advances_HP_Max) + parseFloat(v.Modifier_HP_Max) ) let u = {}; u["hp_bar_max"] = max_hp setAttrs(u) }); }); Now, I say the hp_bar_max value works everywhere. Not entirely true. If in this line < input type = "number" name = "attr_Max_HP_HEALTH_Display" value = "@{Current_HP_Max}" disabled /> I use hp_bar_max instead of Current_HP_Max, I get a 0 displayed in the table too. However, I know hp_bar_max's value is not zero. I know this because 1- If I create a token from the sheet and display the hp bar with the hp_bar / hp_bar_max variables, the max value displayed is correct. 2- If I use the + button, current HPs value will indeed stop at the expected value for hp_bar_max And I know that the sheetworker responsible for updating hp_bar_max works because if I change my character's HP stats in the main stats table (the values used to calculate Current_HP_Max and hp_bar_max), close and then reopen the sheet, and then use the + buttons, current HPs will now be capped at the new correct value for hp_bar_max. Yet if I try to display hp_bar_max, either in the table (in lieu of Current_HP_Max) or if I hit the show button, what I get is 0. What am I missing?