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 .
×

A dropdown that sets multiple condition states and adds mouseover text

So I'm running Savage Worlds and I have a macro that I use that sets conditions to multiple targets, like I select them and choose, " Bound " from the dropdown and the condition and custom marker are applied to the selected tokens.  My question is, can I apply multiple conditions at the same time? As an example: When setting the Bound condition, can it also apply Distracted , since that goes with being bound.  The macro I'm currently using: !token-mod --set statusmarkers|?{Status| Clear,#cleartoken | Aim,Aim::4298609| Bound,Bound::4298599| Dead,dead --order tofront --set layer#map | Defend,Defend::4298600| Distracted,Distracted::4298601| Entangled,Entangled::4298602| Fatigue,Fatigue::4298603| Hold,Hold::4298604| Shakened,Shakened::4298605| Stunned,Stunned::4298606| Vulnerable,Vulnerable::4298607| Wounded,Wounded::4298608} As a bonus question, I just saw that it's possible to add tool tips dependant on the conditions that are active. Like if the character is Bound it could, on mouseover say, "A Bound character cannot move, and is Distracted." Can this be part of the same macro without any additional selections? Thanks for any feedback, I've been banging my head against this for a while and I'm at a loss. 
Hey Ruben! Interesting challenge.  While I've not used the API for a while, I think you might be able to leverage it to achieve your goal.  The way I'm seeing the solution would be to create a "GM tab/UI" that also leverages an API script to identify you as a GM so only you can open/reveal the tab/UI...and here you have each condition as a checkbox.  Each time you tick/untick a condition, it adds/removes the condition from an array you save in a single attribute.  Select the tokens you want to apply the conditions to, and then click a "set conditions" button which runs an API script that would iterate through the selected tokens and apply each set of conditions stored in the array.  You could likely even use this same method to clear a set of conditions on a group of selected tokens, but have a "clear conditions" button to run an API script to remove selected conditions.
Alternatively, if you really wanted to keep the dropdown experience, you might be able to leverage Custom Roll Parsing by looping yourself through the dropdown menu you're using now, but with the option to add more or apply selection.  Here you'd likely need to keep building on an array as above to track your conditions.  I do believe you'd have to implement it asynchronously...not sure if you could do that without breaking the API (see Oosh's Adventures in startRoll post).
1665092675
The Aaron
Roll20 Production Team
API Scripter
Something like this ought to work: !token-mod {{ ?{Status| Clear , --set statusmarkers#+cleartoken show_tooltip#off tooltip# | Aim , --set statusmarkers#+Aim::4298609 show_tooltip#on tooltip#"Taking Aim gives you some bonus." | Bound , --set statusmarkers#+Bound::4298599#+Distracted::4298601 show_tooltip#on tooltip#"A Bound character cannot move, and is Distracted." | Dead , --set statusmarkers#=dead show_tooltip#off tooltip# --order tofront --set layer#map | Defend , --set statusmarkers#+Defend::4298600 show_tooltip#on tooltip#"stuff" | Distracted , --set statusmarkers#+Distracted::4298601 show_tooltip#on tooltip#"stuff" | Entangled , --set statusmarkers#+Entangled::4298602 show_tooltip#on tooltip#"stuff" | Fatigue , --set statusmarkers#+Fatigue::4298603 show_tooltip#on tooltip#"stuff" | Hold , --set statusmarkers#+Hold::4298604 show_tooltip#on tooltip#"stuff" | Shakened , --set statusmarkers#+Shakened::4298605 show_tooltip#on tooltip#"stuff" | Stunned , --set statusmarkers#+Stunned::4298606 show_tooltip#on tooltip#"stuff" | Vulnerable , --set statusmarkers#+Vulnerable::4298607 show_tooltip#on tooltip#"stuff" | Wounded , --set statusmarkers#+Wounded::4298608 show_tooltip#on tooltip#"stuff" } }} You can apply multiple status markers by separating them with | or # on the set line.  You may want to not append statuses, in which case change the first + to a =. (or omit it.).
Thanks very much, both of you. I'm taking a look, and hopefully this will set me right. I really appreciate it.