In my Heavy Gear 4e playtest game each skill comes from one of 20 domains, a broad area in which skills fall under, eg one of my players has "ambushes" skill in the Awareness domain, another has "Dirty Fighting" under the Melee domain. If a character has a certain amount of skill points in a domain they get bonuses like rerolls etc. I want to do some sheetworker script to update an attribute eg domain_expertise_athletics, to be the total skill levels in that domain. Ive tried messing around with repeatingSum but I cant seem to get things to work. This is the code for the repeating skills. <fieldset class="repeating_skills">
<div class="sheet-3colrow">
<div class="sheet-col">
<button type="roll" name="roll_skill"
value="/em uses @{domain_select} @{skill_name} @{skill_level} [[@{skill_level}d6>5]]"></button>
<input type="text" name="attr_skill_name" value="">
</div>
<div class="sheet-col">
<select name="attr_domain_select">
<option value="1" selected>Athletics</option>
<option value="2">Awareness</option>
<option value="3">Business </option>
<option value="4">Craft </option>
<option value="5">Culture </option>
<option value="6">Electronic Warfare</option>
<option value="7">Electronics </option>
<option value="8">Gunnery</option>
<option value="9">Hard Science </option>
<option value="10">Institutions </option>
<option value="11">Investigation </option>
<option value="12">Mechanics </option>
<option value="13"> Medicine </option>
<option value="14">Melee </option>
<option value="15">Influence </option>
<option value="16">Pilot </option>
<option value="17"> Showmanship </option>
<option value="18">Social Science </option>
<option value="19"> Survival </option>
<option value="20">Tactics </option>
</select>
</div>
<div class="sheet-col">
<input type="number" name="attr_skill_level" value=" " min="0" max="5">
<input type="checkbox" name="attr_skill_xp" value="1">
<input type="number" name="attr_skill_xp_stored" value="0">
</div>
</div>
</fieldset> I would imagine the code goes something like this <script type="text/worker">
const domains = ['athletics','awareness','business','craft','culture','electronicwarfare','electronics','gunnery','hardscience','institutions','investigation','mechanics','medicine','melee','influence','pilot','showmanship','socialscience','survival','tactics'];
on("change:repeating_skills sheet:opened",function(){
//make array expertise[]
//add repeating_skill_level to expertise[repeating_skill_domain_select]
setAttrs({
domains.forEach(domains => {
expertise[domains]: ["domain_expertise_" + domains]
});
});
}); Any help would be appreciated