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

Struggling to add a new reapeating section in D&D3.5 character sheet

I hope this makes sense, I am very new to coding but I am doing my best to learn! I know I am missing something and suspect I'm not calling the new repeating values correctly? As of right now I have been able to get the dropdown working separately with CSS and have added 'backpack' to all repeating values. The 2nd 'equipment' dropdown is representing the backpack. This is the 'Equipment' code that I have copied. this is what the 1st dropdown is using. <input type="checkbox" class="pc-equipment-show arrow" title="equipment-show" name="attr_equipment-show" value="1" checked /><span style="text-align: left;" data-i18n="equipment">Equipment</span> <div class="pc-equipment"> <div style="float: left"> <table class="tableNoCellSpacingCellPadding10"> <tr> <td colspan="3" class="statlabel-big-gray" style="font-size: 1.5em; width: 790px;" data-i18n="equipment">Equipment</td> </tr> </table> <br> <input type="checkbox" class="pc-singleuseequipment-show arrow" title="singleuseequipment-show" name="attr_singleuseequipment-show" value="1" /> <span style="text-align: left; font-weight: bold;" data-i18n="single-use-items">Single Use Items</span> <div class="pc-singleuseequipment"> <div style="float: left"> <br> <fieldset class="repeating_magicitems"> <table> <tr> <td style="width: 790px;"><input type="text" name="attr_singleusemagicitems" title="repeating_magicitems_#_singleusemagicitem" style="width: 790px;"></td> </tr> </table> </fieldset> </div> <hr/> </div> <br> <input type="checkbox" class="pc-stdequipment-show arrow" title="stdequipment-show" name="attr_stdequipment-show" value="1" checked /> <span style="text-align: left; font-weight: bold;" data-i18n="equipment">Equipment</span> <div class="pc-stdequipment"> <div style="float: left"> <!-- from Chaotic Law --> <table> <tr class="table-sheet-header"> <td style="width: 225px;" data-i18n="name">Name</td> <td style="width: 30px;" data-i18n="quantity-a">Qty</td> <td style="width: 45px;" data-i18n="cost(gp)">Cost (gp)</td> <td style="width: 45px;" data-i18n="total-cost(gp)-i">T_Cost (gp)</td> <td style="width: 40px;" data-i18n="weight-a">Wt (<span name="attr_weightunit" title="weightunit"></span>)</td> <td style="width: 40px;" data-i18n="total-weight-a">T_Wt (<span name="attr_weightunit" title="weightunit"></span>)</td> <td style="width: 30px;" data-i18n="hitpoints-i">HPs</td> <td style="width: 30px;" data-i18n="hardness-a">Hard</td> <td style="width: 90px;" data-i18n="location">Location</td> <td style="width: 220px;" data-i18n="notes">Notes</td> </tr> </table> <fieldset class="repeating_equipment"> <table style="width: 350px;" class="table-sheet-row"> <tr class="table-sheet-row"> <td><input type="text" style="width: 225px;" name="attr_equipmentname" title="repeating_equipment_#_equipmentname"></td> <td><input type="text" style="width: 30px;" name="attr_equipmentquantity" title="repeating_equipment_#_equipmentquantity" value="0"></td> <td><input type="text" style="width: 45px;" name="attr_equipmentcost" title="repeating_equipment_#_equipmentcost" value="0"></td> <td><input type="text" style="width: 45px;" name="attr_equipmenttotalcost" title="repeating_equipment_#_equipmenttotalcost" value="0"></td> <td><input type="text" style="width: 40px;" name="attr_equipmentweight" title="repeating_equipment_#_equipmentweight" value="0"></td> <td><input type="text" style="width: 40px;" name="attr_equipmenttotalweight" title="repeating_equipment_#_equipmenttotalweight" value="0"></td> <td><input type="text" style="width: 30px;" name="attr_equipmenthitpoints" title="repeating_equipment_#_equipmenthitpoints"></td> <td><input type="text" style="width: 30px;" name="attr_equipmenthardness" title="repeating_equipment_#_equipmenthardness"></td> <td><input type="text" style="width: 90px;" name="attr_equipmentlocation" title="repeating_equipment_#_equipmentlocation"></td> <td><textarea class="inputbox" rows="1" style="height: 22px; width: 205px; padding: 0px; border-style: none none solid none; border-width: 0px 0px 1px 0px; vertical-align: top;" name="attr_equipmentnotes" title="repeating_equipment_#_equipmentnotes"></textarea></td> </tr> </table> </fieldset> <table> <tr> <td style="width: 30px;"> </td> <td style="width: 90px;">   <span data-i18n="total-cost">Total Cost</span>:</td> <td><input type="text" style="width: 55px; text-align: right;" name="attr_totalequipmentcost" title="totalequipmentcost" value="0"/><span data-i18n="gold-pieces-i">gp</span>. </td> <td style="width: 25px;"> </td> <td style="width: 90px; text-align: right;" data-i18n="total-weight">Total Weight:</td> <td><input type="text" style="width: 55px; text-align: right;" name="attr_totalequipmentweight" title="totalequipmentweight" value="0"/><span name="attr_weightunit" title="weightunit"></span>.   </td> <td style="width: 200px;"><select style="height: 24px; width: 160px; padding: 0px;" name="attr_equipmentweightcopy" title="equipmentweightcopy (If you change this input to Copied, the total weight will be copied to Weight Carried above. This is not reversable! If changed back, it will merely stop copying the weight but the original value will still be lost.)"> <option value="0" data-i18n="not-copied" selected>Not Copied</option> <option value="1" data-i18n="total-weight-copied">Total Weight Copied to Weight Carried</option> </select></td> </tr> </table> </div> <hr/> </div> <br> and this is the code that I am working on and is what the 2nd dropdown is using. (I just changed the name and attr) <input type="checkbox" class="pc-backpackequipment-show arrow" title="backpackequipment-show" name="attr_backpackequipment-show" value="1" checked /> <span style="text-align: left; font-weight: bold;" data-i18n="equipment">Equipment</span> <div class="pc-backpackequipment"> <div style="float: left"> <!-- from Chaotic Law --> <table> <tr class="table-sheet-header"> <td style="width: 225px;" data-i18n="name">Name</td> <td style="width: 30px;" data-i18n="quantity-a">Qty</td> <td style="width: 45px;" data-i18n="cost(gp)">Cost (gp)</td> <td style="width: 45px;" data-i18n="total-cost(gp)-i">T_Cost (gp)</td> <td style="width: 40px;" data-i18n="weight-a">Wt (<span name="attr_weightunit" title="weightunit"></span>)</td> <td style="width: 40px;" data-i18n="total-weight-a">T_Wt (<span name="attr_weightunit" title="weightunit"></span>)</td> <td style="width: 30px;" data-i18n="hitpoints-i">HPs</td> <td style="width: 30px;" data-i18n="hardness-a">Hard</td> <td style="width: 90px;" data-i18n="location">Location</td> <td style="width: 220px;" data-i18n="notes">Notes</td> </tr> </table> <fieldset class="repeating_backpackequipment"> <table style="width: 350px;" class="table-sheet-row"> <tr class="table-sheet-row"> <td><input type="text" style="width: 225px;" name="attr_backpackequipmentname" title="repeating_backpackequipment_#_equipmentname"></td> <td><input type="text" style="width: 30px;" name="attr_backpackequipmentquantity" title="repeating_backpackequipment_#_equipmentquantity" value="0"></td> <td><input type="text" style="width: 45px;" name="attr_backpackequipmentcost" title="repeating_backpackequipment_#_equipmentcost" value="0"></td> <td><input type="text" style="width: 45px;" name="attr_backpackequipmenttotalcost" title="repeating_backpackequipment_#_equipmenttotalcost" value="0"></td> <td><input type="text" style="width: 40px;" name="attr_backpackequipmentweight" title="repeating_backpackequipment_#_equipmentweight" value="0"></td> <td><input type="text" style="width: 40px;" name="attr_backpackequipmenttotalweight" title="repeating_backpackequipment_#_equipmenttotalweight" value="0"></td> <td><input type="text" style="width: 30px;" name="attr_backpackequipmenthitpoints" title="repeating_backpackequipment_#_equipmenthitpoints"></td> <td><input type="text" style="width: 30px;" name="attr_backpackequipmenthardness" title="repeating_backpackequipment_#_equipmenthardness"></td> <td><input type="text" style="width: 90px;" name="attr_backpackequipmentlocation" title="repeating_backpackequipment_#_equipmentlocation"></td> <td><textarea class="inputbox" rows="1" style="height: 22px; width: 205px; padding: 0px; border-style: none none solid none; border-width: 0px 0px 1px 0px; vertical-align: top;" name="attr_backpackequipmentnotes" title="repeating_backpackequipment_#_equipmentnotes"></textarea></td> </tr> </table> </fieldset> <table> <tr> <td style="width: 30px;"> </td> <td style="width: 90px;">   <span data-i18n="total-cost">Total Cost</span>:</td> <td><input type="text" style="width: 55px; text-align: right;" name="attr_totalequipmentcost" title="totalequipmentcost" value="0"/><span data-i18n="gold-pieces-i">gp</span>. </td> <td style="width: 25px;"> </td> <td style="width: 90px; text-align: right;" data-i18n="total-weight">Total Weight:</td> <td><input type="text" style="width: 55px; text-align: right;" name="attr_totalequipmentweight" title="totalequipmentweight" value="0"/><span name="attr_weightunit" title="weightunit"></span>.   </td> <td style="width: 200px;"><select style="height: 24px; width: 160px; padding: 0px;" name="attr_equipmentweightcopy" title="equipmentweightcopy (If you change this input to Copied, the total weight will be copied to Weight Carried above. This is not reversable! If changed back, it will merely stop copying the weight but the original value will still be lost.)"> <option value="0" data-i18n="not-copied" selected>Not Copied</option> <option value="1" data-i18n="total-weight-copied">Total Weight Copied to Weight Carried</option> </select></td> </tr> </table> </div> <hr/> </div> <br> What I am struggling to figure out is why I cannot get the T_Cost and T_Wt to update for the 2nd dropdown. I believe that the formula is here on('change:repeating_equipment change:repeating_backpackequipment change:beads change:bits change:ceramic change:silver change:gold change:weapon1weight change:weapon2weight change:weapon3weight change:weapon4weight change:weapon5weight change:weapon6weight change:weapon7weight change:weapon8weight change:weapon9weight change:weapon10weight change:acitemweight change:shieldweight', function(){ TAS.repeating('equipment backpackequipment') .attrs('totalequipmentweight','totalbackpackequipmentweight','totalequipmentcost','totalbackpackequipmentcost','summary','beads','bits','ceramic','silver','gold','weapon1weight','weapon2weight','weapon3weight','weapon4weight','weapon5weight','weapon6weight','weapon7weight','weapon8weight','weapon9weight','weapon10weight','acitemweight','shieldweight') .fields('equipmentname','backpackequipmentname','equipmentquantity','backpackequipmentquantity','equipmentweight','backpackequipmentweight','equipmenttotalweight','backpackequipmenttotalweight','equipmentcost','backpackequipmentcost','equipmenttotalcost','backpackequipmenttotalcost') .reduce(function(m,r){ m.equipmentweight+=(r.F.equipmentweight*r.I.equipmentquantity); r.D[3].equipmenttotalweight=(r.F.equipmentweight*r.I.equipmentquantity); m.equipmentcost+=(r.F.equipmentcost*r.I.equipmentquantity); r.D[2].equipmenttotalcost=(r.F.equipmentcost*r.I.equipmentquantity); m.desc.push(r.equipmentname+(r.I.equipmentquantity>1 ? ' (x'+r.S.equipmentquantity+')' : '')); ///this is the code I have copied and changed m.backpackequipmentweight+=(r.F.backpackequipmentweight*r.I.backpackequipmentquantity); r.D[3].backpackequipmenttotalweight=(r.F.backpackequipmentweight*r.I.backpackequipmentquantity); m.backpackequipmentcost+=(r.F.backpackequipmentcost*r.I.backpackequipmentquantity); r.D[2].backpackequipmenttotalcost=(r.F.backpackequipmentcost*r.I.backpackequipmentquantity); m.desc.push(r.backpackequipmentname+(r.I.backpackequipmentquantity>1 ? ' (x'+r.S.backpackequipmentquantity+')' : '')); return m; },{equipmentweight:0,equipmentcost:0, desc: []},function(m,r,a){ ///this code has been changed with the help of another forum poster and I added things from there        a.summary=m.desc.join(', '); console.log(`beads:${a.beads} bits:${a.bits} ceramic:${a.ceramic} silver:${a.silver} gold:${a.gold} weapon1weight:${a.weapon1weight} weapon2weight:${a.weapon2weight}`); const beads =+ a.beads; const bits =+ a.bits; const ceramic =+ a.ceramic; const silver =+ a.silver; const gold =+ a.gold; const weapon1weight =+ a.weapon1weight; const weapon2weight =+ a.weapon2weight; const weapon3weight =+ a.weapon3weight; const weapon4weight =+ a.weapon4weight; const weapon5weight =+ a.weapon5weight; const weapon6weight =+ a.weapon6weight; const weapon7weight =+ a.weapon7weight; const weapon8weight =+ a.weapon8weight; const weapon9weight =+ a.weapon9weight; const weapon10weight =+ a.weapon10weight; const acitemweight =+ a.acitemweight const shieldweight =+ a.shieldweight const totalCurrencyWeight=(weapon1weight + weapon2weight + weapon3weight + weapon4weight + weapon5weight + weapon6weight + weapon7weight + weapon8weight + weapon9weight + weapon10weight + acitemweight + shieldweight) + (beads + bits + ceramic + silver + gold)/50; console.log(`totalCurrencyWeight:${totalCurrencyWeight}`); a.D[3].totalequipmentweight=m.equipmentweight + totalCurrencyWeight; a.D[2].totalequipmentcost=m.equipmentcost; }) .execute(); }); to make sense of the other added attr I have added a txtbox to all weapons and included their weight as well as armor/shield weight and currency weight into the total weight formula. (its not pretty but it gets the job done) Ideally I'd like to get the T_Cost and T_Wt working with the correct repeating attr. eventually figure out how to add those to the Total cost and Total Weight bellow, I believe for me it will be easier to shove it in the 'totalCurrencyWeight' formula like I have been. I think once I have that figured out I will either change the 'total weight copied' dropdown under the 2nd equipment section to be 'carried' or 'dropped' (or better yet if i can take the checkbox value for 'backpackequipment') with a 0 or 1 value to multiply the 'bags' total weight to represent it being carried or dropped. that total will be then added to the original stdequipment total weight so I dont have to change any of its code as well? I have been having a lot of fun figuring this unnecessary stuff out but I have hit a wall, thank you for any of those who are willing to help!
1722975330

