
Hello, I'm trying to create a SheetWorkers to calculate ability scores for my customised DarkHeresy 1e character sheet (kinda based off the community one with some additional automation). And I'm running into some problems with my ability score code. My knowledge of javascript is honestly garbage and I'm just kinda copy/pasting the code and adapting it from another character sheet (one of the other pathfinder sheets, donno which one). I am getting an error when trying to execute the sheet. I was hoping someone could look at my code and tell me where I'm going wrong: var SetAbil = function(abil){ "use strict"; console.log("=== Set Ability Scores ==="); console.log("Setting "+abil+" . . ."); getAttrs([abil+'-base'], [abil+'-unnatural'], function(v) { console.log("GET " + abil+"-base: [" + v[abil+"-base"] + "] " + abil+"-unnatural [" + v[abil+"-unnatural"] + "]"); var stat = parseInt(v[abil+"-base"]) + parseInt(v[abil+"-unnatural-mod"]); console.log("SET the value of " +abil+ ": " +stat); var statMod = Math.floor(stat / 2) - 5 // Auto-calculated variable found in @{XXX}. This is not drawn from the character sheet. console.log("SET the value of " +abil+ "-mod: " +statMod); var unNatMod = Math.floor(parseInt(v[abil+"-unnatural-mod"]) * stat / 2); console.log("SET the value of " +unNatMod+ ": " +unNatMod); var finalMod = statMod + unNatMod; console.log("SET the value of " +finalMod+ ": " +finalMod); //console.log("Wounds Penalty: " +parseInt(v['condition-wounds'])+"."); ~RESERVED FOR FUTURE USE~ var update = {}; update[abil] = stat; update[abil+'-mod']= statMod; update[abil+'-unnatural-mod'] = unNatMod; update[abil+'-final-mod'] = chkCond1; /* ****************** CONDITIONALS ***************************************** */ /* ** WS (Weapon Skill) : NONE ** */ /* ** BS (Ballistics Skill) : NONE ** */ /* ** STR (Strength) : Fatigued/Exhausted ** */ /* ** TOU (Toughness) : Entangled, Grappled, Fatigued/Exhausted ** */ /* ** AGI (Agility) : NONE ** */ /* ** INT (Intelligence : NONE ** */ /* ** PER (Perception) : NONE ** */ /* ** WIL (Willpower) : NONE ** */ /* ** FEL (Fellowship) : NONE ** */ /* ** INF (Influence) : NONE ** */ /* ****************** CONDITIONALS ***************************************** */ setAttrs(update); }); // }; on('change:ws-base ', _.bind(SetAbil,{},'ws')); on('change:bs-base ', _.bind(SetAbil,{},'bs')); on('change:tou-base ', _.bind(SetAbil,{},'tou')); on('change:agi-base ', _.bind(SetAbil,{},'agi')); on('change:int-base ', _.bind(SetAbil,{},'int')); on('change:wp-base ', _.bind(SetAbil,{},'wp')); on('change:fel-base ', _.bind(SetAbil,{},'fel')); on('change:inf-base ', _.bind(SetAbil,{},'inf')); with the html hidden fields: <input type="hidden" name="attr_ws-unnatural-mod" value="" title="Unnatural Weapon Skill Modifier" readonly /> <input type="hidden" name="attr_ws-mod" value="" title="Weapon Skill Modifier" readonly /> <input type="hidden" name="attr_ws-mod-final" value="" title="(@{ws-mod-final}) Final Modifier" readonly /> The console log output is: === Set Ability Scores === VM4:5 Setting ws . . . sheetsandboxworker.js:763 TypeError: workerGlobals.waitingAttrRequests[reqid] is not a function at fullfillAttrReq (sheetsandboxworker.js:54:1) at messageHandler (sheetsandboxworker.js:741:1) sheetsandboxworker.js:764 TypeError: workerGlobals.waitingAttrRequests[reqid] is not a function at fullfillAttrReq (sheetsandboxworker.js:54:1) at messageHandler (sheetsandboxworker.js:741:1) Thanks again in advance.