
The idea I'm going for is that, in a repeating_psychicability section, I would pick a dropdown value that sends 0, 1, or 2, for which Stat to use to cast the ability. The sheetworker would read the input number, then copy respective values from elsewhere in the sheet (with names like @{wpTotal}) and write out to two hidden inputs that could be easily referenced in a roll button. Trouble is, I don't know the first thing about how repeating sections and their IDs differ from any other part of the sheet, and reading other threads didn't help my understanding of how these worked.
For reference, here's what I've cooked up so far, with some HTML:
<input class='hidden' type='text' name='attr_psy_ab_total_finder' readonly /> <input class='hidden' type='text' name='attr_psy_ab_unnat_finder' readonly /> <select name='attr_P_focus' class='psykana_ability_gs_c2 full_width bottomless'> <option value='0' selected='selected'>Willpower</option> <option value='1'>Perception</option> <option value='2'>Psyniscience</option> </select>
And some JS:
on('sheet:opened change:p_focus change:wptotal change:wp_unnat', function() { getAttrs([ 'p_focus', 'wptotal', 'wp_unnat' ], function(values) { var p_focus = parseInt(values['p_focus']) || 0; var wptotal = values.wptotal; var wp_unnat = parseInt(values['wp_unnat']) || 0; switch (p_focus) { case 0: setAttrs({ psy_ab_total_finder: wptotal, psy_ab_unnat.finder: wp_unnat }); break; } }); });
I understand that the sheetworker I'm using hasn't had any real adjustment for the fact I'm trying to read a repeating value like getSectionID, but the functions related to that only seem to get harder to read the more I look at them.
Any help would be greatly appreciated!