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

Repeating Abilities in a Dropdown Menu (PF2e)

Hello all! Title pretty much says it all. A given PC in a game I run has an ability called Spellstrike, which lets him apply the effects of a spell on a melee swing. To accommodate this, I've created individual unique Spellstrike 'attacks' to cover his options, about 8 in total. That's a lot of clutter on a character sheet and a lot of clutter on the macro bar so I'd like to condense that into one dropdown. What I want: Have a dropdown that includes the various possible versions of Spellstrike. He hits a single macro button, it opens a dropdown menu. From the menu, he chooses which spell, and it calls the associated attack from his sheet. What I have: Spellstrike ?{Which spell | Telekinetic Projectile,   %{Name|repeating_melee-strikes_$1_ATTACK-DAMAGE}   | Acid Splash ,                %{Name|repeating_melee-strikes_$2_ATTACK-DAMAGE}   | Produce Flame,           %{Name|repeating_melee-strikes_$3_ATTACK-DAMAGE} } What I get: The menu is created but no dropdown, instead it's an editable field that contains " Telekinetic Projectile, 0 &{template:rolls" and then outputs a somewhat disjointed version of the next entry, in this case Acid Splash, but does indeed output it correctly. I've tried to research the problem and the general consensus seems to be it has something to do with having multiple nested }s and that it breaks the dropdown and the solution involves... escaping HTML? That's when it gets way above my head and I don't understand anything anymore. I've also seen the claim to just use chat buttons instead, but I find those visually displeasing and inelegant, and also don't know how to do those. There's a much-lauded post by Keith Curtis about them but it seems to be written assuming the reader will have APIs and a more advanced understanding of macros and HTML... none of which I have. Is my dream simply impossible? If it is, what's my next-best solution? I can pick apart some of the workings of more advanced macros even if I don't fully understand them, but I don't have a solid foundation so understanding the fundamental principle is helpful. Thank you anyone who knows or offers help!
1640842367
GiGs
Pro
Sheet Author
API Scripter
Warren the Hero said: There's a much-lauded post by Keith Curtis about them but it seems to be written assuming the reader will have APIs and a more advanced understanding of macros and HTML... none of which I have. Chat Menus use API Command Buttons, but despite the name, you don't need to have access to the API to use them. They can be used by free users. So I recommend looking at Chat Menus again. You can do what you want with html substutions, but you will need to replace all the called macros with the macro text, and then addthe substutions there, being careful only to only add the substutions where they are needed (too many substitutions will cause it to fail). Myt recommendation is to go the Chat Menu route - they are much easier to write and maintain. And remember the button menu can be whispered, so they clutter chat for only one person.
1640980430
Andreas J.
Forum Champion
Sheet Author
Translator
Info on the mentioned tricks: <a href="https://wiki.roll20.net/Chat_Menus" rel="nofollow">https://wiki.roll20.net/Chat_Menus</a> <a href="https://wiki.roll20.net/HTML_replacement" rel="nofollow">https://wiki.roll20.net/HTML_replacement</a>
1640981767
GiGs
Pro
Sheet Author
API Scripter
Thanks, Andreas. I had a bad fall - ice - and Im typing one handed and with the wrong hand, so handling links is too much trouble at the moment.
1640982527
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Echoing the Chat Menu route. Sooooo much easier than nesting dropdowns and dealing with html replacements. API Buttons are not well-named. They can be used for API calls, but will also run macros and abilities without requiring API access at all. Here is an example. this assumes you write the macro as an Ability on the same Character sheet that the strikes are being called from.&nbsp;&amp;{noerror} is added at the end to suppress an error message if the repeating ability does not exist. /w 'whatever the character name is' &amp;{template:default} {{name=Spellstrike}} {{[Telekinetic Projectile](~repeating_melee-strikes_$1_ATTACK-DAMAGE)}} {{[Acid Splash](~repeating_melee-strikes_$2_ATTACK-DAMAGE)}} {{[Produce Flame](~repeating_melee-strikes_$3_ATTACK-DAMAGE)}}&amp;{noerror} This might be made prettier by using one of your sheet's built-in roll templates.
1640983856
GiGs
Pro
Sheet Author
API Scripter
One of the big advantages of Chat menu buttons is you create individual macros or abilities, which you can use normally, and then call them from a chat menu. Going the nested dropdown method, the code can only be used in that macro, you need separate macros for the dropdown and for each individual action if you want to use them separately. Chat Menus work with your normal macros and abilities.