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

can't I roll a named button from inside an Ability or token action macro?

Sorry, this feels like a very basic question but I think my brain is melting. I have a simple custom character sheet. There are 4 types of unarmed attacks, each has its own uniquely named button. I wanted to present all 4 types as choices in a single drop-down menu as a token action. I don't particularly mind if I have to add it as an ability to each PC's sheet, but a macro as a token action would be swell. For the life of me I cannot figure out the syntax to "roll" any of the 4 named buttons on the sheet. Something like ?{Which type of attack?| Unarmed Strike, %{unarmed_strike_button}| Wrestling Hold, %{wrestling_hold_button}| Disarm Opponent, %{disarm_button}| Special Attack, %{special_attack_button} } I thought you could reference a button specifically by its name, I thought it was % but I've also tried ~ and @, I've tried adding "selected|" and tried adding the actual character name instead of "selected|", I've tried using html entities for the percent and/or the pipe. At this point I'm baffled. I'm curious if the fact that I did not use the prefix "roll_" in the button names is the problem. Each button outputs a lot of information in the default template, so it's also possible the &, %, |, or } in the value of the buttons is causing the issue when it gets passed to the query? But I thought I'd start simple and just see if I'm committing some stupid error in the way I'm trying to call for a roll by its name.
1644369953
The Aaron
Roll20 Production Team
API Scripter
I believe that doesn't work because of the order of operations of expansion in the chat.&nbsp; I think most people that want something like that use a menu of command buttons:&nbsp;<a href="https://app.roll20.net/forum/post/5899495/roll20-tips-and-tricks-innovative-solutions-to-common-problems/?pageforid=5927072#post-5927072" rel="nofollow">https://app.roll20.net/forum/post/5899495/roll20-tips-and-tricks-innovative-solutions-to-common-problems/?pageforid=5927072#post-5927072</a>
ok thank you. But there is a way to call the button by name, right? Just not in the query? Or am I mis-remembering that? I can get it to work if I spell out the value of every button rather than call them by name, and replace closing curly brackets, the commas, any additional pipes, etc. It's just a lot wordier, lol. Was hoping for a shortcut. This accomplishes exactly what I want, it's just a bit much. ?{Which attack? | Unarmed, &amp;amp;{template:default&amp;#125; {{name=Unarmed&amp;#125;&amp;#125; {{@{character_name} rolls = [[1d100cs&lt;02cf&gt;98]]&amp;#125;&amp;#125; {{Strike Column=[[{@{sm}&amp;#44;@{dm}&amp;#125;k1[STR or DEX Mod] + @{martial_arts_skill}[Martial Arts]]]&amp;#125;&amp;#125; {{Max Damage=[[[[@{ps}]][Punch Score] + @{martial_arts_skill}[Martial Arts Skill]]]&amp;#125;&amp;#125; | Wrestle, &amp;amp;{template:default&amp;#125; {{name=Wrestle&amp;#125;&amp;#125; {{@{character_name} rolls = [[1d100cs&lt;02cf&gt;98]]&amp;#125;&amp;#125; {{Strike Column=[[{@{sm}&amp;#44;@{dm}&amp;#125;k1[STR or DEX Mod] + @{martial_arts_skill}[Martial Arts]]]&amp;#125;&amp;#125; {{Subsequent=+X&amp;#125;&amp;#125; {{Max Damage=[[[[@{ps}]][Punch Score] + @{martial_arts_skill}[Martial Arts Skill]]]&amp;#125;&amp;#125; | Disarm, &amp;amp;{template:default&amp;#125; {{name=Disarm&amp;#125;&amp;#125; {{@{character_name} rolls = [[1d100cs&lt;02cf&gt;98]]&amp;#125;&amp;#125; {{Strike Column=[[{@{sm}&amp;#44;@{dm}&amp;#125;k1[STR or DEX Mod] + @{martial_arts_skill}[Martial Arts] - 2[-2 CS]]]&amp;#125;&amp;#125; {{Grab weapon=[[1d100cf&gt;98cs&lt;02]] vs DEX @{dex}&amp;#125;&amp;#125; | Special, &amp;amp;{template:default&amp;#125; {{name=@{ua_special}&amp;#125;&amp;#125; {{@{ua_display1_left}=@{ua_display1_right}&amp;#125;&amp;#125; {{@{ua_display2_left}=@{ua_display2_right}&amp;#125;&amp;#125; {{@{ua_display3_left}=@{ua_display3_right}&amp;#125;&amp;#125; }
1644373425
The Aaron
Roll20 Production Team
API Scripter
I think it's: ~CHARACTERID|ABILITY_NAME Check this:&nbsp;<a href="https://app.roll20.net/forum/permalink/8417551/" rel="nofollow">https://app.roll20.net/forum/permalink/8417551/</a>