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

Buttons with different picture but still rolling

I actually wanted a d10 showing in the button instead of a d20 (by default in roll20) but when I made button change icon, it was no longer able to roll. I used this line of code for a button. My question is how can I still make it roll (since if I change "pool" into "roll" it changes the icon back into a d20) <button type="pool" style="font-family: dicefontd10; font-size: 30px" value="">A</button>
different question at the same time..... When I am using  <input type="number" value="@{strength} * 5" /> for some reason the values don't autmatically show calculated. but stay empty. idea's??
1568991744

Edited 1568991762
Finderski
Plus
Sheet Author
Compendium Curator
On a conference call at work, so can't get into more detail than this... Your button is configured incorrectly...your button needs to be of a type roll or action and the value needs to include what you want the roll button to actually do...it also needs a name.  The wiki has more information about what the roll buttons need to look like. The auto-calc field needs to be disabled as well for it to show the value. Again, the wiki has more information on autocalc fields.
thanks, for your reply. I've already considered that and that is NOT the problem. else I would not have asked it here. The input number does not HAVE to be disabled, I had it working without too. so the default value would be the result of the calculation, and players could add to it themselves.  and even though I disable it. it is showing a blanc grey area in the same field the autocalc should work
example: <input type="number" name="attr_damage_base" value="@{strength}*5" disabled="true" /> this value is 10 <input type="number" name="attr_damage_bonus" value="" /> this value has manually been set to 2 <button type="roll" value="&{template:default} {{name=Damage}} {{Damage=[[(@{damage_base}) + @{damage_bonus}d10]]}}"> </button> then why is this value (0 + 2)d10 instead of (10+2)d10 ??
1568993166
Finderski
Plus
Sheet Author
Compendium Curator
From the wiki : Auto-Calculating Values You can include a formula in the default value for the field, and specify the  disabled="true"  attribute on the field. If you do so, the sheet will display the result of the formula instead of the formula itself. For example,  <input type="number" name="attr_StrMod" value="@{Strength}/2" disabled="true" />  would create a "StrMod" field that shows half the Strength value. These auto-calculating attributes can be used in Sheet Rolls, Macros, and Abilities as normal. Note that you can only include attributes from the current Character. You also can't include macros, abilities, or rolls...just basic math such as  @{Intelligence}/2+@{Level} . You also have access to the floor, round, and ceil functions, such as  floor(@{Intelligence}/2) . If your auto-calculated field depends of another auto-calculated field(s), you have to add parenthesis around intermediate formula(s). Otherwise miscalculations could appear. Example :  <input type="number" name="attr_StrMod" value="(@{Strength}/2)" disabled="true" /> <input type="number" name="attr_StrModLeveled" value="@{StrMod}+@{Level}" disabled="true" /> Note that calculations do not show up in the Preview, they only show on a character sheet in-game. Auto-calculating values will increase the load of a sheet when its opened and as a result should be used sparingly. Consider using  sheet worker scripts  to complete calculations that are conditional.
1568994613

Edited 1568994830
Kraynic
Pro
Sheet Author
You need to curb the hostility.&nbsp; It looks to me like you are missing the () around your strength * 5 calculation, which is mentioned in the middle paragraph of what Finderski quoted. Also, if your players are people who like to enable the macro quick bar at the bottom of the screen and drag rolls to it, they won't be able to do so with your roll button as written because it doesn't have a name.&nbsp; It needs something like name="roll_damage" or maybe something more specific so it will have the functionality to be dragged from the sheet or recognized by the api. Edit:&nbsp; And about your roll buttons, you need to move your style changes to css as far as I know.&nbsp; At least that is how it is presented in the wiki.&nbsp; I haven't tried changing the die displayed, but was able to disable the die and use text on my sheet following instructions from the wiki found on this page:&nbsp;&nbsp; <a href="https://wiki.roll20.net/CSS_Wizardry" rel="nofollow">https://wiki.roll20.net/CSS_Wizardry</a>
1568998995

Edited 1569006928
Finderski
Plus
Sheet Author
Compendium Curator
Sorry that upset you. &nbsp;The above examples weren't formatted properly, so I assumed (wrongfully, apparently) that you hadn't read them. The post with the properly formatted example came as I was posting the bit from the wiki and I didn't see your response until after my response posted. I was trying to get you information as quickly as possible, because when I have time to work on a sheet, getting answers that point me in the right direction quickly is more helpful than a more detailed response which could take time. Here's code I have implemented that works: Strength: &lt;input type="number" name="attr_strength" value="0" /&gt;&lt;br/&gt; Auto-calc: &lt;input type="number" name="attr_damage_base" value="@{strength}*5" disabled="true" /&gt;&lt;br/&gt; Bonus: &lt;input type="number" name="attr_damage_bonus" value="0" /&gt;&lt;br/&gt; &lt;button type="roll" value="&amp;{template:default} {{name=Damage}} {{Damage=[[(@{damage_base}) + @{damage_bonus}d10]]}}"&gt; &lt;/button&gt; The autocalc field references a field called strength, which you don't provide an example for, so my assumption is there may be a typo in the strength input name or in the autocalc reference to it. Also, given the formula for the roll button, do you want 2d10 or 12d10? If 2d10, then the formula is fine. If you want 12d10, then you need to modify the formula slightly to this: &lt;button type="roll" value="&amp;{template:default} {{name=Damage}} {{Damage=[[ [[ (@{damage_base}) + @{damage_bonus} ]] d10]]}}"&gt; &lt;/button&gt; Also, if you don't want to see the formula of the autocalc in the chat output, you'll need to encapsulate that in double brackets The below assumes you want 2d10 rolled (your original formula above): &lt;button type="roll" value="&amp;{template:default} {{name=Damage}} {{Damage=[[( [[ @{damage_base} ]] ) + @{damage_bonus}d10]]}}"&gt; &lt;/button&gt; Doing that, you could also remove the parentheses.
1569003199
Finderski
Plus
Sheet Author
Compendium Curator
gravia D. said: I actually wanted a d10 showing in the button instead of a d20 (by default in roll20) but when I made button change icon, it was no longer able to roll. I used this line of code for a button. My question is how can I still make it roll (since if I change "pool" into "roll" it changes the icon back into a d20) &lt;button type="pool" style="font-family: dicefontd10; font-size: 30px" value=""&gt;A&lt;/button&gt; To accomplish this, you'll want to give you button a class and some css... HTML: &lt;button class="sheet-d10button" type="roll" value="&amp;{template:default} {{name=Damage}} {{Damage=[[(@{damage_base}) + @{damage_bonus}d10]]}}"&gt;k&lt;/button&gt; CSS: button[type=roll].sheet-d10button { &nbsp; &nbsp; font-family: dicefontd10; &nbsp; &nbsp; font-size: 2em; } button[type=roll].sheet-d10button::before { &nbsp; &nbsp; content: ''; } That will give you: Personally, I like the 'k' instead of 'A', because it looks more like a d10 (easier to see the lines) and it's easier to read, but it's your sheet and I'm not telling you what to use... There's other styling you can do, but that'll get you the basics.
Thank&nbsp; you for that last reply. that helped a lot! thanks!!!!
1569110071
Finderski
Plus
Sheet Author
Compendium Curator
Glad to help. :)