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

Calling character abilities from drop down menu

November 15 (4 years ago)

Edited November 15 (4 years ago)

Hi I’m having issues trying to get a drop down menu working within a character sheet. I can get it to work with buttons. 

 &{template:npcaction} {{rname=Char menu}} } {{description= [start ](~TSAT|Start-area) [Room](~TSAT|room) [Corridor](~TSAT|Corridor) }}

but doesn’t work when I change it to a drop down menu ,

?{Which macro |Start,%(TSAT|Start-area )|room, %(TSAT|room)|corridor,%(TSAT|corridor )

 }


I have changed the code for “|” but must be missing something as displayed the name of ability not run the macro assigned to it 


any ideas 





November 17 (4 years ago)
Oosh
Sheet Author
API Scripter

You've discovered why Chat Menus are recommended for this type of thing. Those macros you're trying to link are fully expanded before the Query is parsed. If they contain any of the characters that break a Query (which they almost certainly do) you're going to have to do a whole lot of HTML replacement, creating versions of the macros which won't run unless they're nested in a Query.

Stick with the Chat Menu, is my advice :)

November 17 (4 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Obligatory Chat Menu link.

November 17 (4 years ago)
Oosh
Sheet Author
API Scripter

Well I was going to link it, then I noticed that Chris already has a working chat menu, so I figured it was redundant :)

November 18 (4 years ago)

thanks for that so if i want to keep drop down , don't want the chat menu if i can get away with with it as it fills up chat log, i need to replace all the } | with there codes 

this is one of the macros it calls so that's all the bold characters ?


&{template:default} {{name=Character start }}{{

[[1t[Starting-Area]]]

 }}

November 19 (4 years ago)
Oosh
Sheet Author
API Scripter

And also the one at the end of the template declaration - &{template:default}. But you can't nest a template in a template. You'll have to completely remove the template from either the parent macro, or the child macros.

And also, never replace characters in Attribute or Ability calls - back in your first post, you have this; %(TSAT|Start-area ), but you want %{TSAT|Start-area}.