
I'm using a pretty straight-forward custom character sheet. If I change a token-linked attribute on the sheet itself, it will update the associated token bubble. But if I update the token bubble, it does not update the sheet. I've discovered that every now and then the token change WILL update the sheet, but not normally, not regularly, not consistently, which is obviously less than ideal. I suppose there could be a thousand possible reasons, but I thought I'd start with anything obvious, some syntax that must be complied with, etc. The token bubbles are assigned to attributes like so: Bubble 1 is tied to <input name="attr_current_health" class="ability_score" type="text"> Bubble 2 is tied to <input name="attr_defense_screen_points" type="number" style="text-align:center; font-size:16px; font-weight:bold; width:60px; border-left:1px solid black;"> Bubble 3 is tied to <input name="attr_defense_suit_points" type="number" style="text-align:center; font-size:16px; font-weight:bold; width:45px; border-left:1px solid black"> There are no scripts acting on these attributes except the attr_current_health_max, which gets calculated by a script like this (which for its part, it functioning as expected) // calculate stamina and max current health
on("change:sta_base change:sta_mod change:sta_xp sheet:opened", function() {
getAttrs(["sta_base","sta_mod","sta_xp"], function(values) {
let foo_sta_base = parseInt(values.sta_base)||0;
let foo_sta_mod = parseInt(values.sta_mod)||0;
let foo_sta_xp = parseInt (values.sta_xp)||0;
let foo_sta = foo_sta_base + foo_sta_mod + foo_sta_xp;
setAttrs({
sta: foo_sta,
current_health_max: foo_sta
});
});
});