Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Changing character sheet formula does break function

I downloaded a sheet from the github and wanted to change some simple formulas. The pure HTML part looks like this: <th> <input type="radio" class="sheet-normal sheet-zero" name="attr_Strength" value="0" checked="checked" /><span></span> <input type="radio" class="sheet-normal" name="attr_Strength" value="1" /><span></span> <input type="radio" class="sheet-normal" name="attr_Strength" value="2" /><span></span> <input type="radio" class="sheet-normal" name="attr_Strength" value="3" /><span></span> <input type="radio" class="sheet-normal" name="attr_Strength" value="4" /><span></span> <input type="radio" class="sheet-normal" name="attr_Strength" value="5" /><span></span> <input type="radio" class="sheet-normal" name="attr_Strength" value="6" /><span></span> <input type="radio" class="sheet-normal" name="attr_Strength" value="7" /><span></span> <input type="radio" class="sheet-normal" name="attr_Strength" value="8" /><span></span> <input type="radio" class="sheet-normal" name="attr_Strength" value="9" /><span></span> <input type="radio" class="sheet-normal" name="attr_Strength" value="10" /><span></span> </th> <th> <input type="radio" class="sheet-square sheet-squarezero" name="attr_Strength_box" value="0" checked="checked" /><span></span> <input type="radio" class="sheet-square" name="attr_Strength_box" value="1" /><span></span> <input type="radio" class="sheet-square" name="attr_Strength_box" value="2" /><span></span> <input type="radio" class="sheet-square" name="attr_Strength_box" value="4" /><span></span> <input type="radio" class="sheet-square" name="attr_Strength_box" value="7" /><span></span> <input type="radio" class="sheet-square" name="attr_Strength_box" value="11" /><span></span> <input type="radio" class="sheet-square" name="attr_Strength_box" value="16" /><span></span> <input type="radio" class="sheet-square" name="attr_Strength_box" value="22" /><span></span> <input type="radio" class="sheet-square" name="attr_Strength_box" value="29" /><span></span> <input type="radio" class="sheet-square" name="attr_Strength_box" value="37" /><span></span> <input type="radio" class="sheet-square" name="attr_Strength_box" value="46" /><span></span> </th> <tr> <td>Jump</td>     <td><input type="number" class="sheet-textbox" name="attr_Jump_base" value="0" /></td>     <td><input type="number" class="sheet-textbox" name="attr_Jump_mod" value="0" /></td>     <td><input type="number" class="sheet-textbox" name="attr_Jump_multi" value="1" /></td>     <td><input type="number" class="sheet-textbox2" name="attr_Jump_up_total" value="0" /></td>     <td><input type="number" class="sheet-textbox2" name="attr_Jump_over_total" value="0" /></td> </tr> And the corresponding functions in the javascript part look like this: //Jump on("change:Strength change:Athletics change:Jump_mod change:Jump_multi sheet:opened", function() { getAttrs(['Strength', 'Athletics', 'Jump_mod', 'Jump_multi'], function(values) { setAttrs({ Jump_base: (+values.Strength + +values.Athletics) * +values.Jump_multi, Jump_up_total: (+values.Strength + +values.Athletics + +values.Jump_mod) * +values.Jump_multi, Jump_over_total: ((+values.Strength + +values.Athletics + +values.Jump_mod) * +values.Jump_multi) * 2 }); }); }); So far so good, but there is a calculated attribute that corresponds to the Jump_base. So I tried to change the function to the following: Jump_base: (+values.Strength + +values.Athletics + +values.Strength_box) * +values.Jump_multi, But when I check this in the input field attr_Jump_base stays empty. There is no error message and no 0 inside, just empty. I also tried values.Strength_box, without the + (for what shall that be at all?). Has someone an idea what it could be?
1605881007
Richard T.
Pro
Marketplace Creator
Sheet Author
Compendium Curator
Did you add strength_box to the getAttrs function?
Yeah, erm... no... ok, now it works... Thank you very much :)
1609049994
GiGs
Pro
Sheet Author
API Scripter
I'm coming to this thread a little bit late, but in addition to adding the attribute to getAttrs, you'll need to add it to the change line. You should chenga eeverything on that line (and only that line) to lower case, to avoid issues, like so: on("change:strength change:strength_box change:athletics change:jump_mod change:jump_multi sheet:opened", function() {