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

Ability Button Within Roll Templates

1475239131
Axel
Pro
Sheet Author
I want to accomplish what was talked about in this post:&nbsp; <a href="https://app.roll20.net/forum/post/2744258/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/2744258/slug%7D</a> Basically, I want my roll template to display a button that calls another ability, but I can't get it to work. What I have in the sheet is this, which works fine when entered though the chat: &{template:default} {{name=Test}} {{button=[Button](! %{selected&#124;Ability})}} But when called from the sheet, it doesn't work and the log shows me this input: &{template:default} {{name=Test}} {{button=[Button](! %{selected|Ability})}}} The result is that the Button property is dropped from the template.&nbsp;What am i doing wrong?
1475239808
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You'll actually want to use the&nbsp; ability command button syntax. I believe this became available after that post (though I'm not sure on the timeline). Your button syntax will look like this: [Button Label](~selected|abilityName) No html entities required :).
The ability button format is [Button](~selected|Ability) See the wiki <a href="https://wiki.roll20.net/Macros#Ability_Command_Buttons" rel="nofollow">https://wiki.roll20.net/Macros#Ability_Command_Buttons</a>
1475241435
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Also, I believe that what might be happening there is that your html entities are being replaced. Are you saving this as a global macro (in the collections tab) or as an ability on a character's attributes and abilities tab? The global macros replace html entities when they are reopened. This won't matter for the ability command button syntax, but thought you might like an idea on what was going wrong
1475241775
Axel
Pro
Sheet Author
Cool, thanks! That seems to work. I'll have to give it a close look. Is there a way to format the appearance of the button though?
1475242295

Edited 1475242556
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Nope, unless your using the ogl 5e sheet as some of the templates on that sheet do some formatting. <a href="https://wiki.roll20.net/5e_OGL_Roll_Templates" rel="nofollow">https://wiki.roll20.net/5e_OGL_Roll_Templates</a>