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

Show/Hide fields within a repeating section

1578001784
Kraynic
Pro
Sheet Author
I have been thinking of doing this to de-clutter a couple repeating sections on my Palladium sheet, but I'm not really sure how to go about it.  Does anyone know of any relatively simple sheets that I can look at for inspiration?  Looking at code from the "by Roll20" sheets is just making my eyes glaze over.
1578002638

Edited 1578002682
Joseph M.
Sheet Author
Alright the basic trick you want is checkboxes (which can be hidden or not), and this little bit of CSS In the HTML <input type="checkbox" class="sheet-foo"> <div class="sheet-bar"> {stuff you want to be hidden} </div> In the CSS .sheet-bar { display:none; } .sheet-foo:checked ~ .sheet-bar { display:flex; } You can edit the display:flex to whatever style you're using
1578002739
GiGs
Pro
Sheet Author
API Scripter
This is surprisingly easy. If you know how to do it outside a repeating section, its exactly the same process inside one.
1578003093
Kraynic
Pro
Sheet Author
Hmm, I've used sheet arrows and tabs, so I should be able to do so within the repeating sections.  Most likely I had some little typo keeping it from working, since I seemed to not be able to get the toggle working (either the fields I wanted to toggle were always visible or always hidden).  I'll have to tinker around a little more and post back if I am totally stumped again.
1578003165
GiGs
Pro
Sheet Author
API Scripter
Post the code you try if it doesnt work. It's a lot easier to tweak code to get it working, than it is to create new code from scratch that might not match what you need.
1578006492

