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

Drop down menues for character abilities

so, i want to make token actions for saving throws and skill checks. but i cant seem to get this to work no matter how hard i try.  i want to make a drop down menu, so that it rolls the traditional saving throws and skill checks from the 5E sheet. i found the attributes, and i found i can even copy and paste them into an ability and it works just fine.  but when i make a drop down menu, no matter how i try to add it, the code breaks somehow and i cant figure out how to fix it.  at first i tried ?{Saving Throw|Strength, [[@{strength_save_roll}]]} which i assumed would work similar to all of my [[@{Wisdom_mod}]] add ins and etc etc. but it didnt.  i tried removing the flat brackets. ive tried replacing everything with html code.  i even tried adding them to a separate ability and linking the ability.  no matter what i do i cannot seem to add this to the drop down menu and i cannot for the life of me figure out how to fix it.
1595474573
GiGs
Pro
Sheet Author
API Scripter
If that attribute name is correct, that should work. I prefer using this format for queries, it makes the structure easier to see. ?{Saving Throw| Strength, [[@{strength_save_roll}]]| Wisdom, [[@{wisdom_save_roll}]]} Is this a query on its own, a query nested in another query?
i just tried exactly what you wrote and it broke.  i dont know how to explain, but after the first "|" it just has the entire rest of the script in the box, instead of creating a drop down menu.
also, im a free user so i cant use API i need a solution that doesnt require coding, if there is one.
Is this a query on its own, a query nested in another query? sorry didnt see this part of your question.  its just one query, in an ability.  i want them to roll exactly like they do off the character sheet, just as a token action.
1595476871

Edited 1595476914
GiGs
Pro
Sheet Author
API Scripter
Can you post the entire ability you are using. Your screenshot shows a & symbol in a very odd place.
GiGs said: Can you post the entire ability you are using. Your screenshot shows a & symbol in a very odd place. i think its the HTML version of the @ symbol which is "@"
1595477073

Edited 1595477213
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The problem is that those attributes are actually roll template expressions, parsed and created by the sheet. The contents of @{strength_save_roll} are actually: @{wtype}&{template:simple} {{rname=^{strength-save-u}}} {{mod=@{strength_save_bonus}}} {{r1=[[@{d20}+@{strength_save_bonus}@{pbd_safe}]]}} {{always=1}} {{r2=[[@{d20}+@{strength_save_bonus}@{pbd_safe}]]}} {{global=@{global_save_mod}}} @{charname_output} Which will break the parsing of the query, due to order of operations. Instead of the saving throw being a roll button, it's actually the text of a roll template sitting in an attribute. You can't call it as an action. I messed with this a while back, and didn't find a good solution.
could it be that i'm using custom races and classes?  i dont know why it would effect saving throws and skill checks, but i cant think of any other reason why an attribute that came with the character sheet wouldnt work
keithcurtis said: The problem is that those attributes are actually roll template expressions, parsed and created by the sheet. The contents of @{strength_save_roll} are actually: @{wtype}&{template:simple} {{rname=^{strength-save-u}}} {{mod=@{strength_save_bonus}}} {{r1=[[@{d20}+@{strength_save_bonus}@{pbd_safe}]]}} {{always=1}} {{r2=[[@{d20}+@{strength_save_bonus}@{pbd_safe}]]}} {{global=@{global_save_mod}}} @{charname_output} Which will break the parsing of the query, due to order of operations. I messed with this a while back, and didn't find a good solution. i considered this, and attempted to include the template into the roll query like i do with the NPC action template, but i couldnt really figure out the order of the contents or how to order it.  its simple with the npc template, because you just add the roll query into the description section. i have no idea how to add it into the simple template. 
1595477315
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It's not constructed like everything else, for some unknown reason. It's nothing you are doing wrong. There have been a number of design choices made with the structure of the D&D 5th Edition by Roll20 Sheet this year that I do not understand the reason for.
wait, what if i broke down the actual save roll, and moved it into a different template instead? would that be possible? because if i could, for example, transfer the "strength_save-roll" information to the "attack" template, for example. i could attempt to dump the roll query into the description section, and then split the template and names from the actual rolls? it sounds really complicated but its the only way i think i could make it work, if its possible at all
1595477545

