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

Button not functioning on certain sheets but works fine on others

I'm back again with a puzzling issue.  I have a custom sheet with an attack button that pulls various sheets attributes together to determine how many dice to roll.  On the sheets I've made, it works fine.  One of my players has it working fine as well.  But four other players, when they click the button, a single attribute is not being added into the equation. This is the code in question: <button type="roll" name="attack1" value="&{template:rolls} {{title=Attack}} {{subtitle=@{weapon1name} }} {{roll= [[[[@{weapon1type}+ @{mightiness} +@{weapon1material}+@{weapon1attack}]]d6>?{Target Number?|4}]]}}"></button> The bolded attribute, mightiness, is not being added in, but again, it's only certain sheets where this happens, and there is no discernable difference between the sheets (they have values entered for each of those attributes, the attributes section of the sheet shows those attributes and the correct values, etc.).  So it looks like the logic is functioning properly, the values are all being set properly, but for whatever reason, a handful of character sheets simply don't call mightiness. Any idea what could be going on here?  I tried rebuilding a character sheet for a player and encountered the same issue.  The only thing I can think of is that the NPC sheets were made a while ago while the player sheets were made last night, but that still doesn't explain why one player's works fine...
I know you said the values are being set properly, but just to be clear, have you checked the Attributes and Abilities tab of the characters in question to see if mightiness is listed, and has a numeric value? My first step would be to look there, because if an appropriate value appears there then the problem is with how the value is being processed, but if not then the problem is with how the value is being generated.
1635875842

Edited 1635876166
vÍnce
Pro
Sheet Author
Not sure if this is the cause, but you should/need to use "roll_" as part of your button name. ie <button type="roll" name="roll_attack1"... Can you post the html of the "mightiness" attribute?
Aardwulf said: I know you said the values are being set properly, but just to be clear, have you checked the Attributes and Abilities tab of the characters in question to see if mightiness is listed, and has a numeric value? My first step would be to look there, because if an appropriate value appears there then the problem is with how the value is being processed, but if not then the problem is with how the value is being generated. Yes, on the sheets with the issue, the mightiness attribute is listed on the sheet's list of attributes, and it has the correct value. vÍnce    said: Can you post the html of the "mightiness" attribute? Here it is (not sure how to post it with the formatting you have):  <input type="number" name="attr_mightiness" value="0" min="0" max="6">
1635920595

Edited 1635920611
vÍnce
Pro
Sheet Author
Here it is (not sure how to post it with the formatting you have):  <input type="number" name="attr_mightiness" value="0" min="0" max="6"> You can use the format tool in the forum's message editor (top left dropdown/magic wand and choose code). The input looks fine.  Is this inside a repeating section (fieldset)? Is this attribute only declared in one location on the sheet?  I've seen attribute naming issues where an attribute with the same name is being used inside and outside a repeating section.  Not sure if that applies here.  Also, can you isolate just calling "@{selected|mightiness}" from chat and get a result?
That's the weird thing is that there is also a button that rolls just the mightiness value itself, and that one works fine.  This is the full HTML in that section:  <section class="skill f-col nowrap">     <h2>Attributes</h2> <!-- Mightiness -->     <div class="f-row nowrap">       <label><h3>Mightiness</h3></label>       <input type="number" name="attr_mightiness" value="0" min="0" max="6">       <button type="roll" name="roll_mightiness" value="&{template:rolls} {{title=Mightiness}} {{subtitle=@{character_name} }} {{roll= [[[[@{mightiness}]]d6>?{Target Number?|4}]]}}"> </button>     </div> So, the mightiness attribute is called in a couple different places.  It works fine when rolling just a dice roll that calls mightiness alone.  In terms of repeating sections, the area in question where I am having the issue is a weapon attack, and there is a second weapon on the sheet where all the code is copied (but the attributes are renamed, so attr_weapon2 instead of attr_weapon1, etc.  But that second weapon's formula also calls on mightiness). Mightiness is also called on three separate skill check rolls, and those all function correctly as well.  It's a real head-scratcher for me.
1635962875

Edited 1635963066
vÍnce
Pro
Sheet Author
I'm thinking there may be an issue with having an attr_mightiness and a roll_mightiness.  If I recall, I have seen sheets that use attr_foo for roll buttons, so I'm guessing that attr_foo and roll_foo might have some overlap in how the VTT handles them.  I would try renaming one of them. (suggest renaming the roll button since it's probably not called anywhere else in your sheet's code...) You also might look and see if there are similar "attr_foo = roll_foo" names as well.
Unfortunately that did not solve the issue.  What is weird is that it isn't the roll_mightiness button that isn't working, it's the other one.  And it works on some sheets but not others.  That's why I am so stumped.
1635968592
vÍnce
Pro
Sheet Author
Not sure Wes.  If you post a link to your code (or PM me), I'll dig a little deeper.
Vince has solved, thank you all!