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 .
×
Create a free account

[Sheet Workers] Totaling Attributes and Syntax

So to start, here is the code, scroll down for a description of the actual problem. It's at the end of the code block anyway. &lt;div style="text-align: center"&gt; &lt;img class="details-image" src="<a href="http://synography.com/wp-content/uploads/2018/01/ctrgbanner-03-1024x182.png" rel="nofollow">http://synography.com/wp-content/uploads/2018/01/ctrgbanner-03-1024x182.png</a>" draggable="false" alt="" style="width: 75%; margin-top: 20px; margin-bottom: 15px;"&gt;&lt;br&gt; &lt;!-- Set up the Tabs --&gt; &lt;input type="radio" class="sheet-tab sheet-tab1" name="attr_core-tab" value="1" title="Core Info" checked="checked"/&gt;&nbsp; &lt;span class="sheet-tab sheet-tab1" style='line-height: 40px;'&gt;CORE INFO&lt;/span&gt; &lt;input type="radio" class="sheet-tab sheet-tab2" name="attr_core-tab" value="2" title="Abilities" /&gt;&nbsp; &lt;span class="sheet-tab sheet-tab2" style='line-height: 20px;'&gt;ABILITIES&nbsp; GEAR&lt;/span&gt; &lt;input type="radio" class="sheet-tab sheet-tab3" name="attr_core-tab" value="3" title="Weapons" /&gt;&nbsp; &lt;span class="sheet-tab sheet-tab3" style='line-height: 40px;'&gt;WEAPONS&lt;/span&gt; &lt;input type="radio" class="sheet-tab sheet-tab4" name="attr_core-tab" value="4" title="Health" /&gt;&nbsp; &lt;span class="sheet-tab sheet-tab4" style='line-height: 40px;'&gt;HEALTH&lt;/span&gt; &lt;input type="radio" class="sheet-tab sheet-tab5" name="attr_core-tab" value="5" title="Inventory" /&gt;&nbsp; &lt;span class="sheet-tab sheet-tab5" style='line-height: 40px;'&gt;INVENTORY&lt;/span&gt; &lt;input type="radio" class="sheet-tab sheet-tab6" name="attr_core-tab" value="6" title="Other" /&gt;&nbsp; &lt;span class="sheet-tab sheet-tab6" style='line-height: 40px;'&gt;OTHER&lt;/span&gt; &lt;input type="radio" class="sheet-tab sheet-tab99" name="attr_core-tab" value="99" title="All" /&gt; &lt;span class="sheet-tab sheet-tab99" style='line-height: 40px;'&gt;ALL&lt;/span&gt; &lt;!-- End Tab setup --&gt; &lt;div class="sheet-section-core"&gt;&lt;!-- Core Tab --&gt; &lt;!-- Stuff on the tab --&gt; &lt;h1&gt;Info & Stats&lt;/h1&gt; &lt;div class='sheet-2colrow'&gt; &nbsp; &lt;div class='sheet-col border'&gt; &lt;table style="text-align: left"&gt; &lt;tr&gt; &lt;td&gt;Character Level&lt;/td&gt;&nbsp; &lt;td&gt;&lt;input type="number" class="sheet-BigGear" name="attr_lvl" value="1" /&gt;&lt;/td&gt;&nbsp; &lt;br&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Player Name&lt;/td&gt; &lt;td&gt;&lt;input type="text" class="sheet-BigGear" name="attr_pname" value="" /&gt;&lt;/td&gt; &lt;br&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Character Name&lt;/td&gt; &lt;td&gt;&lt;input type="text" class="sheet-BigGear" name="attr_cname" value="" /&gt;&lt;/td&gt; &lt;br&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Callsign (Optional)&lt;/td&gt; &lt;td&gt;&lt;input type="text" class="sheet-BigGear" name="attr_nick" value="" /&gt;&lt;/td&gt; &lt;br&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Class &lt;/td&gt; &lt;td&gt;&lt;select class="sheet-select" name="attr_class" style="width: 170px"&gt; &lt;option value="enforcer"&gt;Enforcer&lt;/option&gt; &lt;option value="officer"&gt;Officer&lt;/option&gt; &lt;option value="soldier"&gt;Soldier&lt;/option&gt; &lt;option value="scput"&gt;Scout&lt;/option&gt; &lt;option value="infiltrator"&gt;Infiltrator&lt;/option&gt; &lt;option value="mspecialist"&gt;Specialist (Medic)&lt;/option&gt; &lt;option value="hspecialist"&gt;Specialist (Hacker)&lt;/option&gt; &lt;option value="dspecialist"&gt;Specialist (Demoman)&lt;/option&gt; &lt;/select&gt;&lt;/td&gt; &lt;br&gt; &lt;/tr&gt; &lt;/table&gt;&nbsp; &lt;/div&gt; &lt;div class='sheet-col border'&gt; &lt;table style="text-align: left"&gt; &lt;tr&gt; &lt;td&gt;Religion&lt;/td&gt; &lt;td&gt;&lt;input type="text" class="sheet-BigGear" name="attr_rel" value="" /&gt;&lt;/td&gt; &lt;br&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Age&lt;/td&gt; &lt;td&gt;&lt;input type="text" class="sheet-BigGear" name="attr_age" value="" /&gt;&lt;/td&gt; &lt;br&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Gender &lt;/td&gt; &lt;td&gt;&lt;select class="sheet-select" name="attr_gen"&gt; &lt;option value="m"&gt;Male&lt;/option&gt; &lt;option value="f"&gt;Female&lt;/option&gt; &lt;/select&gt;&lt;/td&gt; &lt;br&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Weight&lt;/td&gt; &lt;td&gt;&lt;input type="text" class="sheet-BigGear" name="attr_wei" value="" /&gt;&lt;/td&gt; &lt;br&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Height&lt;/td&gt; &lt;td&gt;&lt;input type="text" class="sheet-BigGear" name="attr_hei" value="" /&gt;&lt;/td&gt; &lt;br&gt; &lt;/tr&gt; &lt;/table&gt; &lt;br&gt; &lt;/div&gt; &lt;/div&gt; &lt;br&gt; &lt;div class='sheet-3colrow'&gt; &lt;div class='sheet-col'&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Strength &lt;/td&gt; &lt;td&gt;&lt;input type="number" class="sheet-BigGear" name="attr_str" value="10" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Constitution &lt;/td&gt; &lt;td&gt;&lt;input type="number" class="sheet-BigGear" name="attr_con" value="10" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;div class='sheet-col'&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Dexterity &lt;/td&gt; &lt;td&gt;&lt;input type="number" class="sheet-BigGear" name="attr_dex" value="10" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Intelligence &lt;/td&gt; &lt;td&gt;&lt;input type="number" class="sheet-BigGear" name="attr_int" value="10" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;div class='sheet-col'&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Wisdom &lt;/td&gt; &lt;td&gt;&lt;input type="number" class="sheet-BigGear" name="attr_wis" value="10" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Charisma &lt;/td&gt; &lt;td&gt;&lt;input type="number" class="sheet-BigGear" name="attr_cha" value="10" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;h1&gt;Inspiration&lt;/h1&gt; &lt;table class="sheet-tableII"&gt; &lt;td&gt;&lt;input type="checkbox" name="insp-1" value="1"/&gt;&lt;span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="checkbox" name="insp-2" value="1"/&gt;&lt;span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="checkbox" name="insp-3" value="1"/&gt;&lt;span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="checkbox" name="insp-4" value="1"/&gt;&lt;span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="checkbox" name="insp-5" value="1"/&gt;&lt;span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="checkbox" name="insp-6" value="1"/&gt;&lt;span&gt;&lt;/span&gt;&lt;/td&gt; &lt;/table&gt; &lt;/div&gt; 1 Core tab &lt;/div&gt; &lt;div class="sheet-section-abilities"&gt;&lt;!-- Edges Tab --&gt; &lt;!-- Stuff on the tab --&gt; &lt;h1&gt;Abilities & Tech&lt;/h1&gt; &lt;table width="500" border="1" style="margin:1em auto; table-layout: fixed"&gt; &nbsp; &lt;tbody&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="22px"&gt;&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="180px"&gt;Name&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="80px"&gt;Modifier&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="100px"&gt;Location&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="400px"&gt;Notes&nbsp;&lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &lt;/table&gt; &lt;fieldset class="repeating_equipment"&gt; &lt;table width="400" border="1" style="margin:1em auto; table-layout: fixed"&gt; &nbsp; &lt;tbody&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="22px"&gt;&lt;button type='roll' value='&{template:default}{{name=@{eqp_name} Roll}}{{Roll=[[ ?{Roll Type|Standard, 1d20 + @{eqp_mod}|Advantage, 2d20kh1 + @{eqp_mod}|Disadvantage, 2d20kl1 + @{eqp_mod}} ]]}}' name='roll_Normal'&gt;&nbsp;&lt;/button&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="180px"&gt;&lt;input type="text" class="sheet-BigGear" name="attr_eqp_name" value="" /&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="80px"&gt;&lt;input type="number" name="attr_eqp_mod" value="0" /&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="100px"&gt;&lt;select class="sheet-select" name="attr_eqp-pos" style="width: 88px"&gt; &lt;option value="null"&gt;N/A&lt;/option&gt; &lt;option value="vest"&gt;Vest&lt;/option&gt; &lt;option value="head"&gt;Head&lt;/option&gt; &lt;option value="arm"&gt;Arm&lt;/option&gt; &lt;option value="leg"&gt;Leg&lt;/option&gt; &lt;option value="worn"&gt;Worn&lt;/option&gt; &lt;option value="backpack"&gt;Backpack&lt;/option&gt; &nbsp; &nbsp; &lt;/select&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="400px"&gt;&lt;textarea name="attr_eqp-note" value="note" style='vertical-align: text-top; width: 390px; height: 80px'&gt;Notes&lt;/textarea&gt; &lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &lt;/table&gt; &lt;/fieldset&gt; 2 Abilities tab - sheet-section-abilities &lt;/div&gt; &lt;div class="sheet-section-weapons"&gt;&lt;!-- Skills Tab --&gt; &lt;!-- Stuff on the tab --&gt; &lt;h1&gt;Weapons&lt;/h1&gt; &lt;table width="500" border="1" style="margin:1em auto; table-layout: fixed"&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="100px"&gt;Weapon&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="120px"&gt;Weapon Name&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;Mag Size&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;Mag Current&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="80px"&gt;Calliber&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="70px"&gt;Weight (Pounds)&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="200px"&gt;Notes&nbsp;&lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="100px"&gt;Primary&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="120px"&gt;&lt;input type="text" class="sheet-BigGear" name="attr_pri_name" value="" style='width: 110px;'/&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;&lt;input type="number" name="attr_pri_magsize" value="0"/&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;&lt;input type="number" name="attr_pri_cursize" value="0" readonly/&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="80px"&gt;&lt;select class="gun-select" name="attr_pri_cal" style="width: 70px"&gt; &lt;option value="556"&gt;5.56&lt;/option&gt; &lt;option value="762"&gt;7.62&lt;/option&gt; &lt;option value="545"&gt;5.45&lt;/option&gt; &lt;option value="9mm"&gt;9mm&lt;/option&gt; &lt;option value="45acp"&gt;.45acp&lt;/option&gt; &lt;option value="357"&gt;.357&lt;/option&gt; &lt;option value="50"&gt;.50&lt;/option&gt; &lt;option value="other"&gt;Other&lt;/option&gt; &nbsp; &nbsp; &lt;/select&gt;&lt;/th&gt; &lt;th scope="col" width="70px"&gt;&lt;input type="number" name="attr_pri_weight" value="0" style="width: 50px"/&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="200px"&gt;&lt;textarea name="attr_pri_notes" value="note" style='vertical-align: text-top; width: 190px; height: 42px'&gt;Notes&lt;/textarea&gt;&lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="100px"&gt;Secondary&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="120px"&gt;&lt;input type="text" class="sheet-BigGear" name="attr_sec_name" value="" style='width: 110px;'/&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;&lt;input type="number" name="attr_sec_magsize" value="0"/&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;&lt;input type="number" name="attr_sec_cursize" value="0" readonly/&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="80px"&gt;&lt;select class="gun-select" name="attr_sec_cal" style="width: 70px"&gt; &lt;option value="9mm"&gt;9mm&lt;/option&gt; &lt;option value="556"&gt;5.56&lt;/option&gt; &lt;option value="762"&gt;7.62&lt;/option&gt; &lt;option value="545"&gt;5.45&lt;/option&gt; &lt;option value="45acp"&gt;.45acp&lt;/option&gt; &lt;option value="357"&gt;.357&lt;/option&gt; &lt;option value="50"&gt;.50&lt;/option&gt; &lt;option value="other"&gt;Other&lt;/option&gt; &nbsp; &nbsp; &lt;/select&gt;&lt;/th&gt; &lt;th scope="col" width="70px"&gt;&lt;input type="number" name="attr_sec_weight" value="0" style="width: 50px"/&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="200px"&gt;&lt;textarea name="attr_sec_notes" value="note" style='vertical-align: text-top; width: 190px; height: 42px'&gt;Notes&lt;/textarea&gt;&lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="120px"&gt;Other&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="120px"&gt;&lt;input type="text" class="sheet-BigGear" name="attr_other_name" value="" style='width: 110px;'/&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;&lt;input type="number" name="attr_other_magsize" value="0"/&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;&lt;input type="number" name="attr_other_cursize" value="0" readonly/&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="80px"&gt;&lt;select class="gun-select" name="attr_other_cal" style="width: 70px"&gt; &lt;option value="other"&gt;Other&lt;/option&gt; &lt;option value="556"&gt;5.56&lt;/option&gt; &lt;option value="762"&gt;7.62&lt;/option&gt; &lt;option value="545"&gt;5.45&lt;/option&gt; &lt;option value="9mm"&gt;9mm&lt;/option&gt; &lt;option value="45acp"&gt;.45acp&lt;/option&gt; &lt;option value="357"&gt;.357&lt;/option&gt; &lt;option value="50"&gt;.50&lt;/option&gt; &nbsp; &nbsp; &lt;/select&gt;&lt;/th&gt; &lt;th scope="col" width="70px"&gt;&lt;input type="number" name="attr_other_weight" value="0" style="width: 50px"/&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="200px"&gt;&lt;textarea name="attr_other_notes" value="note" style='vertical-align: text-top; width: 190px; height: 42px'&gt;Notes&lt;/textarea&gt;&lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &lt;/table&gt; &lt;table width="200" border="1" style="margin:1em auto; table-layout: fixed"&gt; &nbsp; &lt;tbody&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;9mm&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;.45&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;.357&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;5.45&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;5.56&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;7.62&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;.50&nbsp;&lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;input type="number" name="attr_ammo_9mm" value="0" style="width: 56px"/&gt;&nbsp;&lt;/td&gt; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;input type="number" name="attr_ammo_357" value="0" style="width: 56px"/&gt;&nbsp;&lt;/td&gt; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;input type="number" name="attr_ammo_45" value="0" style="width: 56px"/&gt;&nbsp;&lt;/td&gt; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;input type="number" name="attr_ammo_545" value="0" style="width: 56px"/&gt;&nbsp;&lt;/td&gt; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;input type="number" name="attr_ammo_556" value="0" style="width: 56px"/&gt;&nbsp;&lt;/td&gt; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;input type="number" name="attr_ammo_762" value="0" style="width: 56px"/&gt;&nbsp;&lt;/td&gt; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;input type="number" name="attr_ammo_50" value="0" style="width: 56px"/&gt;&nbsp;&lt;/td&gt; &nbsp; &nbsp; &lt;/tr&gt; &nbsp; &lt;/tbody&gt; &lt;/table&gt; &lt;hr&gt; 3 Weapons tab - sheet-section-weapons &lt;/div&gt; &lt;div class="sheet-section-health"&gt;&lt;!-- gear Tab --&gt; &lt;!-- Stuff on the tab --&gt; &lt;h1&gt;Damage&lt;/h1&gt; &lt;table width="500" border="1" style="margin:1em auto; table-layout: fixed"&gt; &nbsp; &lt;tbody&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="80px"&gt;Location&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="90px"&gt;Type&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="80px"&gt;Severity&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="55px"&gt;Treated&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="280px"&gt;Notes&nbsp;&lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &lt;/table&gt; &lt;fieldset class="repeating_damage"&gt; &lt;table width="500" border="1" style="margin:1em auto; table-layout: fixed"&gt; &nbsp; &lt;tbody&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="80px"&gt;&lt;select class="sheet-select" name="attr_dmg-pos"&gt; &lt;option value="head"&gt;Head&lt;/option&gt; &lt;option value="torso"&gt;Torso&lt;/option&gt; &lt;option value="larm"&gt;Left Arm&lt;/option&gt; &lt;option value="rarm"&gt;Right Arm&lt;/option&gt; &lt;option value="lleg"&gt;Left Leg&lt;/option&gt; &lt;option value="rleg"&gt;Right Leg&lt;/option&gt; &lt;option value="other"&gt;Other&lt;/option&gt; &lt;/select&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="90px"&gt;&lt;select class="sheet-select" name="attr_dmg-type" style="width: 90px"&gt; &lt;option value="piercing"&gt;Piercing&lt;/option&gt; &lt;option value="bludeoning"&gt;Bludeoning&lt;/option&gt; &lt;option value="slashing"&gt;Slashing&lt;/option&gt; &lt;option value="acid"&gt;Acid&lt;/option&gt; &lt;option value="frost"&gt;Frost&lt;/option&gt; &lt;option value="fire"&gt;Fire&lt;/option&gt; &lt;option value="lightning"&gt;Lightning&lt;/option&gt; &lt;option value="poison"&gt;Poison&lt;/option&gt; &lt;option value="phsycic"&gt;Psychic&lt;/option&gt; &lt;option value="thunder"&gt;Thunder&lt;/option&gt; &lt;/select&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="80px"&gt;&lt;select class="sheet-select" name="attr_dmg-sev"&gt; &lt;option value="none"&gt;None&lt;/option&gt; &lt;option value="min"&gt;Minor&lt;/option&gt; &lt;option value="maj"&gt;Major&lt;/option&gt; &lt;option value="mor"&gt;Mortal&lt;/option&gt; &lt;/select&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="55px"&gt;&lt;input type="checkbox" name="attr_treated" value="0" checked="false"&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="280px"&gt;&lt;textarea name="attr_dmg-note" value="note" style='width: 258px; height: 44px'&gt;Notes&lt;/textarea&gt;&lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &lt;/table&gt; &lt;/fieldset&gt; 4 Health tab - sheet-section-health &lt;/div&gt; &lt;div class="sheet-section-inventory"&gt;&lt;!-- arcanum Tab --&gt; &lt;!-- Stuff on the tab --&gt; &lt;h1&gt;Items&lt;/h1&gt; &lt;table width="500" border="1" style="margin:1em auto; table-layout: fixed"&gt; &nbsp; &lt;tbody&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;UNIFORM&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;VEST&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;BACKPACK&nbsp;&lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &lt;/table&gt; &lt;table width="500" border="1" cellspacing="6px" cellpadding="6px" style="margin:1em auto; table-layout: fixed"&gt; &nbsp; &lt;tbody&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;&lt;input type="checkbox" class="" name="attr_equip_uniform" value="1" title="Clothing" checked="true"/&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;&lt;input type="checkbox" class="" name="attr_equip_vest" value="1" title="Vest" checked="true"/&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="60px"&gt;&lt;input type="checkbox" class="" name="attr_equip_backpack" value="1" title="Bakcpack" checked="true"/&gt;&lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &lt;/table&gt; &lt;table width="500" border="1" style="margin:1em auto; table-layout: fixed"&gt; &nbsp; &lt;tbody&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="180px"&gt;Item&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="90px"&gt;Weight&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="70px"&gt;Quantity&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="70px"&gt;Equipped&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="80px"&gt;Location&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="280px"&gt;Notes&nbsp;&lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &lt;/table&gt; &lt;fieldset class="repeating_inventory"&gt; &lt;table width="500" border="1" style="margin:1em auto; table-layout: fixed"&gt; &nbsp; &lt;tbody&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="180px"&gt;&lt;input type="text" name="attr_item_name" style="width: 180px" class="sheet-skill-label"&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="90px"&gt;&lt;input type="number" name="attr_item_weight" style="width: 80px" class="sheet-skill-value"&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="70px"&gt;&lt;input type="number" name="attr_item_quantity" style="width: 60px" class="sheet-skill-value"&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="70px"&gt;&lt;input type="checkbox" name="attr_item_carrying" value="1" checked="true"&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="80px"&gt; &nbsp; &lt;select name="attr_item_location" style="width: 82px"&gt; &nbsp; &nbsp; &nbsp; &lt;option value="uniform"&gt;Uniform&lt;/option&gt; &nbsp; &nbsp; &nbsp; &lt;option value="vest"&gt;Vest&lt;/option&gt; &nbsp; &nbsp; &nbsp; &lt;option value="backpack"&gt;Backpack&lt;/option&gt; &nbsp; &lt;/select&gt;&lt;/th&gt; &lt;th scope="col" width="280px"&gt;&lt;textarea name="attr_item_note" value="note" style='width: 258px; height: 44px'&gt;Notes&lt;/textarea&gt;&lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &lt;/table&gt; &lt;/fieldset&gt; &lt;div class="weighttotal"&gt; &lt;span class="label"&gt;TOTAL WEIGHT&lt;/span&gt; &lt;input type="text" name="attr_weight_total" style="width: 80px" value="0" readonly&gt; lbs &lt;/div&gt; 5 Inventory tab - sheet-section-inventory &lt;/div&gt; &lt;div class="sheet-section-other"&gt;&lt;!-- Journal Tab --&gt; &lt;!-- Stuff on the tab --&gt; &lt;h1&gt;Other Items & Notes&lt;/h1&gt; &lt;table width="500" border="1" style="margin:1em auto; table-layout: fixed"&gt; &nbsp; &lt;tbody&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="200px"&gt;Item&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="100px"&gt;Location&nbsp;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="500px"&gt;Notes&nbsp;&lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &lt;/table&gt; &lt;fieldset class="repeating_notes"&gt; &lt;table width="500" border="1" style="margin:1em auto; table-layout: fixed"&gt; &nbsp; &lt;tbody&gt; &nbsp; &nbsp; &lt;tr&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="200px"&gt;&lt;input type="text" name="attr_item_name" style="width: 180px" class="sheet-skill-label"&gt;&lt;/th&gt; &nbsp; &nbsp; &nbsp; &lt;th scope="col" width="100px"&gt; &nbsp; &lt;select name="attr_item_location" style="width: 82px"&gt; &nbsp; &nbsp; &nbsp; &lt;option value="uniform"&gt;Uniform&lt;/option&gt; &nbsp; &nbsp; &nbsp; &lt;option value="vest"&gt;Vest&lt;/option&gt; &nbsp; &nbsp; &nbsp; &lt;option value="backpack"&gt;Backpack&lt;/option&gt; &nbsp; &lt;/select&gt;&lt;/th&gt; &lt;th scope="col" width="500px"&gt;&lt;textarea name="attr_item_note" value="note" style='width: 490px; height: 44px'&gt;Notes&lt;/textarea&gt;&lt;/th&gt; &nbsp; &nbsp; &lt;/tr&gt; &lt;/table&gt; &lt;/fieldset&gt; 6 Other tab - sheet-section-other &lt;/div&gt; &lt;/div&gt; &lt;script type="text/worker"&gt; on("change:equip_uniform change:equip_vest change:equip_backpack change:repeating_inventory:item_weight change:repeating_inventory:item_carrying change:repeating_inventory:item_location change:repeating_inventory:item_quantity change:ammo_9mm change:ammo_357 change:ammo_45 change:ammo_545 change:ammo_556 change:ammo_762 change:ammo_50 remove:repeating_inventory", function() { getSectionIDs("repeating_inventory", function(IDArray) { var fieldNames = []; &nbsp; &nbsp; &nbsp; &nbsp; for (var i=0; i &lt; IDArray.length; i++) { fieldNames.push("repeating_inventory_" + IDArray[i] + "_item_weight"); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldNames.push("repeating_inventory_" + IDArray[i] + "_item_quantity"); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldNames.push("repeating_inventory_" + IDArray[i] + "_item_carrying"); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldNames.push("repeating_inventory_" + IDArray[i] + "_item_location"); } &nbsp; &nbsp; fieldNames.push("equip_uniform"); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldNames.push("equip_vest"); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldNames.push("equip_backpack"); fieldNames.push("ammo_9mm"); &nbsp; &nbsp; &nbsp; fieldNames.push("ammo_357"); &nbsp; &nbsp; &nbsp; fieldNames.push("ammo_45");&nbsp; &nbsp; &nbsp; &nbsp; fieldNames.push("ammo_545"); &nbsp; &nbsp; &nbsp; fieldNames.push("ammo_556"); &nbsp; &nbsp; &nbsp; fieldNames.push("ammo_762"); &nbsp; &nbsp; &nbsp; fieldNames.push("ammo_50");&nbsp; &nbsp; &nbsp; &nbsp; fieldNames.push("pri_weight"); &nbsp; &nbsp; &nbsp; fieldNames.push("sec_weight"); &nbsp; &nbsp; &nbsp; fieldNames.push("other_weight"); console.log("Start of the script after gathering field names----------------------------------"); var total = 0; &nbsp; &nbsp; &nbsp; &nbsp; var per = 0; var equipped = 0; &nbsp; &nbsp; &nbsp; &nbsp; getAttrs(fieldNames, function(values) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (var i=0; i &lt; IDArray.length; i++) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var uniform_enabled = values["equip_uniform"]; var vest_enabled = values["equip_vest"]; var backpack_enabled = values["equip_backpack"]; console.log("here are the values of the enabled clothing items"); console.log("uniform:" + uniform_enabled + " backpack:" + backpack_enabled + " vest:" + vest_enabled); var location = values["repeating_inventory_" + IDArray[i] + "_item_location"]; var equipped = values["repeating_inventory_" + IDArray[i] + "_item_carrying"]*1; if(backpack_enabled != 0)&nbsp; { console.log("inside of backpack_enabled loop with this as the value:"+backpack_enabled); console.log("where is the item though?:"+location); if (location == "backpack") { console.log("inside of location == backpack loop with this as the value:"+location); if (equipped){ per = 0; per = values["repeating_inventory_" + IDArray[i] + "_item_weight"]*1||0; total += per*values["repeating_inventory_" + IDArray[i] + "_item_quantity"]||0; } } }&nbsp; if (vest_enabled != 0)&nbsp; { console.log("inside of vest_enabled loop with this as the value:"+vest_enabled); console.log("where is the item though?:"+location); if (location == "vest") { console.log("inside of location == backpack loop with this as the value:"+location); if (equipped){ per = 0; per = values["repeating_inventory_" + IDArray[i] + "_item_weight"]*1||0; total += per*values["repeating_inventory_" + IDArray[i] + "_item_quantity"]||0; } } }&nbsp; if (uniform_enabled != 0) { console.log("inside of uniform_enabled loop with this as the value:"+uniform_enabled); console.log("where is the item though?:"+location); if (location == "uniform") { console.log("inside of location == backpack loop with this as the value:"+location); if (equipped){ per = 0; per = values["repeating_inventory_" + IDArray[i] + "_item_weight"]*1||0; total += per*values["repeating_inventory_" + IDArray[i] + "_item_quantity"]||0; } } } } var primary_weight = values["pri_weight"]*1||0; var secondary_weight = values["sec_weight"]*1||0; var otherItem_weight = values["other_weight"]*1||0; total += (primary_weight+secondary_weight+otherItem_weight); //here is the code block in question /* var 9mm_count = values["ammo_9mm"]*1||0; var 357_count = values["ammo_357"]*1||0; var 45_count = values["ammo_45"]*1||0; var 545_count = values["ammo_545"]*1||0; var 556_count = values["ammo_556"]*1||0; var 762_count = values["ammo_762"]*1||0; var 50_count = values["ammo_50"]*1||0; console.log("9mm_count:" + 9mm_count + " 357_count:" + 357_count + " 45_count:" + 45_count + " 545_count:" + 545_count + " 556_count:" + 556_count + " 762_count:" + 762_count + " 50_count:" + 50_count); total += ((9mm_count*0.03)+(357_count*0.05)+(45_count*0.06)+(545_count*0.03)+(556_count*0.04)+(762_count*0.07)+(50_count*0.25)); */ setAttrs({ "weight_total": total }); &nbsp; &nbsp; &nbsp; &nbsp; }); }); }); &lt;/script&gt; When uncommenting the code in question, I stop getting console log responses and no errors appear to show up in the log. I'm not sure if it's a synatax error, or maybe my eyes are just blind to it for staring at it too long. I tried to implement them the same way I did var primary_weight = values["pri_weight"]*1||0; var secondary_weight = values["sec_weight"]*1||0; var otherItem_weight = values["other_weight"]*1||0; but it doesn't appear to be working as I thought. I don't think it's a very big issue, considering it's just on the brink of working and I'm able to isolate and reproduce the problem. I'm guessing it's some form of script error considering the log stops making outputs.
1515828351

