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 building help request - issue with roll button in repeating section not being draggable to macro bar

1625931257
Olaf
Pro
Sheet Author
I hope one of the more experienced sheet builders is able to help me out as I can't figure this one out: I have a repeating section (weapons) on my sheet that is repeated in two locations: once for the character tab and once for the inventory section. On the inventory section the inputs are editable, on the character tab most inputs (except the "equipped"  checkbox) are read-only. At the moment I have the roll buttons on the character tab. They have an issue as they can not be drag-and-dropped to the macro quick bar. Doing so and clicking on the resulting macro button results in a "No ability was found for %{Snorri|repeating_weapon_weaponamlcheck}  "  I checked the buttons and I can't find what's wrong with them. I tried searching the forums, found some references to capitals and such so set the name etc to lowercase but nothing I've found seems to help. Also, when I copy the code for the roll button to the second instance of the repeating section on the inventory tab (line 1872 and beyond in the full code), the drag-and-drop DOES work... SO I'm stumped what's going wrong. The code for the weapons section including the repeating section where the buttons won't drag and drop: <div class='character-grid-section carriedweapons weapons-grid colored-grid'> <div class="skill-section-title">CARRIED MELEE WEAPONS</div> <div class="skill-header weapon-label">Weapon</div> <div class="skill-header skill-value harntooltip" data-tooltiptext="Equipped?">E</div> <div class="skill-header skill-value">WGT</div> <div class="skill-header skill-value">WQ</div> <div class="skill-header skill-value"> </div> <div class="skill-header skill-value">ATK</div> <div class="skill-header skill-value">DEF</div> <div class="skill-header skill-value">HM</div> <div class="skill-header skill-value"> </div> <div class="skill-header skill-value">B</div> <div class="skill-header skill-value">E</div> <div class="skill-header skill-value">P</div> <div class="skill-header skill-value">F</div> <div class="skill-header skill-value">ML</div> <div class="skill-header skill-value">AML</div> <div class="skill-header skill-value"> </div> <div class="skill-header skill-value">DML</div> <div class="skill-header skill-value"> </div> <div class="skill-header skill-label">Note</div> <input type="text" name="attr_punch_weapon_name" class="weapon-label" disabled="true" value="Punch"> <div> </div> <input type="number" name="attr_punch_weapon_wgt" class="skill-value" disabled="true" value="0"> <input type="number" name="attr_punch_weapon_wq" class="skill-value" disabled="true" value="0"> <button type="roll" value="&{template:custom} {{color=harn}} {{nocrit=1}} {{title=@{character_name} tests weapon break}} {{subtitle=@{punch_weapon_name}}} {{rolltarget=[[@{punch_weapon_wq}]]}} {{rollresult=[[3d6]]}} {{base=@{punch_weapon_wq}}} {{rolltype=3d6}}" name="roll_unarmedweaponbreakcheck"> </button> <input type="number" name="attr_punch_weapon_atk" class="skill-value" disabled="true" value="0"> <input type="number" name="attr_punch_weapon_def" class="skill-value" disabled="true" value="15"> <input type="number" name="attr_punch_weapon_hm" class="skill-value" disabled="true" value="0"> <div> </div> <input type="number" name="attr_punch_weapon_b" class="skill-value" disabled="true" value="0"> <input type="number" name="attr_punch_weapon_e" class="skill-value" disabled="true" value="0"> <input type="number" name="attr_punch_weapon_p" class="skill-value" disabled="true" value="0"> <input type="number" name="attr_punch_weapon_f" class="skill-value" disabled="true" value="0"> <input type="number" name="attr_punch_weapon_ml" class="skill-value" readonly> <input type="number" name="attr_punch_weapon_aml" class="skill-value" readonly> <button type="roll" value="&{template:custom} {{color=harn}} {{title=@{character_name} attacks with @{punch_weapon_name}}} {{rolltarget=[[{[[{[[@{punch_weapon_aml} - [[(@{physical_penalty})*5]] + ?{Target Modifier?|0}]],5}kh1]],95}kl1]]}} {{Mastery Lvl=[[@{punch_weapon_aml}]]}} {{penalty=[[(@{physical_penalty})*5]]}} {{rollresult=[[1d100cs5cs10cs15cs20cs25cs30cs35cs40cs45cs50cs55cs60cs65cs70cs75cs80cs85cs90cs95cs100]]}} {{Modifiers=[[?{Target Modifier?|0}]]}} {{desc=B(@{punch_weapon_b}) E(@{punch_weapon_e}) P(@{punch_weapon_p})}}" name="roll_UnarmedWeaponAMLSkillCheck"> </button> <input type="number" name="attr_punch_weapon_dml" class="skill-value" readonly> <button type="roll" value="&{template:custom} {{color=harn}} {{title=@{character_name} blocks with a @{punch_weapon_name}}} {{rolltarget=[[{[[{[[@{punch_weapon_dml} - [[(@{physical_penalty})*5]] + ?{Target Modifier?|0}]],5}kh1]],95}kl1]]}} {{Mastery Lvl=[[@{punch_weapon_dml}]]}} {{penalty=[[(@{physical_penalty})*5]]}} {{rollresult=[[1d100cs5cs10cs15cs20cs25cs30cs35cs40cs45cs50cs55cs60cs65cs70cs75cs80cs85cs90cs95cs100]]}} {{Modifiers=[[?{Target Modifier?|0}]]}}" name="roll_unarmedweapondmlskillcheck"> </button> <input type="text" name="attr_punch_weapon_note" class="skill-label"> <input type="text" name="attr_kick_weapon_name" class="weapon-label" disabled="true" value="Kick"> <div> </div> <input type="number" name="attr_kick_weapon_wgt" class="skill-value" disabled="true" value="0"> <input type="number" name="attr_kick_weapon_wq" class="skill-value" disabled="true" value="0"> <button type="roll" value="&{template:custom} {{color=harn}} {{nocrit=1}} {{title=@{character_name} tests weapon break}} {{subtitle=@{kick_weapon_name}}} {{rolltarget=[[@{kick_weapon_wq}]]}} {{rollresult=[[3d6]]}} {{base=@{kick_weapon_wq}}} {{rolltype=3d6}}" name="roll_unarmedweaponbreakcheck"> </button> <input type="number" name="attr_kick_weapon_atk" class="skill-value" disabled="true" value="5"> <input type="number" name="attr_kick_weapon_def" class="skill-value" disabled="true" value="5"> <input type="number" name="attr_kick_weapon_hm" class="skill-value" disabled="true" value="0"> <div> </div> <input type="number" name="attr_kick_weapon_b" class="skill-value" disabled="true" value="1"> <input type="number" name="attr_kick_weapon_e" class="skill-value" disabled="true" value="0"> <input type="number" name="attr_kick_weapon_p" class="skill-value" disabled="true" value="0"> <input type="number" name="attr_kick_weapon_f" class="skill-value" disabled="true" value="0"> <input type="number" name="attr_kick_weapon_ml" class="skill-value" readonly> <input type="number" name="attr_kick_weapon_aml" class="skill-value" readonly> <button type="roll" value="&{template:custom} {{color=harn}} {{title=@{character_name} attacks with a @{kick_weapon_name}}} {{rolltarget=[[{[[{[[@{kick_weapon_aml} - [[(@{physical_penalty})*5]] + ?{Target Modifier?|0}]],5}kh1]],95}kl1]]}}{{Mastery Lvl=[[@{kick_weapon_aml}]]}} {{penalty=[[(@{physical_penalty})*5]]}} {{rollresult=[[1d100cs5cs10cs15cs20cs25cs30cs35cs40cs45cs50cs55cs60cs65cs70cs75cs80cs85cs90cs95cs100]]}} {{Modifiers=[[?{Target Modifier?|0}]]}} {{desc=B(@{kick_weapon_b}) E(@{kick_weapon_e}) P(@{kick_weapon_p})}}" name="roll_UnarmedWeaponAMLSkillCheck"> </button> <input type="number" name="attr_kick_weapon_dml" class="skill-value" readonly> <button type="roll" value="&{template:custom} {{color=harn}} {{title=@{character_name} defends with a @{kick_weapon_name}}} {{rolltarget=[[{[[{[[@{kick_weapon_dml} - [[(@{physical_penalty})*5]] + ?{Target Modifier?|0}]],5}kh1]],95}kl1]]}} {{Mastery Lvl=[[@{kick_weapon_dml}]]}} {{penalty=[[(@{physical_penalty})*5]]}} {{rollresult=[[1d100cs5cs10cs15cs20cs25cs30cs35cs40cs45cs50cs55cs60cs65cs70cs75cs80cs85cs90cs95cs100]]}} {{Modifiers=[[?{Target Modifier?|0}]]}}" name="roll_unarmedweapondmlskillcheck"> </button> <input type="text" name="attr_kick_weapon_note" class="skill-label"> <fieldset class="repeating_weapon weapons-carried"> <input type="hidden" name="attr_weapon_iscarried" class="display-carried-weapon"> <!-- this is filled with the value set by the is carried checkbox above--> <div class="weapon-display"> <input type="text" name="attr_weapon_name" class="weapon-label" readonly> <input type="checkbox" name="attr_weapon_iscarried" value="1"> <input type="number" name="attr_weapon_wgt" class="skill-value" readonly> <input type="number" name="attr_weapon_wq" class="skill-value" readonly> <button type="roll" value="&{template:custom} {{color=harn}} {{nocrit=1}} {{title=@{character_name} tests weapon break}} {{subtitle=@{weapon_name}}} {{rolltarget=[[@{weapon_wq}]]}} {{rollresult=[[3d6]]}} {{base=@{weapon_wq}}} {{rolltype=3d6}}" name="roll_WeaponBreakCheck"> </button> <input type="number" name="attr_weapon_atk" class="skill-value" readonly> <input type="number" name="attr_weapon_def" class="skill-value" readonly> <input type="number" name="attr_weapon_hm" class="skill-value" readonly> <button type="roll" class="harntooltip" value="&{template:custom} {{color=harn}} {{title=@{character_name} attacks with a @{weapon_name}}} {{subtitle=With HM penalty}} {{rolltarget=[[{[[{[[@{weapon_aml} + @{weapon_hm} - [[(@{physical_penalty})*5]] + ?{Target Modifier?|0}]],5}kh1]],95}kl1]]}} {{Mastery Lvl=[[@{weapon_aml}]]}} {{penalty=[[[[(@{physical_penalty})*5]] + [[-1*@{weapon_hm}]]]]}} {{rollresult=[[1d100cs5cs10cs15cs20cs25cs30cs35cs40cs45cs50cs55cs60cs65cs70cs75cs80cs85cs90cs95cs100]]}} {{Modifier=[[?{Target Modifier?|0}]]}} {{desc=B(@{weapon_b}) E(@{weapon_e}) P(@{weapon_p}) F(@{weapon_f})}}" name="roll_weaponhmamlcheck" data-tooltiptext="Use this button to roll attack with included HM penalty"> </button> <input type="number" name="attr_weapon_b" class="skill-value" readonly> <input type="number" name="attr_weapon_e" class="skill-value" readonly> <input type="number" name="attr_weapon_p" class="skill-value" readonly> <input type="number" name="attr_weapon_f" class="skill-value" readonly> <input type="number" name="attr_weapon_ml" class="skill-value" readonly> <input type="number" name="attr_weapon_aml" class="skill-value" readonly> <button type="roll" class="harntooltip" value="&{template:custom} {{color=harn}} {{title=@{character_name} attacks with a @{weapon_name}}} {{rolltarget=[[{[[{[[@{weapon_aml} - [[(@{physical_penalty})*5]] + ?{Target Modifier?|0}]],5}kh1]],95}kl1]]}}{{Mastery Lvl=[[@{weapon_aml}]]}} {{penalty=[[(@{physical_penalty})*5]]}} {{rollresult=[[1d100cs5cs10cs15cs20cs25cs30cs35cs40cs45cs50cs55cs60cs65cs70cs75cs80cs85cs90cs95cs100]]}} {{Modifier=[[?{Target Modifier?|0}]]}} {{successdesc=B(@{weapon_b}) E(@{weapon_e}) P(@{weapon_p}) F(@{weapon_f})}}" name="roll_weaponamlcheck" data-tooltiptext="Use this button to roll a normal attack"> </button> <input type="number" name="attr_weapon_dml" class="skill-value" readonly> <button type="roll" value="&{template:custom} {{color=harn}} {{title=@{character_name} blocks with a @{weapon_name}}} {{rolltarget=[[{[[{[[@{weapon_dml} - [[(@{physical_penalty})*5]] + ?{Target Modifier?|0}]],5}kh1]],95}kl1]]}}{{Mastery Lvl=[[@{weapon_dml}}} {{penalty=[[(@{physical_penalty})*5]]}} {{rollresult=[[1d100cs5cs10cs15cs20cs25cs30cs35cs40cs45cs50cs55cs60cs65cs70cs75cs80cs85cs90cs95cs100]]}} {{Modifier=[[?{Target Modifier?|0}]]}} {{desc=wq @{weapon_wq}]]}}" name="roll_weapondmlcheck"> </button> <input type="text" name="attr_weapon_note" class="skill-label" readonly> </div> </fieldset> </div> The full code is on github (  roll20-character-sheets/HarnMaster3 at master · olafvantol/roll20-character-sheets (github.com)  ) ; in the master branch there are still capitals in the name, in the avatar-portrait branch i've replaced them with all small.
1625931506