Edited 1722978087
vÍnce
Pro
Sheet Author
Hi Tristan, I'm not 100% certain because I'm not that familiar with TAS, but I'm not sure if that TAS function can handle multiple repeating sections at the same time.  Have you tried handling them separately using that same TAS function except one would only handle equipment attrs and the other only backpackequipment attrs? Once you get your totals working for the backpack, you could probably add those back into the total equipment calcs.
Hi Tristan, I'm not 100% certain because I'm not that familiar with TAS, but I'm not sure if that TAS function can handle multiple repeating sections at the same time.  Have you tried handling them separately using that same TAS function except one would only handle equipment attrs and the only backpackequipment attrs? Once you get your totals working for the backpack, you could probably add those back into the total equipment calcs. Hey Vince! I'll give it a go and report back!
1722984508
GiGs
Pro
Sheet Author
API Scripter
I don't use TAS either, so wouldn't know where to start there. If vince's suggestion isn't accurate, try explaining what this worker is supposed to do (very specifically), and we can give you an alternative way to build it. Secondly, is this sheet meant to be shared through the community? If so, you'll need to replace the tables - they are expressly forbidden in roll20 sheets (for layout purposes, at least, which is how they are used here). Finally, I would rename attributes in your repeating sections. You could use repeating_equipment and repeating_backpack, and then use the same sub attributes in each, like "attr_name", "attr_quantity", "attr_cost" and so on. The sub-attributes are entirely unique in different repeating sections, and you don't have to use different names for them.
Thant was it vince! The new backpack section fully works and can be toggled to add into the encumbrance calc!
1722986858
vÍnce
Pro
Sheet Author
Great! Have fun storming the castle. ;-)
1722988083