Edited 1515828383
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Run it through the closure compiler to see if there is a syntax error. <a href="https://closure-compiler.appspot.com/home" rel="nofollow">https://closure-compiler.appspot.com/home</a>
1515828503
GiGs
Pro
Sheet Author
API Scripter
I havent looked through your code (still waking up), but I'd do the snippet at the end differently: var primary_weight = parseInt(values["pri_weight"])||0; var secondary_weight = parseInt(values["sec_weight"])||0; var otherItem_weight = parseInt(values["other_weight"])||0;
var primary_weight = parseInt(values["pri_weight"])||0; var secondary_weight = parseInt(values["sec_weight"])||0; var otherItem_weight = parseInt(values["other_weight"])||0; var 9mm_count = parseInt(values["ammo_9mm"])||0; var 357_count = parseInt(values["ammo_357"])||0; var 45_count = parseInt(values["ammo_45"])||0; var 545_count = parseInt(values["ammo_545"])||0; var 556_count = parseInt(values["ammo_556"])||0; var 762_count = parseInt(values["ammo_762"])||0; var 50_count = parseInt(values["ammo_50"])||0; console.log("9mm_count:" + 9mm_count + " 357_count:" + 357_count + " 45_count:" + 45_count + " 545_count:" + 545_count + " 556_count:" + 556_count + " 762_count:" + 762_count + " 50_count:" + 50_count); total += (primary_weight+secondary_weight+otherItem_weight); total += ((9mm_count*0.03)+(357_count*0.05)+(45_count*0.06)+(545_count*0.03)+(556_count*0.04)+(762_count*0.07)+(50_count*0.25)); So I checked for syntax, no errors come up except for the fact that it's not a full html page with a head and body. I changed the parsing of the values. It doesn't seem to be working either way. To further explain the attribute is only mentioned a few times, so for example let's say just ammo_9mm. ... &lt;td&gt;&lt;input type="number" name="attr_ ammo_9mm " value="0" style="width: 56px"/&gt;&nbsp;&lt;/td&gt; ... Here's the input for the attribute, easy enough now lets go down the line... ... var fieldNames = []; &nbsp; &nbsp; &nbsp; &nbsp; for (var i=0; i &lt; IDArray.length; i++) { ... } ... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fieldNames.push("equip_backpack"); fieldNames.push("ammo_9mm"); &nbsp; &nbsp; &nbsp; fieldNames.push("pri_weight"); ... &nbsp; &nbsp; &nbsp; &nbsp; getAttrs( fieldNames , function(values) { ... ammo_9mm is added to fieldNames and run through the getAttrs function. Should now be recognizable inside. Way down the line after running through all the other items in inventory ... var 9mm_count = parseInt(values[" ammo_9mm "])||0; ... Parse the count of 9mm bullets into an int, then call it 9mm_count ... console.log("9mm_count:" + 9mm_count ); total += ( 9mm_count *0.03); ... Add to the total weight based on the int multiplied by it's weight in lbs and add to total. (If theres a math problem here with adding the total, I've tested it with and without adding the total, the only thing that seems to affect it is parsing the integer from the value ammo_9mm . I'm very very perplexed.
1515907714
GiGs
Pro
Sheet Author
API Scripter
Can variables start with a number? i cant say for javascript, but other languages I know, you must always start variable names with a letter. So 9mm_count is bad, count_9mm is fine.
Damn , that was obscure, thanks got it working now. That was it. Note to self Don't start variables with a number or probably anything that isn't a letter. I think underscore might be valid but I'll stick to at least starting with a letter for now on.