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

Roll calculations within a button

I've been working on using buttons within spells, but came across an issue with the calculations. I'm finding that any calculation without a variable call (ie: [[1d6+5]]) doesn't display correctly as is displayed in the Bull Rush macro here. This result is static and the result will not change unless the macro is run again. Calculations that do have a variable call (ie:[[1d6+@{casterlevel}]] will display properly with an end result that you can mouse-over to see the breakdown of the roll as it is with the Grapple macro here. This result rerolls the variables with each time the button is pressed. If I put an extra set of [[ ]] around the calculation, it just gives me the end result with no mouse-over breakdown, and as well each time the same button is pressed the result is static like the Bull Rush macro. My question is whether there is a way to make all calculations within the button show with the end result and a mouse-over breakdown?
Flee said: I've been working on using buttons within spells, but came across an issue with the calculations. I'm finding that any calculation without a variable call (ie: [[1d6+5]]) doesn't display correctly as is displayed in the Bull Rush macro here. This result is static and the result will not change unless the macro is run again. Calculations that do have a variable call (ie:[[1d6+@{casterlevel}]] will display properly with an end result that you can mouse-over to see the breakdown of the roll as it is with the Grapple macro here. This result rerolls the variables with each time the button is pressed. If I put an extra set of [[ ]] around the calculation, it just gives me the end result with no mouse-over breakdown, and as well each time the same button is pressed the result is static like the Bull Rush macro. My question is whether there is a way to make all calculations within the button show with the end result and a mouse-over breakdown? yeah.  just use [[(())]] instead of [[[[]]]].
Gargamond said: yeah.  just use [[(())]] instead of [[[[]]]]. Thanks, but I'm afraid that it did not work... I'm trying to get the same type of readout as the Grapple buttons has, but I think I must have something that's mucking things up for this calculation. [[((1d20 +16))]] Came out looking like this: Bull Rush Str check:( Rolling ((1d20 +16)) = (((8)+16))'>24) For comparison: [[1d20 +16]] Bull Rush Str check:( Rolling 1d20 +16 = (9)+16'>25) [[[[1d20 +16]]]] Bull Rush Str check:26 (or another static number) For a bit more context, here is the entirety ot the Notes field: {{notes=[**Other Info**](!
`/&{template:DnD35StdRoll} {{notes=PHB 204 Sorcerer level 7 Evocation  [Force] Components: V S F DF Casting Time: Standard Arcane Focus A leather glove.}})[**Full Text**](!
`/&{template:DnD35StdRoll} {{notes=This spell functions like interposing hand, except the hand can also grapple one opponent that you select. The grasping hand gets one grapple attack per round. Its attack bonus to make contact equals your caster level + your Intelligence, Wisdom, or Charisma modifier (for wizards, clerics, and sorcerers, respectively), +10 for the hand’s Strength score (31), -1 for being Large. Its grapple bonus is this same figure, except with a +4 modifier for being Large instead of -1. The hand holds but does not harm creatures it grapples. Directing the spell to a new target is a move action. The grasping hand can also bull rush an opponent as forceful hand does, but at a +16 bonus on the Strength check (+10 for Strength 31, +4 for being Large, and a +2 bonus for charging, which it always gets), or interpose itself as interposing hand does. Clerics who cast this spell name it for their deities.}}) [**Interpose**](!
`/&{template:DnD35StdRoll} {{notes=Creates a Large magic hand between you and one opponent. Hand remains between the two of you, regardless of where you move or how the opponent tries to get around it. Provides cover (+4 AC) for you against that opponent. Has HP equal to the casters Max HP. AC 20 (-1 Size, +11 Nat) Uses casters Saving Throws. Never provokes attacks of opportunity. **Creatures<2000lb** 1/2 speed. **Creatures>2000lb** are not slowed. Cannot be fooled by anything Including Darkness, Invisibility, or Polymorph}})[**Bull Rush**](!
`/&{template:DnD35StdRoll} {{notes=Bull Rush Str check:([[1d20 +16]])}})[**Grapple**](!
`/&{template:DnD35StdRoll} {{notes=Melee Touch([[1d20 +[[@{casterlevel}]][level][level] +@{Cha-Mod}[Cha] +10[Str] -1[Size]]]) Grapple:([[1d20  +[[@{casterlevel}]][level][level] +@{Cha-Mod}[Cha] +10[Str] +4[Size]]])}})}}
1643985394
timmaugh
Forum Champion
API Scripter
The roller is trying to send the roll data, but your attribute value is breaking the parser. It looks like you are storing a "feet" indicator with the field (the apostrophe), and the parser won't know what to do with that. You can prove this by going to your attributes & abilities page in your character sheet and creating a new attribute called "testpurenumber". Put a clean number in there (like 16, no punctuation). Replace references to the attribute that is storing this value: 16' ...with a reference to your new testpurenumber attribute, and you'll get what you expect.
I figured that I would post here again, since I have solved the problem... The issue lays within Escaping... With queries, it's commonly known that you need to escape: , to , | to | } to } Within a button, it's a little different. You also need to Escape: ) to ) (Which I already knew) ] to ] So, hopefully this finds someone else who was as frustrated as I was and makes their day...:)
1644970679
vÍnce
Pro
Sheet Author
Saved. Thanks for the followup Flee