Edited 1625931576
GiGs
Pro
Sheet Author
API Scripter
Your buttons dont have name attributes. after type="roll" , enter name="roll_SOMETHING" and replace SOMETHING with the name you want to give the button. Each button must have a unique name for proper performance. Note: do this for the buttons outside the repeating section, too. They might appear to be working at the moment, but they wont work if you try to make buttons in chat with them.
1625934819

Edited 1625934835
Kraynic
Pro
Sheet Author
I think they do have a name, it is just placed last, right before the </button> termination. Does the order in which an html element is composed make a difference?
1625935134

Edited 1625935375
GiGs
Pro
Sheet Author
API Scripter
No, the order doesnt matter. I missed that, so my first post can be ignored. But looking again, here is the issue: <fieldset class="repeating_weapon weapons-carried"> Unfortunately fieldset class names work differently from other classes. To do this you'd need to write it like this: <fieldset class="repeating_weapon">     <div class="weapons-carried"> Put a container inside the fieldset, and put all the fieldset code inside that container. You cant give a fieldset multiple class names- they must always have a single class name which starts with repeating_
1625938522
Olaf
Pro
Sheet Author
Thank you for the tips all! I had re-read the wiki and knew that capitalisation mattered, wasn't aware of the "one class" restriction. I'll try that out tomorrow.