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

How can I select a subset of options instead of a single option from a roll query dropdown?

1717184692

Edited 1717185937
Hi, everyone! First time posting on the community forum. Sorry in advance if I'm going about things the wrong way in asking for assistance. I'm trying to figure out how to allow my roll query dropdown prompt to allow a user to select multiple items from the list. Something like what you see in the picture below. Is this possible? If not, how else might I provide a user a way to select multiple options from a dropdown list?
(Not sure if the image uploaded correctly before)
Unfortunately the Roll20 Roll Query system  only allow for a single option to be selected/output from each unique query within a chat message. If the total list of options is not too long, then you could build a query that had all possible iterations of options (E.g. A, B, C, A&B, A&C, B&C, A&B&C) but that is likely going to be a little awkward to create and use, and completely unwieldly when you get to more than four or five options. If you explain what you are trying to do, then there might be other solutions that don't involve using queries.
1717188984

Edited 1717189913
Basically, I'm working on a script that'll let my players cast a spell of their choosing. The player selects a spell to cast, feeds in a couple of params, and then stuff happens on the map (visual effect, sound effect, status marker on token, saving throws, damage/healing, etc. etc.) I've tried a couple different text input syntaxes a player can use, and they worked, but they're all a bit clunky. For example, a player attempting to cast fireball might do "!spell fireball (referencetoken) x y", where x and y are measured in squares from the reference token, or the top left square if a reference token is not provided. It works, but probably not the best experience for a user? Especially since you have to remember what order all the args go in. I switched it up recently to use a more direct key-value system, so you could do "!spell fireball reference=___ x=_ y=_", and this is still the basis on which I'm trying to build roll queries to get user input, sparing my players from having to memorize the commands. Spells like Bless are where I would want to have this multiple-select dropdown, so a player can easily select which tokens get a little marker indicating blessed status. Usually my sessions have 5 people, but last session I had all 10 players present, so having an exhaustive list of the combinations probably won't be practical. No biggie if it can't be done here. Perhaps I could have a script recursively ask the player for targets until they select some sort of completion value, but multiple-select from a single dropdown would've been a lot better for streamlining. If you've got ideas, I'm all ears. But either way, thanks for answering my question!
1717193407
timmaugh
Forum Champion
API Scripter
If you are up for it, you could build a handout interface for your spell... You can't think of it like a typical UI, though. The controls might look like dropdowns, checkboxes, etc, but they would be sending a command through the chat that would reformat the handout on the fly... so you could have a "checkbox" for each character in the party. Clicking a checkbox would send a command to reformat that image to be "checked" or "unchecked", and it would add/remove the character from the final command line (adding them to the list of affected characters, or removing them). For another spell, you could have a dropdown (which would actually fire a query to handle the picking of a value) which would ask how many targets you wanted. Whatever you picked, the targeting statements would be added to the final command line. Whatever the interface built as the final command line would, after every interface change, be stored as the command line behind a button on the form for "Execute!" (or some such). So, to sum up, the interface sends command lines through the chat that reformat the handout and modify the final command line that the "Execute" button will eventually launch. Once the player has finished configuring their spell options, they hit the button and... Pick target 1 of 2, ya heathen... Pick target 2, or do ya think yer special? Annnnnnnnnd.... Bob's your uncle.