I have a function on my sheet worker script that changes the attributes of a weapon when its uses reach 0 (essentially marking it unusable). Now, this script works perfectly fine when setting the value to 0 on the sheet itself. However, despite using the setWithWorker function, the uses attribute is set to 0, but the function does not activate. Furthermore, the setWithWorker does not respect the minimum & maximum values of the attribute field as dictated on the character sheet. ...Which is weird, because as I understand it, setWithWorker is supposed to be functionally the same thing as directly setting the values on the sheet. Have I overlooked something? Here is the relevant sheet workers code: on("change:repeating_weapons:uses", function(eventInfo) {
console.log(eventInfo.newValue);
if (eventInfo.newValue == "0" || eventInfo.newValue == 0){
console.log("Broken");
getAttrs(["repeating_weapons_WName"], function(v){
setAttrs({
"repeating_weapons_WRank": "UU",
"repeating_weapons_WName": "Broken " + v["repeating_weapons_WName"]
});
});
}
}); And the API script code: UsesA.setWithWorker({current: Number(UsesA.get("current")) - 1}); log(UsesA.get("current"))