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 Drop down Help

I am trying to make an ability dropdown for my saving throws.  I am trying to link the respective attributes but it's not working.  I have even tried making  individual abilities linked to the attribute and then create an ability linking to the individual abilities and still nothing.  Can I get some help? This is how I have the individual abilities coded: STR-Save: " @{selected|strength_save_roll} " DEX-Save: " @{selected|dexterity_save_roll} " CON-Save: " @{selected|constitution_save_roll} " INT-Save: " @{selected|intelligence_save_roll} " WIS-Save: " @{selected|wisdom_save_roll} " CHA-Save: " @{selected|charisma_save_roll} " This is the dropdown ability: "@{selected|wtype}&{template:simple} @{selected|rtype}?{Save  |Strength,%{selected|STR-Save}  |Dexterity,%{selected|DEX-Save}  |Constitution,%{selected|CON-Save}  |Intelligence,%{selected|INT-Save}  |Wisdom,%{selected|WIS-Save}  |Charisma,%{selected|CHA-Save} }" I keep getting the error of the dropdown but with the phrase "Strength,&{template:simple" being the only option.
1713061169
GiGs
Pro
Sheet Author
API Scripter
I don't know the sheet you're using, but my guess is you are running into a very common problem with queries. What is contained in this ability: %{selected|STR-Save}? When you run a macro, it grabs the content of any abilities, replaces the ability call with the content of that ability, then runs the macro. If the ability contains any characters that prematurely end the query (like comma, pipes or } symbols), the query will break. If that's the issue, you have two possible solutions: Change your macro so that it doesn't include ability calls, but insead contains the text in those abilities, and replace any problem characters with HTML entities. See the wiki. Change the macro to use Chat Menus . I prefer the Chat menu approach. Your macro would be easily converted to a chet menu: &{template:default} {{name=Attribute Roll}} {{[Strength](~selected|STR-Save) [Dexterity](~selected|DEX-Save) [Constitution](~selected|CON-Save) [Intelligence](~selected|INT-Save) [Wisdom](~selected|WIS-Save) [Charisma](~selected|CHA-Save) }} You probably want to put a whisper cammand at the start so this is whispered only to the character running it. I used the default roll template because I'm not familiar with the one you used. Feel free to change it!
Thank you I will try it out.  I think we are using  D&D 5E by Roll20. Umm, do i put this in the ability section of the character sheet?  How do I put a whisper command?
I got it!!!!!  Thank you so much!!!!!  This was amazing!!!!  I wish I could upvote you or give you stars or a review!!!!
Can chat menus be used for attributes as well? This way I don't have to create abilities and just got directly to the attribute.  For example: " @{selected|strength_save_roll} " " @{selected|dexterity_save_roll} " " @{selected|constitution_save_roll} " " @{selected|intelligence_save_roll} " " @{selected|wisdom_save_roll} " " @{selected|charisma_save_roll} "
1713065803

Edited 1713066091
GiGs
Pro
Sheet Author
API Scripter
Thank you! If the attribute just contains an attribute value, you are better off using the query. A chat menu will just show the value of that attribute. If you do make a chat menu, there's a different syntax for attributes but you can do it. It'll be on that page I linked. If you do it as a query, something like this could be a starting point: @{template:default} {{name=Attribute Roll}} {{query=[[1d20+?{Attribute? |Strength,@{selected|strength_save_roll} | dexterity, @{selected|dexterity_save_roll} | constitution, @{selected|constitution_save_roll} | intelligence, @{selected|intelligence_save_roll} |W isdom, @{selected|wisdom_save_roll} |Charisma, @{selected|charisma_save_roll} }}
Hmmm, I copied your query and it didn't work.  I got the  "Strength,&{template:simple" error.
1713070545
GiGs
Pro
Sheet Author
API Scripter
Oops, I forgot the closing inline roll brackets. It should have been @{template:default} {{name=Attribute Roll}} {{query=[[1d20+?{Attribute? |Strength,@{selected|strength_save_roll} | dexterity, @{selected|dexterity_save_roll} | constitution, @{selected|constitution_save_roll} | intelligence, @{selected|intelligence_save_roll} |W isdom, @{selected|wisdom_save_roll} |Charisma, @{selected|charisma_save_roll}]] }}
Guy L. said: Can chat menus be used for attributes as well? This way I don't have to create abilities and just got directly to the attribute.  For the D&D 5E by Roll20 sheet, I recommend using my  Statblock Macro Mule . It has chat menus for ability checks, saving throws, stats, attacks, and pretty much everything that you can reference for PCs and NPCs from the character sheet.  If you haven’t used any of your 3 free character exports, then you can import the MacroMule character and have it all set up in just a couple minutes. 
1713077397
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
More info links: Chat Menu Macro Character Sheet
Still getting the same  "Strength,&{template:simple" error. GiGs said: Oops, I forgot the closing inline roll brackets. It should have been @{template:default} {{name=Attribute Roll}} {{query=[[1d20+?{Attribute? |Strength,@{selected|strength_save_roll} | dexterity, @{selected|dexterity_save_roll} | constitution, @{selected|constitution_save_roll} | intelligence, @{selected|intelligence_save_roll} |W isdom, @{selected|wisdom_save_roll} |Charisma, @{selected|charisma_save_roll}]] }}
1713117230
GiGs
Pro
Sheet Author
API Scripter
Can you post the macro you are using? Notice in my code, the macro call was before the query.
I'm just copying and pasting your code.  Plus, I just noticed that the chat box says this message as well. " No attribute was found for @{Bea Valiant|template:default}"
1713125991
GiGs
Pro
Sheet Author
API Scripter
That error message doesn't match the code I supplied, so I don't know what's going on there.
1713127199

Edited 1713127212
GiGs
Pro
Sheet Author
API Scripter
This looks to be an issue with the D&D 5e character sheet by roll20. The contents of @{selected|strength_save_roll} is not a simple number and I was assuming it was. To get the code I posted before to work, replace _save_mod with _mod .
Yes, the attribute strength save roll is not a simpler number.  it is the whole code to make a save roll. ok let me try that.
_mod is only the modifier.  I was looking for a way to call the attribute that rolls the save.
1713129341

Edited 1713129493
Gauss
Forum Champion
Guy L. said: _mod is only the modifier.  I was looking for a way to call the attribute that rolls the save. Short version, you cannot use a query for this, you need to use Chat Menus .  The entire attribute gets substituted into the query, and if that attribute contains control characters it will break the query. Specifically "}" (ending brace), "," (comma) or "|" (pipe).  Normally the way to get that to work is to replace those with their HTML substitutes, but you are trying to call character sheet attributes so you cannot do that.  Hence, Chat Menus, as Keith and GiGs mentioned. 
OK, sounds good.  Chat Menus it is!!! Thanks for everything!