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 issue

Hello again! In the 53 OGL sheet I am trying to make an ability that will pull up a set of clickable buttons for other abilities on the character sheet.  So the Button Ability is  &{template:default} {{name=Actions}} {{Actions=[Thunder](~A Thunder )}} and the ability is &{template:default} {{name=Thunder}} {{Attack=[[1d20+@{selected|pb}+@{selected|dexterity_mod}]] | [[1d20+@{selected|pb}+@{selected|dexterity_mod}]]}} {{Damage=[[6+3]]}} {{Crit=+6}} {{Thunder Damage=[[1d8]]}} {{Additional Effect=On a hit, the target suffers the attack's normal effects, and it becomes sheathed in booming energy until the start of your next turn. If the target willingly moves before then, it immediately takes [[2d8]] thunder damage, and the spell ends.}} In the Button ability I have also tried [Thunder](~selected|%A Thunder) and I get "No ability was found for %{selected|%A Thunder}" The first ability works and a default template with a button labeled Thunder is there and clickable but when I click it I get  "typeError: Cannot read property 'substring' of undefined" I have no idea what I am doing wrong. 
1520622055

Edited 1520622205
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
The proper syntax is: [Label](~charName|ability_name) charName can be replaced with the selected keyword, but keep in mind it will look for a selected token when the button is clicked, not when the menu is sent to chat. edit: you may also have issues with having a space in the ability name. Not sure on that tho.
You might be able to shortcut the character name by using [Label](~@{character_name}|ability_name)
1520624196
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, good suggestion Kyle, and yes that does work.
As usual it was something silly. I had the % before the Ability name and that was what was causing the issue.  Thanks!