Edited 1722988337
I don't use TAS either, so wouldn't know where to start there. If vince's suggestion isn't accurate, try explaining what this worker is supposed to do (very specifically), and we can give you an alternative way to build it. Secondly, is this sheet meant to be shared through the community? If so, you'll need to replace the tables - they are expressly forbidden in roll20 sheets (for layout purposes, at least, which is how they are used here). Finally, I would rename attributes in your repeating sections. You could use repeating_equipment and repeating_backpack, and then use the same sub attributes in each, like "attr_name", "attr_quantity", "attr_cost" and so on. The sub-attributes are entirely unique in different repeating sections, and you don't have to use different names for them. That is good to know! I thought about sharing this sheet but its very niche, 3.5 Dark Sun using variant encumbrance. I hope it is ok sharing what I have done to help out others who want to do the same as I did. My only other goal is to change the load dropdown to auto detect carry weight but I'll have to wait on that for another time! thank you both again for the help! Code is below (CCS and translation will have to be edited) Adding weapon weight box (only weapons 1-10) <tr> <td colspan="2"><input class="inputbox" type="text" name="attr_weapon1name" title="weapon1name" style="height: 24px; width: 120px;"></td> /// this is the line you'd want to add for each weapon (1-10) <td><input class="inputbox" type="text" name="attr_weapon1type" title="weapon1type" style="height: 24px; width: 35px;"></td> <td><input class="inputbox" type="text" name="attr_weapon1weight" title="weapon1weight" style="height: 24px; width: 35px;"></td> Changing currency names <table> <tr> <b><span data-i18n="money">Money</span></b> </tr> <tr> <div class="table-sheet-row"> <span class="table-sheet-data-center"><input type="text" name="attr_beads" title="Lead bead" style="width: 96px;"><br><span data-i18n="lead-bearings-iu">CP</span></span> <span class="table-sheet-data-center"><input type="text" name="attr_bits" title="Ceramic bit" style="width: 96px;"><br><span data-i18n="ceramic-bits-iu">SP</span></span> <span class="table-sheet-data-center"><input type="text" name="attr_ceramic" title="Ceramic piece" style="width: 96px;"><br><span data-i18n="ceramic-pieces-iu">GP</span></span> <span class="table-sheet-data-center"><input type="text" name="attr_silver" title="Silver" style="width: 96px;"><br><span data-i18n="silver-pieces-iu">PP</span></span> <span class="table-sheet-data-center"><input type="text" name="attr_gold" title="Gold" style="width: 96px;"><br><span data-i18n="gold-pieces-iu">PP</span></span> </div> </tr> </table> <br> Adding the extra backpack dropdown <input type="checkbox" class="pc-backpackequipment-show arrow" title="backpackequipment-show" name="attr_backpackequipment-show" value="1" checked /> <span style="text-align: left; font-weight: bold;" data-i18n="backpackequipment">Backpack</span> <div class="pc-backpackequipment"> <div style="float: left"> <!-- from Chaotic Law --> <table> <tr class="table-sheet-header"> <td style="width: 225px;" data-i18n="name">Name</td> <td style="width: 30px;" data-i18n="quantity-a">Qty</td> <td style="width: 45px;" data-i18n="cost(gp)">Cost (gp)</td> <td style="width: 45px;" data-i18n="total-cost(gp)-i">T_Cost (gp)</td> <td style="width: 40px;" data-i18n="weight-a">Wt (<span name="attr_weightunit" title="weightunit"></span>)</td> <td style="width: 40px;" data-i18n="total-weight-a">T_Wt (<span name="attr_weightunit" title="weightunit"></span>)</td> <td style="width: 30px;" data-i18n="hitpoints-i">HPs</td> <td style="width: 30px;" data-i18n="hardness-a">Hard</td> <td style="width: 90px;" data-i18n="location">Location</td> <td style="width: 220px;" data-i18n="notes">Notes</td> </tr> </table> <fieldset class="repeating_backpackequipment"> <table style="width: 350px;" class="table-sheet-row"> <tr class="table-sheet-row"> <td><input type="text" style="width: 225px;" name="attr_backpackequipmentname" title="repeating_backpackequipment_#_backpackequipmentname"></td> <td><input type="text" style="width: 30px;" name="attr_backpackequipmentquantity" title="repeating_backpackequipment_#_backpackequipmentquantity" value="0"></td> <td><input type="text" style="width: 45px;" name="attr_backpackequipmentcost" title="repeating_backpackequipment_#_backpackequipmentcost" value="0"></td> <td><input type="text" style="width: 45px;" name="attr_backpackequipmenttotalcost" title="repeating_backpackequipment_#_backpackequipmenttotalcost" value="0"></td> <td><input type="text" style="width: 40px;" name="attr_backpackequipmentweight" title="repeating_backpackequipment_#_backpackequipmentweight" value="0"></td> <td><input type="text" style="width: 40px;" name="attr_backpackequipmenttotalweight" title="repeating_backpackequipment_#_backpackequipmenttotalweight" value="0"></td> <td><input type="text" style="width: 30px;" name="attr_backpackequipmenthitpoints" title="repeating_backpackequipment_#_backpackequipmenthitpoints"></td> <td><input type="text" style="width: 30px;" name="attr_backpackequipmenthardness" title="repeating_backpackequipment_#_backpackequipmenthardness"></td> <td><input type="text" style="width: 90px;" name="attr_backpackequipmentlocation" title="repeating_backpackequipment_#_backpackequipmentlocation"></td> <td><textarea class="inputbox" rows="1" style="height: 22px; width: 205px; padding: 0px; border-style: none none solid none; border-width: 0px 0px 1px 0px; vertical-align: top;" name="attr_backpackequipmentnotes" title="repeating_backpackequipment_#_equipmentnotes"></textarea></td> </tr> </table> </fieldset> <table> <tr> <td style="width: 30px;"> </td> <td style="width: 90px;">   <span data-i18n="total-cost">Total Cost</span>:</td> <td><input type="text" style="width: 55px; text-align: right;" name="attr_backpacktotalequipmentcost" title="backpacktotalequipmentcost" value="0"/><span data-i18n="gold-pieces-i">gp</span>. </td> <td style="width: 25px;"> </td> <td style="width: 90px; text-align: right;" data-i18n="backpacktotal-weight">Total Weight:</td> <td><input type="text" style="width: 55px; text-align: right;" name="attr_backpacktotalequipmentweight" title="backpacktotalequipmentweight" value="0"/><span name="attr_weightunit" title="weightunit"></span>.   </td> <td style="width: 200px;"><select style="height: 24px; width: 160px; padding: 0px;" name="attr_backpackequipmentweightcopy" title="backpackequipmentweightcopy (If you change this input to Copied, the total weight will be copied to Weight Carried above. This is not reversable! If changed back, it will merely stop copying the weight but the original value will still be lost.)"> <option value="0" data-i18n="not-copied" selected>Not Copied</option> <option value="1" data-i18n="total-weight-copied">Total Weight Copied to Weight Carried</option> </select></td> </tr> </table> </div> <hr/> </div> <br> This calculates all weight for both sections (weapons and armor added to equipment coins added to backpack) on('change:repeating_equipment change:weapon1weight change:weapon2weight change:weapon3weight change:weapon4weight change:weapon5weight change:weapon6weight change:weapon7weight change:weapon8weight change:weapon9weight change:weapon10weight change:acitemweight change:shieldweight', function(){ TAS.repeating('equipment') .attrs('totalequipmentweight','totalequipmentcost','summary','weapon1weight','weapon2weight','weapon3weight','weapon4weight','weapon5weight','weapon6weight','weapon7weight','weapon8weight','weapon9weight','weapon10weight','acitemweight','shieldweight') .fields('equipmentname','equipmentquantity','equipmentweight','equipmenttotalweight','equipmentcost','equipmenttotalcost') .reduce(function(m,r){ m.equipmentweight+=(r.F.equipmentweight*r.I.equipmentquantity); r.D[3].equipmenttotalweight=(r.F.equipmentweight*r.I.equipmentquantity); m.equipmentcost+=(r.F.equipmentcost*r.I.equipmentquantity); r.D[2].equipmenttotalcost=(r.F.equipmentcost*r.I.equipmentquantity); m.desc.push(r.equipmentname+(r.I.equipmentquantity>1 ? ' (x'+r.S.equipmentquantity+')' : '')); return m; },{equipmentweight:0,equipmentcost:0, desc: []},function(m,r,a){ a.summary=m.desc.join(', '); console.log(`weapon1weight:${a.weapon1weight} weapon2weight:${a.weapon2weight}`); const weapon1weight =+ a.weapon1weight; const weapon2weight =+ a.weapon2weight; const weapon3weight =+ a.weapon3weight; const weapon4weight =+ a.weapon4weight; const weapon5weight =+ a.weapon5weight; const weapon6weight =+ a.weapon6weight; const weapon7weight =+ a.weapon7weight; const weapon8weight =+ a.weapon8weight; const weapon9weight =+ a.weapon9weight; const weapon10weight =+ a.weapon10weight; const acitemweight =+ a.acitemweight; const shieldweight =+ a.shieldweight; const totalweaponarmorWeight=(weapon1weight + weapon2weight + weapon3weight + weapon4weight + weapon5weight + weapon6weight + weapon7weight + weapon8weight + weapon9weight + weapon10weight + acitemweight + shieldweight); console.log(`totalweaponarmorWeight:${totalweaponarmorWeight}`); a.D[3].totalequipmentweight=m.equipmentweight + totalweaponarmorWeight; a.D[2].totalequipmentcost=m.equipmentcost; }) .execute(); }); ///backpack weight formula on('change:repeating_backpackequipment change:beads change:bits change:ceramic change:silver change:gold', function(){ TAS.repeating('backpackequipment') .attrs('backpacktotalequipmentweight','backpacktotalequipmentcost','summary','beads','bits','ceramic','silver','gold') .fields('backpackequipmentname','backpackequipmentquantity','backpackequipmentweight','backpackequipmenttotalweight','backpackequipmentcost','backpackequipmenttotalcost') .reduce(function(m,r){ m.backpackequipmentweight+=(r.F.backpackequipmentweight*r.I.backpackequipmentquantity); r.D[3].backpackequipmenttotalweight=(r.F.backpackequipmentweight*r.I.backpackequipmentquantity); m.backpackequipmentcost+=(r.F.backpackequipmentcost*r.I.backpackequipmentquantity); r.D[2].backpackequipmenttotalcost=(r.F.backpackequipmentcost*r.I.backpackequipmentquantity); m.desc.push(r.backpackequipmentname+(r.I.backpackequipmentquantity>1 ? ' (x'+r.S.backpackequipmentquantity+')' : '')); return m; },{backpackequipmentweight:0,backpackequipmentcost:0, desc: []},function(m,r,a){ a.summary=m.desc.join(', '); console.log(`beads:${a.beads} bits:${a.bits} ceramic:${a.ceramic} silver:${a.silver} gold:${a.gold} weapon1weight:${a.weapon1weight} weapon2weight:${a.weapon2weight}`); const beads =+ a.beads; const bits =+ a.bits; const ceramic =+ a.ceramic; const silver =+ a.silver; const gold =+ a.gold; const totalCurrencyWeight= (beads + bits + ceramic + silver + gold)/50; console.log(`totalCurrencyWeight:${totalCurrencyWeight}`); a.D[3].backpacktotalequipmentweight=m.backpackequipmentweight + totalCurrencyWeight; a.D[2].backpacktotalequipmentcost=m.backpackequipmentcost; }) .execute(); }); final equipment weight to copy calcs into 'weight carried' at top of encumbrance and load section // <!---- Copy weight from total equipment weight to total carried weight if wanted ----> on("change:totalequipmentweight change:backpacktotalequipmentweight change:equipmentweightcopy change:backpackequipmentweightcopy", function() { getAttrs(["totalequipmentweight", "equipmentweightcopy", "totalcarriedweight","backpacktotalequipmentweight","backpackequipmentweightcopy"], function(values) { setAttrs({ "totalcarriedweight": (parseInt(values.equipmentweightcopy,10) * parseInt(values.totalequipmentweight)) + ((1 - parseInt(values.equipmentweightcopy,10)) * parseFloat(values.totalcarriedweight)) + (parseInt(values.backpacktotalequipmentweight)*parseInt(values.backpackequipmentweightcopy)) }); }); });
1723035690
GiGs
Pro
Sheet Author
API Scripter
It's perfectly fine to share your code here. What I meant was that when you submit a sheet to be added to the dropdown when you create  new game, that everyone can use regardless of subscription level, the roll20 devs will reject ny sheet that uses tables for layout.