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

Rolling Buttons from character sheet?

Is it possible to reference the buttons in the character sheet? It's all setup nice but the sheet itself is too big to leave out. Is it possible to make macros that reference the buttons in the sheet?

I realize that I could probably do things the the other way around but the character sheet is savable and transferable easily.
July 13 (11 years ago)
The Aaron
Roll20 Production Team
API Scripter
I've never fine this, but it is possible. Here's the relevant section of the wiki:

From: https://wiki.roll20.net/Character_Sheets#Advanced_...

Sheet Rolls and Roll Buttons
You can include pre-defined rolls on your sheet. This is a great way to add the rolls that will be needed by the player when using the standard rolls in the game system. For example, you may want to add a "Roll Check" button next to each "Bluff", "Intimidate", etc. field on the sheet. To define a roll, just use the <button> tag. Thetype attribute should be set to "roll". The roll itself is defined in thevalue attribute. You can also add a name attribute which allows the roll to be referenced in external Macros and Abilities. A full example of a bluff check roll might look like: <button type='roll' value='/roll 1d20 + @{Bluff}' name='roll_BluffCheck' />. Note that you can reference attributes/fields on the sheet using the@{AttributeName} syntax. You could also then roll that example in other Macros or Abilities using %{CharName|BluffCheck}. Note:The names you give your Sheet Rolls must be unique from any Ability names on your Characters if you want to reference them in Abilities or Macros. You can also just not give your Sheet Rolls names if you just want them to only be rolled by clicking the button on the Sheet itself.

Yes, the above method works perfectly... EXCEPT for buttons within repeating fields (those parts of the sheet where you can +add another field when you need it). Unfortunately it's a fundamental property of something or other preventing it. Fortunately, a workaround is possible, and (at least on the Pathfinder sheet) is coming very soon.

-Phnord
I know on the Pathfinder sheet you can refrence things like:
/me does [[@{selected|repeating_weapon_0_damage}+@{selected|repeating_weapon_0_damage-ability}]] damage done on a hit.
Not sure if that helps or confuses things. But this would be the 1st weapon in that section, though this access the feilds themselfs and not the dice button by the weapon entry.
A work around is to press "up" In the chat box after runnning the macro once. You can copy the text there into an abilities button.
July 14 (11 years ago)
Thom
Pro
So this is a wholly cosmetic issue, and can be scorned ad lib, but when I use the button directly on the character sheet to roll (for example) a Perception check, I get an elegant and brightly colored little message in the log saying:

Alhimbror's Perception check: 28

Which is great for the GM to read and for our collective remembry.

However, if I want to make a macro button to do the same thing:

/r d20 + @{Alhimbror|Perception}
it gives me the cosmetically unfortunate (though wholly accurate) response:

rolling 1d20+(floor((18 + 0 + 0 + 0) / 2) - 5)
(18)+(floor((18+0+0+0)/2)-5) = 22

Is there, or can there be, a way to use a macro button to generate the same output that the in-sheet button produces?

thanks! BTW, the character sheets are great. Nice balance between automation and just letting the player fill in their stuff without the sheet trying to be too smart.

Thom


By the way, @JScott, there is an elegant way to shrink and restore the character sheet -- when it's open, just double-click on its top bar. It will iconize.

July 14 (11 years ago)
@Thom

Try /r d20 + [[@{Alhimbror|Perception}]]

That will make the modifier inline with the number.
July 15 (11 years ago)
Thom
Pro
Thanks @Joshuha, that looks much better. I'd still be excited about having the "Alhimbror's perception check" come out just like the in-sheet button, but your syntax makes it much better than it was. Somehow having that explicit javascript code printed out would tend to pop me out of game.

many appreciations - Thom
July 15 (11 years ago)

Edited July 15 (11 years ago)
@Thom

If you make a macro button, just add it as part of a sentence, you can have multiple rolls if you do this (just copy paste the entire thing into one line in a macro):
Alhimbror's Perception check: [[1d20 + @{Alhimbror|Perception}]], what he REALLY wanted was a [[20 + @{Alhimbror|Perception}]]!
July 16 (11 years ago)

Edited July 16 (11 years ago)
Thom
Pro
Better and better... that's perfect. I should have thought of that re adding the descriptive phrase, but I didn't know that omitting the /r and surrounding with [[ ]] would (a) work and (b) suppress all that contextual output. Thanks very much @Jeramy.

So for other readers: this macro code, verbatim:

Alhimbror's Perception check: [[1d20 + @{Alhimbror|Perception}]]

comes out exactly like pressing the in-sheet Perception button. Assuming that your name is Alhimbror.

thanks again -
Thom