Edited 1578006675
GiGs
Pro
Sheet Author
API Scripter
Here's an example from one of my sheets, where I had to fake a nested repeating section. basically its a repeating section for battles, each row of the section is one battle. But within each battle, i have to show details of each round. So I created a method to hide unused rounds. First I have a set of hiddent inputs to hold the value of a result attribute. Then in each div, I have that result also, to be picked by a drop down. When a result value is selected, the result attribute gets a value that starts with "turn-", and the CSS rule below makes the next row visible.                          <input class='sheet-battle-round-1' type='hidden' name='attr_result_1'>                         <input class='sheet-battle-round-2' type='hidden' name='attr_result_2'>                         <input class='sheet-battle-round-3' type='hidden' name='attr_result_3'>                                                      <div class='sheet-battle-turns-1'>                             <!-- snipped everything but the relevant row -->                             <select class='battle-input battle-result' type='text' name='attr_result_1'>                                 <option value="select" selected>Select</option>                                 <option value="turn-">---</option>                                 <option value="turn-triumph">Triumph</option>                                 <option value="turn-victory">Victory</option>                                 <option value="turn-defeat">Defeat</option>                                 <option value="turn-crush">Crush</option>                                 <option value="turn-disengaged">Disengage</option>                                 <option value="turn-extended">Extended</option>                             </select>                         </div>                         <div class='sheet-battle-turns-2'>                         <!-- and so on -->                         </div> CSS div.sheet-battle-turns-2, div.sheet-battle-turns-3, div.sheet-battle-turns-4 {     display: none; } input.sheet-battle-round-1[value^='turn-']~div.sheet-battle-turns-2, input.sheet-battle-round-2[value^='turn-']~div.sheet-battle-turns-3, input.sheet-battle-round-3[value^='turn-']~div.sheet-battle-turns-4 {     display: inline; } For your case, it's probably much simpler. You probably just need to do this: HTML <input type='checkbox' name='attr_toggle-section' value="1"> <!-- it doesnt need to be a checkbox --> <input class='sheet-section-toggle' type='hidden' name='attr_toggle-section'> <div class="sheet-section-hide"> <!-- whatever you want to hide here --> </div> CSS div.sheet-section-hide {     display: none; } input.sheet-section-toggle[value='1']~div.sheet-section-hide {     display: inline; } Each section will obey its own checkbox (or other input), thanks to the way the ~ selector works - each section is compartmentalised. You just have to make sure the input is on the same "level" as the div. I prefer testing the value, and using hidden attributes, rather than using the :checked attribute, because I'm not always using checkboxes. This method works whether you're using checkboxes, textboxes, or even selects.
1578015527
Kraynic
Pro
Sheet Author
Ok, I'm sure I am missing something really simple.  First, I want to show what I am doing and why in case there is a better way to go about this. My old repeating section (and the way it still is from the dropdown) looks like this (the dark green buttons are rolls): I recently realized I should really make the temporary bonuses into global bonus fields, which would allow me to free up some space and label the buttons better.  I have done this in a game I am running to test this setup: Since I am using attributes in the bonus fields, it would be nice if they were larger, so I have been thinking about moving at least the strike and parry bonus fields to another line and have it hidden.  Maybe the notes field as well.  Trying this (without the css line to hide the second section) with the test code gives me this: I am still doing something wrong because I can't get it to display with the checkbox.  Like I said, probably something painfully obvious that will make me feel silly once it is pointed out.  The code in the test game looks like this: HTML <div class='mattack-grid-container'> <h5>Weapon Name</h5> <div class='space-holder'></div> <div class='space-holder'></div> <div class='space-holder'></div> <h5>Damage</h5> <h5>Show Notes</h5> </div> <fieldset class="repeating_meleeattacks"> <div class='mattack-grid-container' > <input class='mattack-label' type="text" value="" title='Weapon name that will display in template header' name="attr_weapon_attack" placeholder="Weapon Name" /> <button class='meleedice' type='roll' title='Strike (Attack) Roll with Damage' name='roll_meleeattack' value="@{whispertoggle}&{template:custom} {{color=blue}} {{title=**@{character_name}**}} {{subtitle=attacks with @{weapon_attack}}} {{Attack= [[d20cs>@{hth_critical}+@{weapon_strike}+@{hth_strike}+@{pp_bonus}+@{mtemp_strike}]]}} {{Damage= [[@{weapon_damage}+@{hth_damage}+@{ps_bonus}+@{mtemp_damage}@{mounteddam}]]}} {{desc=@{mattack_reference}}}">Strike</button> <button class='meleedice' type='roll' title='Parry Roll' name='roll_meleeparry' value="@{whispertoggle}&{template:custom} {{color=grey}} {{title=**@{character_name}**}} {{subtitle=parries with @{weapon_attack}}} {{Parry= [[d20+@{weapon_parry}+@{hth_parry}+@{pp_bonus}+@{mtemp_parry}@{mountedpd}]]}}">Parry</button> <button class='meleedice' type='roll' title='Damage Roll' name='roll_meleedamage' value="@{whispertoggle}&{template:custom} {{color=red}} {{title=**@{character_name}**}} {{subtitle=lashes out}} {{@{character_name}'s @{weapon_attack} deals= [[@{weapon_damage}+@{hth_damage}+@{ps_bonus}+@{mtemp_damage}@{mounteddam}]]}} {{desc=@{mattack_reference}}}">Damage</button> <input class='damage-dice' type="text" title='Damage Dice Calculation other than HtH and PS' value="" name="attr_weapon_damage" placeholder="xdy+z" /> <input type='checkbox' name='attr_toggle-section' value="1"> <input class='mbonus-toggle' type='hidden' name='attr_toggle_mbonus'> <div class='mbonus-hide'> <div class='mbonus-container'> <input class='mattack-bonus' type='text' value='' title='Strike Bonuses other than HtH or PP' value="0" name="attr_weapon_strike" /> <input class='mattack-bonus' type="text" title='Parry Bonuses other than HtH or PP' value="0" name="attr_weapon_parry" /> <textarea class='mattack-notes' type="text" title='Special Note About This Attack' value="" name="attr_mattack_reference" ></textarea> </div> </div> </div> </fieldset> CSS .sheet-mattack-grid-container{ display:grid; align-items:center; grid-template-columns: 160px 80px 80px 80px 62px 75px } button[type=roll].sheet-meleedice::before { content: ''; } button[type=roll].sheet-rangeddice::before { content: ''; } .sheet-mattack-label, .sheet-rattack-label{ width: 160px; } .sheet-meleedice, .sheet-rangeddice{ background:#6b8a76; color:#ebebeb; } .sheet-damage-dice{ width: 60px; } div.sheet-mbonus-hide { display: none; } input.sheet-mbonus-toggle[value='1']~div.sheet-mbonus-hide { display: block; } .sheet-mbonus-container{ display:grid; align-items:center; grid-template-columns: 213px 213px 350px } .sheet-mattack-text, .sheet-rattack-text{ width: 38px; } .sheet-mattack-notes{ height:18px; width:190px; margin:0px; } Part of the reason for all this is that the old version of Palladium Fantasy that I run has quite a list of weapon proficiencies with different bonus progressions for strike, parry, and thrown rolls.  Rather than trying to build them all into the sheet, I have just used a repeating section to list the proficiencies.  I used to just enter the number from the corresponding proficiency in the strike or parry bonus repeating attack fields.  Then I realized I could just enter the attribute from the proficiency repeating section and only need to enter/update that number once.  The problem is that at times you may (especially with ranged weapons) have 2 repeating attributes to enter, and maybe a regular numerical bonus as well. A larger field of view would be nice in that case. All that is to say this is purely cosmetic.  The sheet is working as it should.  If there is something else I should consider trying as far as displaying this stuff, let me know.
1578017593
GiGs
Pro
Sheet Author
API Scripter
Looks like this is the problem:         <input type='checkbox' name='attr_toggle-section' value="1"> <input class='mbonus-toggle' type='hidden' name='attr_toggle_mbonus'> The names of the two must be identical. The hidden input is a copy of the checkbox, so needs the same name. This should be         <input type='checkbox' name='attr_toggle_mbonus' value="1"> <input class='mbonus-toggle' type='hidden' name='attr_toggle_mbonus'> Note that the attribute name isn't important - it's only important that they be identical. The hidden attribite is taking the value of the checkbox. It's kind of weird, but its because of the way roll20 handles inputs - only hidden inputs work properly for this, so you need a hidden copy of the visible attribute for the CSS to work with.
1578017766
GiGs
Pro
Sheet Author
API Scripter
Regarding your displayed bonuses in the strike and parry columns: Those numbers : I wouldnt display the attribute bonuses there. I'd use a sheet worker to retrieve the values, and just list the actual number they resolve to. Though I dont know how they are selected, so that might be tricky.
1578026998
Kraynic
Pro
Sheet Author
Well, I said it would be something silly I was overlooking.  I had not saved my last attempt, so I took your code as a template and thought I renamed everything to match....  Yeah, it works just fine now. On the sheetworkers, it might not be worth the effort, but maybe it is more simple than I think.  First off, I assume if I used sheet workers, I would need a hidden attribute that the button macros used, because the field I am entering them into is also for any item specific (enchantment, exceptional workmanship, etc) bonuses.  That is why the "Long Rest" short spear has a 1+ the repeating section attribute to call the skill bonuses for strike and parry.  I have a separate repeating section for thrown/missile weapons because they don't use most of the bonus structure that melee combat uses, so thrown weapons (with applicable proficiency bonus) would end up there along with bows, slings, etc. The weapon proficiency list is not incredibly long, but not short either: Paired weapons is the only one that doesn't include bonuses that would need pulled somewhere.  Targeting is a general skill dealing with gauging distance and wind and applies to anything thrown or fired.  That means that most serious archers or knife throwers will have 2 proficiencies to be pulling bonuses from on the same attack roll. A look at how I have those displayed at the moment: At this point, I'm not certain I would want to build the bonuses into the sheet.  At this point, there are 3 (including mine) sheets for Palladium system games and out of those 3, 1 has no built-in rolls and can only be used for display, and the other (which has some roll buttons) isn't coded right for the rolls to be dragged out to the quick macro bar.  In a pinch, I'm pretty sure people could play the 2E fantasy game, though I run and created this one for 1E.  Allowing people to enter the proficiency numbers allows people to use this sheet for a different but similar game.  It also allows for the home brew or allowing people to get extra training to boost proficiency bonuses. If it is possible (and I can understand how to implement it) to build sheet workers that would be able to be pointed at repeating proficiencies, pull and add one or 2 bonuses to an attribute, and still allow people to manually enter/edit the proficiency bonuses, I would be interested in hearing about it.  Although, I may very well just keep adding the repeating attributes, because I understand how those work...  :p
1578030237
GiGs
Pro
Sheet Author
API Scripter
If you use repeating sections for the proficiencies, you could use a sheet worker to grab the bonus from there. But yes, its a bit tricky (needing to make sure people enter the same text and spelling is always a bit risky). Though that might be better than expecting players to enter a repeating section name in the attribute bonus you have above. For melee weapons, you'd need columns for Weapon (type=text) - a name to use in roll printouts Proficiency (type=text) - the name used to identify which row to use from the Proficiency repeating section Special/Magic (type=number) - a column for any bonuses for this specific weapon on top of proficiency Strike (type=number) - the strike bonus, calculated by sheet worker Parry (type=number) - etc Throw (type=number) - etc Range (type=number) - etc You dont need level in this section, because its (presumably) in the repeating section.  Ranged weapons would work on the same principle with some tweaked details. It is more complicated to program initially, but once set up would be pretty robust.
1578034752
Kraynic
Pro
Sheet Author
Yeah, I don't have players put in the repeating section attributes.  I do that myself and have them just keep up with the proficiency bonuses.  I do have them posted in the wiki for the sheet in case anyone else wants to use it though, so they can be copy/pasted in and then the row number changed as needed.  Yes, level can stay in the repeating section.  You gain skills at various times, but each time you pick up new ones, they start out at level 1 and gain a level each time you do.  The level is just to be sure to be looking at the correct level advancement row on the chart for that weapon type. Rather than depend on spelling, would it be possible to just enter a row number for the sheetworker to point it to the right row?
1578041194
GiGs
Pro
Sheet Author
API Scripter
what does your proficiency repeating section look like?
1578065953
Kraynic
Pro
Sheet Author
HTML <div class="melee-proficiency-panel"> <input type="checkbox" name="attr_melee_weapon-toggle" class="sheet-arrow" /> <h4>Melee Weapon Proficencies</h4> <div class="body"> <div class='melee-grid-container' > <h5>Weapon</h5> <h5>Skill Lvl</h5> <h5>Strike</h5> <h5>Parry</h5> <h5>Throw</h5> <h5>Range</h5> </div> <fieldset class="repeating_weaponmelee"> <div class='melee-grid-container' > <input class='melee-field' type="text" value="" name="attr_melee_weapon_name" placeholder="Weapon Type" /> <input class='melee-field' type="number" title='Proficiency Skill Level' value="1" name="attr_melee_weapon_skill_level" /> <input class='melee-field' type="number" title='Proficiency Strike Bonus' value="0" name="attr_melee_weapon_strike" /> <input class='melee-field' type="number" title='Proficiency Parry Bonus' value="0" name="attr_melee_weapon_parry" /> <input class='melee-field' type="number" title='Proficiency Throw Bonus' value="0" name="attr_melee_weapon_throw" /> <input class='melee-field' type="number" title='Proficiency Throw Range (if any)' value="0" name="attr_melee_weapon_range" /> </div> </fieldset> </div> </div> <div class="ranged-proficiency-panel"> <input type="checkbox" name="attr_ranged_weapon-toggle" class="sheet-arrow" /> <h4>Ranged Weapon Proficencies</h4> <div class="body"> <div class='ranged-grid-container'> <h5>Weapon</h5> <h5>Skill Lvl</h5> <h5>Strike</h5> <h5>RoF</h5> <h5>Range</h5> </div> <fieldset class="repeating_rangedmelee"> <div class='ranged-grid-container' > <input class='ranged-field' type="text" value="" name="attr_ranged_weapon_name" placeholder="Weapon Type" /> <input class='ranged-field' type="number" title='Proficiency Skill Level' value="1" name="attr_ranged_weapon_skill_level" /> <input class='ranged-field' type="number" title='Proficiency Strike Bonus' value="0" name="attr_ranged_weapon_strike" /> <input class='ranged-field' type="number" title='Proficiency Rate of Fire' value="0" name="attr_ranged_weapon_parry" /> <input class='ranged-field' type="number" title='Proficiency Max Firing Distance' value="0" name="attr_ranged_weapon_range" /> </div> </fieldset> </div> </div> If a numeric label would be easier for people to match, there is plenty of room on these rows to add another field (maybe before the name) for a row identifier that could be matched somehow in the repeating attacks.
1578138409
GiGs
Pro
Sheet Author
API Scripter
Whats the code for this section (and for the ranged equivalent)?
1578164431
Kraynic
Pro
Sheet Author
That section and ranged from github: <div class="melee-attack-panel"> <input type="checkbox" name="attr_melee_attacks-toggle" class="sheet-arrow" /> <h4>Melee Attacks</h4> <div class="body"> <div class="attackoptions-container"> <h4>Melee Options:</h4> <h5>Parry/Dodge:</h5> <div class="mountparry-container"> <input type="radio" class="ctoggle-left" name="attr_mountedpd" title="No extra bonuses" value="" checked="checked"><span title="On Foot"></span> <input type="radio" class="ctoggle-right" name="attr_mountedpd" title="Adds mounted parry/dodge to parry and dodge rolls" value="+@{hth_mountedparrydodge}"><span title="Mounted"></span> </div> <h5>Damage:</h5> <div class="mountdamage-container"> <input type="radio" class="ctoggle-left" name="attr_mounteddam" title="No extra bonuses" value="" checked="checked"><span title="On Foot"></span> <input type="radio" class="ctoggle-middle" name="attr_mounteddam" title="Adds mounted damage to melee damage rolls" value="+@{hth_mounteddamage}"><span title="Mounted"></span> <input type="radio" class="ctoggle-right" name="attr_mounteddam" title="Adds mounted charge damage to melee damage rolls" value="+@{hth_chargedamage}"><span title="Charge"></span> </div> </div> <div class='mattack-grid-container' > <h5>Weapon</h5> <div class='space-holder'></div> <h5>Strike</h5> <h5>Temp</h5> <div class='space-holder'></div> <h5>Parry</h5> <h5>Temp</h5> <div class='space-holder'></div> <h5>Damage</h5> <h5>Temp</h5> <h5>Notes</h5> </div> <fieldset class="repeating_meleeattacks"> <div class='mattack-grid-container' > <input class='mattack-label' type="text" value="" name="attr_weapon_attack" placeholder="Weapon Name" /> <button class='meleedice' type='roll' title='Strike (Attack) Roll with Damage' name='roll_meleeattack' value="@{whispertoggle}&{template:custom} {{color=blue}} {{title=**@{character_name}**}} {{subtitle=attacks with @{weapon_attack}}} {{Attack= [[d20cs>@{hth_critical}+@{weapon_strike}+@{hth_strike}+@{pp_bonus}+@{temp_strike}]]}} {{Damage= [[@{weapon_damage}+@{hth_damage}+@{ps_bonus}+@{temp_damage}@{mounteddam}]]}} {{desc=@{mattack_reference}}}">S</button> <input class='mattack-text' type="text" title='Strike Bonuses other than HtH or PP' value="0" name="attr_weapon_strike" /> <input class='mattack-text' type="text" title='Temporary Strike Bonuses' value="0" name="attr_temp_strike" /> <button class='meleedice' type='roll' title='Parry Roll' name='roll_meleeparry' value="@{whispertoggle}&{template:custom} {{color=grey}} {{title=**@{character_name}**}} {{subtitle=parries with @{weapon_attack}}} {{Parry= [[d20+@{weapon_parry}+@{hth_parry}+@{pp_bonus}+@{temp_parry}@{mountedpd}]]}}">P</button> <input class='mattack-text' type="text" title='Parry Bonuses other than HtH or PP' value="0" name="attr_weapon_parry" /> <input class='mattack-text' type="text" title='Temporary Parry Bonuses' value="0" name="attr_temp_parry" /> <button class='meleedice' type='roll' title='Damage Roll' name='roll_meleedamage' value="@{whispertoggle}&{template:custom} {{color=red}} {{title=**@{character_name}**}} {{subtitle=lashes out}} {{@{character_name}'s @{weapon_attack} deals= [[@{weapon_damage}+@{hth_damage}+@{ps_bonus}+@{temp_damage}@{mounteddam}]]}} {{desc=@{mattack_reference}}}">D</button> <input class='damage-dice' type="text" title='Damage Dice Calculation other than HtH and PS' value="" name="attr_weapon_damage" placeholder="xdy+z" /> <input class='mattack-text' type="text" title='Temporary Damage Bonuses' value="0" name="attr_temp_damage" /> <input class='mattack-notes' type="text" title='Special Note About This Attack' value="" name="attr_mattack_reference" /> </div> </fieldset> </div> </div> <div class="ranged-attack-panel"> <input type="checkbox" name="attr_ranged_attacks-toggle" class="sheet-arrow" /> <h4>Ranged or Magical Attacks</h4> <div class="body"> <div class='rattack-grid-container' > <h5>Weapon</h5> <div class='space-holder'></div> <h5>Strike</h5> <h5>Temp</h5> <div class='space-holder'></div> <h5>Damage</h5> <h5>Temp</h5> <h5>Range</h5> <h5>RoF</h5> <h5>Ammo</h5> <h5>Notes</h5> </div> <fieldset class="repeating_rangedattacks"> <div class='rattack-grid-container' > <input class='rattack-label' type="text" value="" name="attr_weapon_attack" placeholder="Weapon Name" /> <button class='rangeddice' type='roll' title='Strike (Attack) Roll with Damage' name='roll_rangedattack' value="@{whispertoggle}&{template:custom} {{color=blue}} {{title=**@{character_name}**}} {{subtitle=attacks with @{weapon_attack}}} {{Attack= [[d20cs>@{hth_ranged_critical}+@{weapon_strike}+@{temp_strike}]]}} {{Damage= [[@{weapon_damage}+@{temp_damage}]]}} {{desc=@{attack_reference}}}">S</button> <input class='rattack-text' type="text" title='Bonuses to Strike' value="0" name="attr_weapon_strike" /> <input class='rattack-text' type="text" title='Temporary Strike Bonuses' value="0" name="attr_temp_strike" /> <button class='rangeddice' type='roll' title='Damage Roll Alone' name='roll_rangeddamage' value="@{whispertoggle}&{template:custom} {{color=red}} {{title=**@{character_name}**}} {{subtitle=hits with @{weapon_attack}}} {{@{character_name}'s @{weapon_attack} deals= [[@{weapon_damage}+@{temp_damage}]]}} {{desc=@{attack_reference}}}">D</button> <input class='damage-dice' type="text" title='Damage Dice Calculation' value="" name="attr_weapon_damage" placeholder="xdy+z" /> <input class='rattack-text' type="text" title='Temporary Damage Bonuses' value="0" name="attr_temp_damage" /> <input class='rattack-text' type="text" title='Maximum Range of This Attack' value="" name="attr_weapon_range" /> <input class='rattack-text' type="text" title='Rate of Fire per Melee' value="1" name="attr_weapon_rate_of_fire" /> <input class='rattack-text' type='text' title='Ammunition' value='0' name='attr_ammunition' /> <input class='rattack-notes' type="text" title='Special Note About This Attack' value="" name="attr_attack_reference" /> </div> </fieldset> </div> </div> It has changed a little in my custom game based on stuff in this thread.  One thing that is different is that I removed the temporary bonus in the repeating section.  It was intended as short term global bonuses, so I have moved them to their own place where they modify all rolls of their type (strike/parry/damage) in the their specific section (melee/ranged).  In the game where I inflict my changes on players for testing, it looks like this: <div class="melee-attack-panel"> <input type="checkbox" name="attr_melee_attacks-toggle" class="sheet-arrow" /> <h4>Melee Attacks</h4> <div class="body"> <div class='meleetemp-container'> <h4>Temporary Bonuses:</h4> <h5>Strike:</h5> <input class='mattack-text' type="text" title='Temporary Melee Strike Bonuses' value="0" name="attr_mtemp_strike" /> <h5>Parry:</h5> <input class='mattack-text' type="text" title='Temporary Melee Parry Bonuses' value="0" name="attr_mtemp_parry" /> <h5>Damage:</h5> <input class='mattack-text' type="text" title='Temporary Melee Damage Bonuses' value="0" name="attr_mtemp_damage" /> </div> <div class="attackoptions-container"> <h4>Melee Options:</h4> <h5>Parry/Dodge:</h5> <div class="mountparry-container"> <input type="radio" class="ctoggle-left" name="attr_mountedpd" title="No extra bonuses" value="" checked="checked"><span title="On Foot"></span> <input type="radio" class="ctoggle-right" name="attr_mountedpd" title="Adds mounted parry/dodge to parry and dodge rolls" value="+@{hth_mountedparrydodge}"><span title="Mounted"></span> </div> <h5>Damage:</h5> <div class="mountdamage-container"> <input type="radio" class="ctoggle-left" name="attr_mounteddam" title="No extra bonuses" value="" checked="checked"><span title="On Foot"></span> <input type="radio" class="ctoggle-middle" name="attr_mounteddam" title="Adds mounted damage to melee damage rolls" value="+@{hth_mounteddamage}"><span title="Mounted"></span> <input type="radio" class="ctoggle-right" name="attr_mounteddam" title="Adds mounted charge damage to melee damage rolls" value="+@{hth_chargedamage}"><span title="Charge"></span> </div> </div> <div class='mattack-grid-container'> <h5>Weapon Name</h5> <div class='space-holder'></div> <div class='space-holder'></div> <div class='space-holder'></div> <h5>Damage</h5> <div class='space-holder'></div> </div> <fieldset class="repeating_meleeattacks"> <div class='mattack-grid-container' > <input class='mattack-label' type="text" value="" title='Weapon name that will display in template header' name="attr_weapon_attack" placeholder="Weapon Name" /> <button class='meleedice' type='roll' title='Strike (Attack) Roll with Damage' name='roll_meleeattack' value="@{whispertoggle}&{template:custom} {{color=blue}} {{title=**@{character_name}**}} {{subtitle=attacks with @{weapon_attack}}} {{Attack= [[d20cs>@{hth_critical}+@{weapon_strike}+@{hth_strike}+@{pp_bonus}+@{mtemp_strike}]]}} {{Damage= [[@{weapon_damage}+@{hth_damage}+@{ps_bonus}+@{mtemp_damage}@{mounteddam}]]}} {{desc=@{mattack_reference}}}">Strike</button> <button class='meleedice' type='roll' title='Parry Roll' name='roll_meleeparry' value="@{whispertoggle}&{template:custom} {{color=grey}} {{title=**@{character_name}**}} {{subtitle=parries with @{weapon_attack}}} {{Parry= [[d20+@{weapon_parry}+@{hth_parry}+@{pp_bonus}+@{mtemp_parry}@{mountedpd}]]}}">Parry</button> <button class='meleedice' type='roll' title='Damage Roll' name='roll_meleedamage' value="@{whispertoggle}&{template:custom} {{color=red}} {{title=**@{character_name}**}} {{subtitle=lashes out}} {{@{character_name}'s @{weapon_attack} deals= [[@{weapon_damage}+@{hth_damage}+@{ps_bonus}+@{mtemp_damage}@{mounteddam}]]}} {{desc=@{mattack_reference}}}">Damage</button> <input class='damage-dice' type="text" title='Damage Dice Calculation other than HtH and PS' value="" name="attr_weapon_damage" placeholder="xdy+z" /> <input type='checkbox' title='Show Bonus and Notes Fields' name='attr_toggle_mbonus' value="1"> <input class='mbonus-toggle' type='hidden' name='attr_toggle_mbonus'> <div class='mbonus-hide'> <div class='mbonus-container'> <input class='mattack-bonus' type='text' value='' title='Strike Bonuses other than HtH or PP' value="0" name="attr_weapon_strike" /> <input class='mattack-bonus' type="text" title='Parry Bonuses other than HtH or PP' value="0" name="attr_weapon_parry" /> <textarea class='mattack-notes' type="text" title='Special Note About This Attack' value="" name="attr_mattack_reference" ></textarea> </div> </div> </div> </fieldset> </div> </div> <div class="ranged-attack-panel"> <input type="checkbox" name="attr_ranged_attacks-toggle" class="sheet-arrow" /> <h4>Ranged or Magical Attacks</h4> <div class="body"> <div class='rangedtemp-container'> <h4>Temporary Bonuses:</h4> <h5>Strike:</h5> <input class='rattack-text' type="text" title='Temporary Ranged Strike Bonuses' value="0" name="attr_rtemp_strike" /> <h5>Damage:</h5> <input class='rattack-text' type="text" title='Temporary Ranged Damage Bonuses' value="0" name="attr_rtemp_damage" /> </div> <div class='rattack-grid-container' > <h5>Weapon Name</h5> <div class='space-holder'></div> <div class='space-holder'></div> <h5>Damage</h5> <h5>Range</h5> <h5>RoF</h5> <h5>Ammo</h5> <div class='space-holder'></div> </div> <fieldset class="repeating_rangedattacks"> <div class='rattack-grid-container' > <input class='rattack-label' type="text" title='Weapon name that will display in template header' value="" name="attr_weapon_attack" placeholder="Weapon Name" /> <button class='rangeddice' type='roll' title='Strike (Attack) Roll with Damage' name='roll_rangedattack' value="@{whispertoggle}&{template:custom} {{color=blue}} {{title=**@{character_name}**}} {{subtitle=attacks with @{weapon_attack}}} {{Attack= [[d20cs>@{hth_ranged_critical}+@{weapon_strike}+@{rtemp_strike}]]}} {{Damage= [[@{weapon_damage}+@{rtemp_damage}]]}} {{desc=@{attack_reference}}}">Strike</button> <button class='rangeddice' type='roll' title='Damage Roll Alone' name='roll_rangeddamage' value="@{whispertoggle}&{template:custom} {{color=red}} {{title=**@{character_name}**}} {{subtitle=hits with @{weapon_attack}}} {{@{character_name}'s @{weapon_attack} deals= [[@{weapon_damage}+@{rtemp_damage}]]}} {{desc=@{attack_reference}}}">Damage</button> <input class='damage-dice' type="text" title='Damage Dice Calculation' value="" name="attr_weapon_damage" placeholder="xdy+z" /> <input class='rattack-text' type="text" title='Maximum Range of This Attack' value="" name="attr_weapon_range" /> <input class='rattack-text' type="text" title='Rate of Fire per Melee' value="1" name="attr_weapon_rate_of_fire" /> <input class='rattack-text' type='text' title='Ammunition' value='0' name='attr_ammunition' /> <input type='checkbox' title='Show Bonus and Notes Fields' name='attr_toggle_rbonus' value="1"> <input class='rbonus-toggle' type='hidden' name='attr_toggle_rbonus'> <div class='rbonus-hide'> <div class='rbonus-container'> <input class='rattack-bonus' type="text" title='Bonuses to Strike' value="0" name="attr_weapon_strike" /> <textarea class='rattack-notes' title='Special Note About This Attack' value="" name="attr_attack_reference" ></textarea> </div> </div> </div> </fieldset> </div> </div> I'm assuming that there will be an added attribute or 2 for each type of bonus that will need to be incorporated into the roll button macros no matter which version I end up using on github.
1578189470
GiGs
Pro
Sheet Author
API Scripter
What does this mean? 'Strike Bonuses other than HtH or PP' I thought those attributes where your proficiency bonuses? Where do the proficiency bonuses go?
1578194602

Edited 1578195871
Kraynic
Pro
Sheet Author
PP=Physical Prowess, which is basically dexterity.  If it is high enough, that gives bonuses to strike, parry, and dodge.  The roll buttom macros already check an attribute that is 0 by default, but is populated with a bonus from a sheetworker if the stat is high enough. Hand to Hand is your basic combat training.  They apply whether you are fighting with a weapon, or just picked up a bar stool.  The various hand to hand combat skill bonuses are already pulled in from their section by the roll button macros. Weapon proficiencies are skills spent gaining extra bonuses with specific weapon types.  They are totally separate from the combat training, and stack on top of it if you have specialized weapon training (not all characters will). That mouse over title was put there to make sure people knew that those 2 bonuses are already covered.  Anything outside the hand to hand combat skill and your stat bonus can be put in there the way it is now.  This would be weapon proficiency bonuses, bonuses from exceptional craftsmanship of the weapon, and weapon enchantments (though those are fairly rare).  That is why I said that if a sheetworker is created to insert these weapon proficiency bonuses somewhere, a new attribute would need to be created for them, or a new one for any bonuses build into the weapon itself (craftsmanship and/or enchantment) would need to be created, because all 3 of those are using that one field at the moment. Edit:  I should probably add that the temp bonus field that I moved out of the repeating section is intended for short term spell or ability effects.
1578197800
GiGs
Pro
Sheet Author
API Scripter
 That is why I said that if a sheetworker is created to insert these weapon proficiency bonuses somewhere, a new attribute would need to be created for them, or a new one for any bonuses build into the weapon itself (craftsmanship and/or enchantment) would need to be created, because all 3 of those are using that one field at the moment. I see what you mean by that now. To be honest, I think you should do that anyway, even without a sheet worker. Having the weapon's quality bonus should be separate from the character's skill bonus, because it simplifies upgrading when skill increases, or they (if possible) modify the weapon. So it looks like (for melee weapons) you have all these bonuses:  PP Bonus: a stat bonus HTH: a general ocmbat skill bonus Proficiency: the skill bonus from training in specific weapons Item Quality: whether magic, or otherwise Temp: any temporary bonus not covered by the above, like buffs. Thing is, I think players would like to see the total of all those bonuses on their character sheet next to their weapon, and not have to hit the attack or parry bonus to see what it is. So my suggestion would be to use your idea of having a hidden section to store extra details, but what I'd do is have the fiollowing: Visible Row: Weapon Name, Temp strike, Total Strike, Temp Parry, Total Parry, Temp Damage, Total Damage Note that you can combine a button and span, so the Total Strike, Total Parry, and Total Damage could be buttons. They display the total but arent editable, and the user clicks them to trigger the macro. Hidden Row: You arent limited to having just one row. You could have a complete breakdown of what makes the weapons abilities, including  Weapon Proficiency name (used for matching on the proficiency section) Item Quality,  Different Attack, Parry, Damage modifiers A textArea for weapon notes the players might want to keep track of, including say a description. It's up to you how detailed or minimal you want to be there, but I do recommend separating proficiency and item quality, and having a box for proficiency name separate from the weapon name (to account for named or special weapons).  The total bonus for each can be calculated via autocalc or sheet worker (my preference), adding up the various bits, because players like to see their totals. All of that's a bit of a digression from the thread. Back to the topic: Assuming you go the route of having separate item quality and proficiency bonuses (whether or not you do any of the above), and have a box for the name of the proficiency, I can create a couple of sheet workers to calculate these. A sheet worker for your proficiency section. Whenever you change an attack or parry bonus, the worker is triggered, gets the name of the proficiency, and the bonus that just changed. Then it looks at your weapon list, and finds every weapon that is using the same proficiency name, and updates its proficiency bonus. A second sheet worker for the weapon section: whenever you add a new weapon and enter its proficiency, it is triggered, and looks in the proficiency section, finds the attack and parry bonuses and inserts them for this new weapon. The proficiency name could be an abbreviation or number, to keep the box size small - it doesnt matter what it is, as long as there's an identical identifier in the proficiencies section. (You could add that, so proficiencies might have an extra column for the abbreviation identifier: eg Proficience Name: Crossbow, ID: xb.) Would you want to use that approach?
1578205988
Kraynic
Pro
Sheet Author
I had a big reply started, and then had a power outage for an hour or so and now it is late.  I'll try again tomorrow when I might be more with it.
1578277370

Edited 1578277413
Kraynic
Pro
Sheet Author
To be honest, I never thought about displaying a total.  This is probably because the weapon proficiency bonuses, hand to hand combat bonuses, and the auto-calculated attribute based bonus are all displayed together on another tab.  The only bonuses that would be new (to the player) in this section are weapon specific.  It might be good to have that displayed though.  I'm still not sure it is worth having 2 separate entries for weapon quality and enchantments.  This is because the high quality weapons can only be manufactured by 2 races, one of which has limited surface world contact and the other has very low population, making those weapons not very common.  I can only think of 2 enchantments that are just a modifier to damage.  The rest of the enchantments that change damage are situational and will be entered in attack notes (like Demon Slayer: double damage dealt to demons).  Enchantments that add modifiers to strike or parry simply don't exist outside of homebrew or rune items (equivalent to the D&D artifacts).  Basically, a great deal of the time weapon based modifiers just won't exist.  The game generally can run just fine with normal quality weapons, so there isn't an "improvement treadmill" that players have to follow.  For the few enemies that require a magic weapon there is a budget enchantment that does nothing other than change the color of its material components that poor PCs can use to overcome that resistance. If a script is created to track and add all the modifiers, will it require a change to how I have the combat bonuses to horsemanship set up?  At the moment, these are just toggles that add or remove attribute calls from the roll button macros: <div class="attackoptions-container"> <h4>Melee Options:</h4> <h5>Parry/Dodge:</h5> <div class="mountparry-container"> <input type="radio" class="ctoggle-left" name="attr_mountedpd" title="No extra bonuses" value="" checked="checked"><span title="On Foot"></span> <input type="radio" class="ctoggle-right" name="attr_mountedpd" title="Adds mounted parry/dodge to parry and dodge rolls" value="+@{hth_mountedparrydodge}"><span title="Mounted"></span> </div> <h5>Damage:</h5> <div class="mountdamage-container"> <input type="radio" class="ctoggle-left" name="attr_mounteddam" title="No extra bonuses" value="" checked="checked"><span title="On Foot"></span> <input type="radio" class="ctoggle-middle" name="attr_mounteddam" title="Adds mounted damage to melee damage rolls" value="+@{hth_mounteddamage}"><span title="Mounted"></span> <input type="radio" class="ctoggle-right" name="attr_mounteddam" title="Adds mounted charge damage to melee damage rolls" value="+@{hth_chargedamage}"><span title="Charge"></span> </div> </div> To give the correct total, these would need to be added and removed from the calculation depending on what is checked. As far as the display of the roll buttons goes, I have one player that is always asking what each of the buttons do or clarifying which one to click when I ask for something, so that is why I have moved to a full word big label on all the buttons in these combat repeating sections.  I'm not sure I am willing to move away from that if the labeling will be less clear.  I'm open to seeing what it would turn out like though. While it is ugly, and I'm not sure I like how/where it is displayed at the moment (something I can deal with as time goes on), I will probably go ahead and do away with the temporary bonuses within the repeating section.  If they are there, they should just be mirrored from somewhere outside the repeating section.  I originally intended for them to be used for short term spell/potion effects, penalties when fighting someone you can't see, etc.  I think it was a mistake for me to put them in the repeating section to begin with instead of making them as a modifier that affects the whole section but only has to be entered once.  My current test game has the following above the melee section: <div class='meleetemp-container'> <h4>Temporary Bonuses:</h4> <h5>Strike:</h5> <input class='mattack-text' type="text" title='Temporary Melee Strike Bonuses' value="0" name="attr_mtemp_strike" /> <h5>Parry:</h5> <input class='mattack-text' type="text" title='Temporary Melee Parry Bonuses' value="0" name="attr_mtemp_parry" /> <h5>Damage:</h5> <input class='mattack-text' type="text" title='Temporary Melee Damage Bonuses' value="0" name="attr_mtemp_damage" /> </div> And ranged: <div class='rangedtemp-container'> <h4>Temporary Bonuses:</h4> <h5>Strike:</h5> <input class='rattack-text' type="text" title='Temporary Ranged Strike Bonuses' value="0" name="attr_rtemp_strike" /> <h5>Damage:</h5> <input class='rattack-text' type="text" title='Temporary Ranged Damage Bonuses' value="0" name="attr_rtemp_damage" /> </div> That would remove those fields from the repeating sections, and keep people from having to put a temporary global melee or ranged bonus into each attack as it gets used (and having to remove all of them after it is gone). I should probably mention that dodge is in a separate (though nearby) section of the sheet.  It is used as little as possible because it replaces one of your attacks for the round, whereas parry does not.  It only has 2 possible modifiers (I guess 1 class gives a 3rd).  I don't think it is worth totaling that for display, and I would have to find another (probably more out of the way) place to put it if another field was added. I think the abbreviation sounds good for identifiers. That would keep people from having to keep spelling/capitalization identical on longer words/titles between the 2 sections.  I'm tempted to say a dropdown could be set up, but then I would have to guess how many entries would have to be made to keep everyone covered. Overall, this sounds like a neat thing to try to implement.  Since you would be doing the hard work, I will leave it up to you as to whether you have the time/energy to create the scripts. 
1578283629
GiGs
Pro
Sheet Author
API Scripter
Kraynic  said: I'm still not sure it is worth having 2 separate entries for weapon quality and enchantments.   Just to clarify: I wasn't suggesting having separate boxes for quality and enchantment. But separate boxes for (1) proficiency, and (2) weapon quality (including enchantments). In your button rolls, this would be simple to adjust - just add in an extra attribute reference for the proficiency bonus to the calculations. Regarding horse modifiers: i think that should be fine. You can leave the button code the same (with the addition of above); the total modifier on the sheet is just for player reference. Lots of sheets have the total calculated for display purposes, but in the roll buttons, dont use that total, but add up the individual bits again - this is so when a roll is made, people can hover over it and see what went into the roll. Regarding the temporary bonuses: that makes sense to just use the one set of boxes outside the repeating sections. The bonus they give can easily be included in the total, or the roll, without needing to be within the repeating section. Kraynic said: Overall, this sounds like a neat thing to try to implement.  Since you would be doing the hard work, I will leave it up to you as to whether you have the time/energy to create the scripts.   I'll see what I can do, I might have more questions :)