Edited 1595477659
GiGs
Pro
Sheet Author
API Scripter
Thanks, Keith. That screenshot made me suspect this was the case. Edit: I'm replying several posts late, but this is still good advice. When you run a macro, roll20 collects all the attributes mentioned in the macro, and replaces them with their values. So this macro  ?{Saving Throw| Strength, [[@{strength_save_roll}]]} becomes ?{Saving Throw| Strength,  @{wtype}&{template:simple} {{rname=^{strength-save-u}}} {{mod=@{strength_save_bonus}}} {{r1=[[@{d20}+@{strength_save_bonus}@{pbd_safe}]]}} {{always=1}} {{r2=[[@{d20}+@{strength_save_bonus}@{pbd_safe}]]}} {{global=@{global_save_mod}}} @{charname_output} } And then roll20 attempts to evaluate it, and it breaks as Keith describes. The only way to solve this is to build your own copies of the save_roll abilities, formatted to work in the dropdown. A better way is to use a chat menu, where you don't need to do anything to the abilities. Something like /w "character name" &{template@default} {{saves=[Strength](~strength_save_roll) [Dexterity](~dexterity_save_roll)}} Change "character name" to your characters name (keeping the quotes if the name has a space in it). I used the default teplate here, but you can of course change it to one your sheet runs.
1595478038
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
GiGs said: The only way to solve this is to build your own copies of the save_roll abilities, formatted to work in the dropdown. A better way is to use a chat menu, where you don't need to do anything to the abilities. Something like /w "character name" &{template@default} {{saves=[Strength](~strength_save_roll) [Dexterity](~dexterity_save_roll)}} Change "character name" to your characters name (keeping the quotes if the name has a space in it). I used the default teplate here, but you can of course change it to one your sheet runs. Even with a chat menu, you would need to create custom abilities. The built-in ones are attributes and can't be called with the tilde notation. It's needlessly difficult.
GiGs said: Thanks, Keith. That screenshot made me suspect this was the case. Edit: I'm replying several posts late, but this is still good advice. When you run a macro, roll20 collects all the attributes mentioned in the macro, and replaces them with their values. So this macro  ?{Saving Throw| Strength, [[@{strength_save_roll}]]} becomes ?{Saving Throw| Strength,  @{wtype}&{template:simple} {{rname=^{strength-save-u}}} {{mod=@{strength_save_bonus}}} {{r1=[[@{d20}+@{strength_save_bonus}@{pbd_safe}]]}} {{always=1}} {{r2=[[@{d20}+@{strength_save_bonus}@{pbd_safe}]]}} {{global=@{global_save_mod}}} @{charname_output} } And then roll20 attempts to evaluate it, and it breaks as Keith describes. The only way to solve this is to build your own copies of the save_roll abilities, formatted to work in the dropdown. A better way is to use a chat menu, where you don't need to do anything to the abilities. Something like /w "character name" &{template@default} {{saves=[Strength](~strength_save_roll) [Dexterity](~dexterity_save_roll)}} Change "character name" to your characters name (keeping the quotes if the name has a space in it). I used the default teplate here, but you can of course change it to one your sheet runs. so the problem i have with this is i want to try and make this work for skill checks as well.  and some of my players have expert in skill checks and the whole nine yard. and in the future id like to be able to just copy and paste a premade script that is fairly universal.  if i cant make it work, thats fine. but i would rather sit down and try to iron this out now to make the work easier for me later, if that makes sense.  at the end of the say, having to go in and customize each script for each character is tedious and time consuming and if i can avoid it i absolutely will lmao
1595478411
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
For most characters, the macros below should work, saved as character abilities: Saves: @{selected|wtype}&{template:simple} @{selected|rtype}?{Save|Strength, +@{selected|strength_save_bonus}@{selected|pbd_safe}]]}} {{rname=Strength Save}&#125 {{mod=@{selected|strength_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|strength_save_bonus}@{selected|pbd_safe}]]}} |Dexterity, +@{selected|dexterity_save_bonus}@{selected|pbd_safe}]]}} {{rname=Dexterity Save}&#125 {{mod=@{selected|dexterity_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|dexterity_save_bonus}@{selected|pbd_safe}]]}} |Constitution, +@{selected|constitution_save_bonus}@{selected|pbd_safe}]]}} {{rname=Constitution Save}&#125 {{mod=@{selected|constitution_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|constitution_save_bonus}@{selected|pbd_safe}]]}} |Intelligence, +@{selected|intelligence_save_bonus}@{selected|pbd_safe}]]}} {{rname=Intelligence Save}&#125 {{mod=@{selected|intelligence_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|intelligence_save_bonus}@{selected|pbd_safe}]]}} |Wisdom, +@{selected|wisdom_save_bonus}@{selected|pbd_safe}]]}} {{rname=Wisdom Save}&#125 {{mod=@{selected|wisdom_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|wisdom_save_bonus}@{selected|pbd_safe}]]}} |Charisma, +@{selected|charisma_save_bonus}@{selected|pbd_safe}]]}} {{rname=Charisma Save}&#125 {{mod=@{selected|charisma_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|charisma_save_bonus}@{selected|pbd_safe}]]}}}@{selected|global_save_mod}@{selected|charname_output} Checks @{selected|wtype}&{template:simple} @{selected|rtype}?{Ability|Acrobatics, +@{selected|acrobatics_bonus}@{selected|pbd_safe} ]]}} {{rname=Acrobatics}} {{mod=@{selected|acrobatics_bonus}}} {{r1=[[ @{selected|d20} + @{selected|acrobatics_bonus}@{selected|pbd_safe} ]]}} |Animal Handling, +@{selected|animal_handling_bonus}@{selected|pbd_safe} ]]}} {{rname=Animal Handling}} {{mod=@{selected|animal_handling_bonus}}} {{r1=[[ @{selected|d20} + @{selected|animal_handling_bonus}@{selected|pbd_safe} ]]}} |Arcana, +@{selected|arcana_bonus}@{selected|pbd_safe} ]]}} {{rname=Arcana}} {{mod=@{selected|arcana_bonus}}} {{r1=[[ @{selected|d20} + @{selected|arcana_bonus}@{selected|pbd_safe} ]]}} |Athletics, +@{selected|athletics_bonus}@{selected|pbd_safe} ]]}} {{rname=Athletics}} {{mod=@{selected|athletics_bonus}}} {{r1=[[ @{selected|d20} + @{selected|athletics_bonus}@{selected|pbd_safe} ]]}} |Deception, +@{selected|deception_bonus}@{selected|pbd_safe} ]]}} {{rname=Deception}} {{mod=@{selected|deception_bonus}}} {{r1=[[ @{selected|d20} + @{selected|deception_bonus}@{selected|pbd_safe} ]]}} |History, +@{selected|history_bonus}@{selected|pbd_safe} ]]}} {{rname=History}} {{mod=@{selected|history_bonus}}} {{r1=[[ @{selected|d20} + @{selected|history_bonus}@{selected|pbd_safe} ]]}} |Insight, +@{selected|insight_bonus}@{selected|pbd_safe} ]]}} {{rname=Insight}} {{mod=@{selected|insight_bonus}}} {{r1=[[ @{selected|d20} + @{selected|insight_bonus}@{selected|pbd_safe} ]]}} |Intimidation, +@{selected|intimidation_bonus}@{selected|pbd_safe} ]]}} {{rname=Intimidation}} {{mod=@{selected|intimidation_bonus}}} {{r1=[[ @{selected|d20} + @{selected|intimidation_bonus}@{selected|pbd_safe} ]]}} |Investigation, +@{selected|investigation_bonus}@{selected|pbd_safe} ]]}} {{rname=Investigation}} {{mod=@{selected|investigation_bonus}}} {{r1=[[ @{selected|d20} + @{selected|investigation_bonus}@{selected|pbd_safe} ]]}} |Medicine, +@{selected|medicine_bonus}@{selected|pbd_safe} ]]}} {{rname=Medicine}} {{mod=@{selected|medicine_bonus}}} {{r1=[[ @{selected|d20} + @{selected|medicine_bonus}@{selected|pbd_safe} ]]}} |Nature, +@{selected|nature_bonus}@{selected|pbd_safe} ]]}} {{rname=Nature}} {{mod=@{selected|nature_bonus}}} {{r1=[[ @{selected|d20} + @{selected|nature_bonus}@{selected|pbd_safe} ]]}} |Perception, +@{selected|perception_bonus}@{selected|pbd_safe} ]]}} {{rname=Perception}} {{mod=@{selected|perception_bonus}}} {{r1=[[ @{selected|d20} + @{selected|perception_bonus}@{selected|pbd_safe} ]]}} |Performance, +@{selected|performance_bonus}@{selected|pbd_safe} ]]}} {{rname=Performance}} {{mod=@{selected|performance_bonus}}} {{r1=[[ @{selected|d20} + @{selected|performance_bonus}@{selected|pbd_safe} ]]}} |Persuasion, +@{selected|persuasion_bonus}@{selected|pbd_safe} ]]}} {{rname=Persuasion}} {{mod=@{selected|persuasion_bonus}}} {{r1=[[ @{selected|d20} + @{selected|persuasion_bonus}@{selected|pbd_safe} ]]}} |Religion, +@{selected|religion_bonus}@{selected|pbd_safe} ]]}} {{rname=Religion}} {{mod=@{selected|religion_bonus}}} {{r1=[[ @{selected|d20} + @{selected|religion_bonus}@{selected|pbd_safe} ]]}} |Sleight of Hand, +@{selected|sleight_of_hand_bonus}@{selected|pbd_safe} ]]}} {{rname=Sleight of Hand}} {{mod=@{selected|sleight_of_hand_bonus}}} {{r1=[[ @{selected|d20} + @{selected|sleight_of_hand_bonus}@{selected|pbd_safe} ]]}} |Stealth, +@{selected|stealth_bonus}@{selected|pbd_safe} ]]}} {{rname=Stealth}} {{mod=@{selected|stealth_bonus}}} {{r1=[[ @{selected|d20} + @{selected|stealth_bonus}@{selected|pbd_safe} ]]}} |Survival, +@{selected|survival_bonus}@{selected|pbd_safe} ]]}} {{rname=Survival}} {{mod=@{selected|survival_bonus}}} {{r1=[[ @{selected|d20} + @{selected|survival_bonus}@{selected|pbd_safe} ]]}} |Strength, +@{selected|strength_mod}@{selected|jack_attr}[STR]]]}} {{rname=Strength}} {{mod=@{selected|strength_mod}@{selected|jack_bonus}}} {{r1=[[ @{selected|d20} + @{selected|strength_mod}@{selected|jack_attr}[STR]]]}} |Dexterity, +@{selected|dexterity_mod}@{selected|jack_attr}[DEX]]]}} {{rname=Dexterity}} {{mod=@{selected|dexterity_mod}@{selected|jack_bonus}}} {{r1=[[ @{selected|d20} + @{selected|dexterity_mod}@{selected|jack_attr}[DEX]]]}} |Constitution, +@{selected|constitution_mod}@{selected|jack_attr}[CON]]]}} {{rname=Constitution}} {{mod=@{selected|constitution_mod}@{selected|jack_bonus}}} {{r1=[[ @{selected|d20} + @{selected|constitution_mod}@{selected|jack_attr}[CON]]]}} |Intelligence, +@{selected|intelligence_mod}@{selected|jack_attr}[INT]]]}} {{rname=Intelligence}} {{mod=@{selected|intelligence_mod}@{selected|jack_bonus}}} {{r1=[[ @{selected|d20} + @{selected|intelligence_mod}@{selected|jack_attr}[INT]]]}} |Wisdom, +@{selected|wisdom_mod}@{selected|jack_attr}[WIS]]]}} {{rname=Wisdom}} {{mod=@{selected|wisdom_mod}@{selected|jack_bonus}}} {{r1=[[ @{selected|d20} + @{selected|wisdom_mod}@{selected|jack_attr}[WIS]]]}} |Charisma, +@{selected|charisma_mod}@{selected|jack_attr}[CHA]]]}} {{rname=Charisma}} {{mod=@{selected|charisma_mod}@{selected|jack_bonus}}} {{r1=[[ @{selected|d20} + @{selected|charisma_mod}@{selected|jack_attr}[CHA]]]}} } @{selected|global_skill_mod} @{selected|charname_output} They will fail in some outlying circumstances, like characters with Reliable Talent.
man i have two rogues in my group as well. is there a way to incorporate that kind of thing? is there some kind of script that will replace a roll with 10? or is that not possible? i might just have to give up and accept defeat on this one. 
thank you for all of the help guys. i really appreciate it. ill just stick to finishing out mapping my spellbook for now. ill probably post it when im finished. <3
1595515248

Edited 1595515660
Oosh
Sheet Author
API Scripter
keithcurtis said: Even with a chat menu, you would need to create custom abilities. The built-in ones are attributes and can't be called with the tilde notation. It's needlessly difficult. My chat menus still work fine with the %{selected|strength_save} calls. Are yours not working? Actually a Cat said: man i have two rogues in my group as well. is there a way to incorporate that kind of thing? is there some kind of script that will replace a roll with 10? or is that not possible? i might just have to give up and accept defeat on this one.  Maybe this will help? It's a Query menu, which I'm not a huge fan of. But the Attributes that change the {{r1}} and {{r2}} fields could be used for a chat menu instead. A chat menu would be superior since you can just use the custom code for the skills the Rogues are proficient in, so they're not rolling Reliable Talent on skills they shouldn't be.
1595517291
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Oosh said: keithcurtis said: Even with a chat menu, you would need to create custom abilities. The built-in ones are attributes and can't be called with the tilde notation. It's needlessly difficult. My chat menus still work fine with the %{selected|strength_save} calls. Are yours not working? Actually a Cat said: man i have two rogues in my group as well. is there a way to incorporate that kind of thing? is there some kind of script that will replace a roll with 10? or is that not possible? i might just have to give up and accept defeat on this one.  Maybe this will help? It's a Query menu, which I'm not a huge fan of. But the Attributes that change the {{r1}} and {{r2}} fields could be used for a chat menu instead. A chat menu would be superior since you can just use the custom code for the skills the Rogues are proficient in, so they're not rolling Reliable Talent on skills they shouldn't be. %{selected|strength_save} is different from @{strength_save_roll}, but I remember having issues constructing a valid query that worked in all cases. It might have been in the case of Ability Checks. Maybe I should revisit it.
i tried that query and it just appears as a pound symbol in chat whenever i click it haha i might just calculate it manually, since its always just going to be 10+the modifier if they roll 9 or lower. so i can just on their specific skill checks add the base number in parenthesis as a reference.
so one more wuestion before i give up enitrely.  is there a way to add character abilities to drop down menus? or does it read the same way these are reading as well?  cause i was trying to see if i could just mace character abilitys by copy and pasting the save throws and it worked, but i tried adding character abilities to the dropdown menu and it broke the code again. im at the point where ill probably just make my own custom rolls with the template i actually like hahaha
1595561663

Edited 1595561819
Oosh
Sheet Author
API Scripter
keithcurtis said: %{selected|strength_save} is different from @{strength_save_roll}, but I remember having issues constructing a valid query that worked in all cases. It might have been in the case of Ability Checks. Maybe I should revisit it. I think the new @{strength_save_roll} is now linked to by %{strength_save} . I've edited the Attribute @{strength_save_roll} on my good friend bob to throw the word "blah" into the mod section. Clicked from the character sheet (which goes straight to the Attribute) gives me the output with "blah". Rolling straight from my chat menu (which still uses %{strength_save}), I get exactly the same output. I haven't modified anything else: So I think they're effectively the same? Happy to be proven wrong, but as far as I can tell those older Ability calls still work, and link straight to the newer Attribute format. Actually a Cat said: so one more wuestion before i give up enitrely.  is there a way to add character abilities to drop down menus? or does it read the same way these are reading as well?  cause i was trying to see if i could just mace character abilitys by copy and pasting the save throws and it worked, but i tried adding character abilities to the dropdown menu and it broke the code again. im at the point where ill probably just make my own custom rolls with the template i actually like hahaha It is possible - I've just answered the same question in this thread . It requires using HTML entities to create version of the macro which will not function unless they are called from a Query. It's a lot of extra faffing about compared to chat menus, and significantly more  effort to make changes. Chat menus are much easier to deal with, honestly. If you mess up ONE macro in a drop-down menu with 20 macros, you can break the entire thing. Messing up a macro in a chat menu just breaks that one macro.
yeah i currently have a cat box that posts and has buttons that you click. and it works fine for what i want. i just personally would have preferred a drop down menu version instead.
for thr abilities and saving throws i just have a custom little thing made so i can create a drop down menu. but for things that have a more complicated set up, i have it as a chat box. (ignore the names and set up we are using a homebrew weapon system lol) ALSO, as a side note, their names are links to their character sheets as well. it wasnt really a necessary flair but i figured i would add it because why not