
I am updating an older style character sheet for Dark Heresy 1e so that it uses more modern character building techniques, CSE, Sheetworkers etc. This process is proving to be slow, as I need to do so while I run a game with the same sheet. What complicates this is my limited experience with JS and sheet workers is limited in scope to basic logic, numeric arithmetic and overall have just enough knowledge to be dangerous. I have built a sheetworkers for a d20 system character sheet years ago, but a lot of the code has changed since then. And when trying to current sheet over I've used my old sheet as an example, however, examanining the forums I've noticed none of them seem to have similar code. The basic code is as shown below: /* Repeating Weapons Parsing -- Both Global and Local (Excluding ROW ID OUTPUT Display) */ const calcWeaponDamage = function (prefix) { const sourceAttrs = [prefix+"_atkName"]; getAttrs(sourceAttrs, function (v) { wNameLabelText = v[prefix+'_atkName'] console.log("Name of Weapon " +wNameLabelText+ "."); setAttrs({ // [prefix+"_wepEnh"]: wepEnh, }); }); }; on('change:repeating_weapon change:ws-base change:ws-unnatural change:bs-base change:bs-unnatural change:str-base change:str-unnatural change:tou-base change:tou-unnatural change:agi-base change:agi-unnatural', function () { // Make sure all of the attributes are properly checked, the fewer the better for efficiency for weapon rolls. getSectionIDs('repeating_weapon', function (ids) { ids.forEach(id => calcWeaponDamage('repeating_weapon_'+id)); }); }); Is this code obsolete? Is it not correct to use anymore and is there better code to use to mesh with the new features? My desire for coding style is to have a balance between as succinct and combat as possible and also not having over complicated weird code that only those with 20+ years of coding can decipher. So while I want compact code I will do everything I can to avoid overcomplications ... To complicate matters I am using ScriptCards NOT rolltemplates because the nature of Dark Heresy is that the combat rolls can be highly conditional in their nature and roll template does not allow for easy conditional outputs without code that is... extensive. Up until now I've been using the ScriptCards for extensive checking what sort of conditions are active on weapons at any given time and altering the final numbers based on that. My goal is to take alot of the logic out of the ScriptCards and and making it the final number is sent back to the character sheet so that the scriptCards only needs to use that number. That way token drag and drop token action buttons can be used. (For some reason token action butttons often break when I've used ScriptCards, and when I'ved asked why... I've not gotten a full explanation. Beyond "ScriptCards cant use AutoCalc values that include math." Which really doesnt help me build a solution to the problem) So below is the a picture of the repeating section for the weapons on my sheet. The 0-25 buttons at the top were designed so I could create "template character sheets" and under the attributes and abilities tab of each sheet you can have weapons #0 - #n and in those have @{selected|repeating_weapon_0_wRoll} and be able to check either show as macro bar or show as token action and it will function just as well as opening the character sheet and pressing the roll button within the repeating section which is a pain in the neck as a GM running larger encounters. Unfortunately, it doesnt really work with ScriptCards EXCEPT on the Custom Sandbox, it works 99% of the time on the sandbox. Anyways, its my hope that doing the repeating sections with sheet workers will fix that problem. I want to thank you all in advance for the questions I'm going to ask here. For those who might want a copy of this character sheet's code I'd be happy to share with other Dark Heresy players. Especially, the person who maintains the Dark Heresy 1e character sheet, Accession sheet, Rogue Trader sheet and Deathwatch Sheet. As this is being designed to be compatible with all such..