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

Writing Macros into Character Sheets

Good Day, Is it possible to write a macro within the html of a custom character sheet, and then call it as though it were a character ability? I know that I can make buttons that act functionally similar. However, many (nearly all) of my actual in-game macros reference both the currently selected character and a target. You cannot normally include a target's stats within a character sheet, so I am required to write macros within the campaign itself to connect the two. What I want to do is be able to write that macro as text that is not automatically executed by the character sheet, which I can then call just like a regular ability. Even better if I can automatically make a token action for said ability such that all tokens connected to a character sheet would automatically have the roll available. For example, I would like to make a macro that sends the following greatly simplified damage roll formula: [[ 1d10 + @{selected|strength} - @{target|armor} ]]. It would be sent to chat like any macro or ability, and roll there like normal, including calling any roll templates with it, API commands, and so on. This is very easy to do via a character ability, of course. But, I want to write it directly into the character sheet and then call it on command.  Thank you very much for any advice or assistance.
1602452133
GiGs
Pro
Sheet Author
API Scripter
This is what buttons are. You can use @{target|stat} to call a target's stat in a button. If the button is properly named (name="roll_button-name"), you can call the button like a character ability: %{selected|button-name}
1602452765
Andreas J.
Forum Champion
Sheet Author
Translator
What GiGs said. Here is how they are create on the character sheet: <a href="https://wiki.roll20.net/Button" rel="nofollow">https://wiki.roll20.net/Button</a>
I see. It seems that I somewhat misunderstood the buttons. Well, that about covers that. Thank you very much.