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

Macro Calling Macros on Character Sheet

I developed a custom character sheet that included text entry for abilities within the character sheet. I wanted to make a macro that allowed the player to pick which ability they use from a list, instead of having a different macro for each ability. ?{What Ability?|@{selected|abil1_name},@{selected|abil1_macro}|@{selected|abil2_name},@{selected|abil2_macro}|@{selected|abil3_name},@{selected|abil3_macro} } However, when macros are entered in the macro sections (abil#_macro) the chat parser doesn't like it, likely because the order of operations. This might be more of an API question but is there a way to circumvent this problem?
Hmm - it might be that you will need to force the evaluation of the ability names, maybe shove those parts inside an inline roll double bracket or inside parenthesis or something.
It grabs the ability names and displays them in the drop down perfectly. I've done this with currency modifier macros where it displays  "gold @{selected|gold}" The problem is not the name, it's evaluating the macro roll macro which is fairly complex with querys and api calls before you even select what ability you want to use. I might be able to circumvent this in some way using buttons in chat. but I'll have to experiment more. I'd prefer if I could fit it in a single dropdown menu but I don't think theres a way to halt the evaluation until it's been selected.
1528296592

Edited 1528296754
Ziechael
Forum Champion
Sheet Author
API Scripter
You are falling afoul of the need for html replacements as mentioned  here . The macros your query is trying to resolve to has offending characters in them that breaks it (likely } if this is a roll template but certainly the others if there are queries in the macro outputs!) Your options are thus: Replace all offending characters in every macro you are trying to call (this will prevent them from being called directly in chat however... and is a pain!) Have your query output a button to chat that the players clicks to run the desired macro as normal (1 extra click but a LOT less work) Basic example of (2) if the macros are global, if they are abilities on a sheet you can replace all the html stuff with a simple  ability command button : /w "@{selected|character_name}" ?{Attribute|Strength,[Strength](!
#str)|Dexterity,[Dexterity](!
#dex)|Constitution,[Constitution](!
#con)|Intelligence,[Intelligence](!
#int)|Wisdom,[Wisdom](!
#wis)|Charisma,[Charisma](!
#cha)}
I'll give both a try, didn't consider that the macros might need to have their html replacements. This probably can be used in the case of the abilities, however the weapons will probably have to use a button menu because there's a couple different ways to use it including roll buttons on the sheet.