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

Player Accessible Macro or API to Set Token Marker

Hi all, I've recently decided to up my marker game, as it's becoming more of an issue as we hit higher levels with more complex fights. I've put together a complete list of markers for over 100 conditions and spell effects. What I'd like to do next is make it something the players are in control of, but also avoid them having to scroll through an extensive list of icons that covers half the map beneath the token. Ideally, I'd have a button they could press that either produces a scrollable text dropdown of options or a search bar where they can type the spell or condition etc. That way, they can apply the relevant marker via text, instead of visual identification, especially as some look quite similar. Is this something anyone has a script for already, where I can just input the specific marker names? Would it be possible / better to amend Token Mod or borrow and simplify its code to fulfill this function? Or is it something I'd have to figure out from scratch? Either way, I'd be very grateful for links to any resources that would help. I don't mind doing some grunt work to save my players hassle, but I really want to reduce steps to keep the flow of the game going. For example, a reference sheet they have to search through where every marker is labelled and given a number that they then have to type in would be more trouble than its worth to them, I think. Thanks in advance.
1613147945

Edited 1613148055
David M.
Pro
API Scripter
Here is an example of a chat menu-style macro that sets conditions markers for a selected token. Currently whispers to GM, but that is easily modified. Note that some of these address custom markers that I have made, so some of these buttons won't work for you. You can get a list of the marker names you have available by opening the toke-mod help handout. /w gm &{template:desc} {{desc=**SET STATUS CONDITIONS** [Concentration](!token-mod --set statusmarkers#!Concentration| [Blessed](!token-mod --set statusmarkers#!Bless) | [Raging](!token-mod --set statusmarkers#!AngryAxe) | [Marked](!token-mod --set statusmarkers#!archery-target) | [Hexed](!token-mod --set statusmarkers#!skull) [Blinded](!token-mod --set statusmarkers#!Blind) | [Charmed](!token-mod --set statusmarkers#!broken-heart) | [Deafened](!token-mod --set statusmarkers#!edge-crack) | [Frightened](!token-mod --set statusmarkers#!Fear) | [Grappled](!token-mod --set statusmarkers#!Grabbed) | [Invisibility](!token-mod --set statusmarkers#!Invisible) | [Incapacitated](!token-mod --set statusmarkers#!interdiction) | [Paralyzed](!token-mod --set statusmarkers#!pummeled) | [Petrified](!token-mod --set statusmarkers#!frozen-orb) | [Poisoned](!token-mod --set statusmarkers#!Poisoned) | [Prone](!token-mod --set statusmarkers#!Prone) | [Restrained](!token-mod --set statusmarkers#!fishing-net) | [Stunned](!token-mod --set statusmarkers#!fist) | [Unconscious](!token-mod --set statusmarkers#!sleepy) [Blue](!token-mod --set statusmarkers|!blue) | [Purple](!token-mod --set statusmarkers|!purple) | [Pink](!token-mod --set statusmarkers|!pink) | [Yellow](!token-mod --set statusmarkers|!yellow) | [OFF](!token-mod --set statusmarkers|=dead|-dead)}} This could also be modified into a query to not spam your chat if you want to include all 100+ markers. Simple example: !token-mod --set statusmarkers|!?{Condition?|Bloody,red|Blind,bleeding-eye} Note you may have to check the " Players can use --ids"  box in the api script page to allow players to use this. 
1613148933
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You can do this with Combat Master or Token-Mod and a drop down query. I chose Combat Master, since the condition is tracked and can be queried (click on a token and get a list of conditions on it, any one of which can be expounded upon). It does require configuring CM with you condition list, choosing markers and inputting explanations, but you were probably going to do that anyway.  Here is the macro which assigns conditions: !cmaster --add,condition=?{Set Condition| AFK,afk| Blinded,blinded| Burrowing,burrowing| Charmed,charmed| Concentrating,concentrating| Cover,cover| Deafened,deafened| Diseased,diseased| Dodging,dodging| Ethereal,ethereal| x1,exhaustion 1| x2,exhaustion 2| x3,exhaustion 3| x4,exhaustion 4| x5,exhaustion 5| x6,exhaustion 6| Flying,flying| Frightened,frightened| Grappled,grappled| HalfCover,cover half| Haste,haste| Cursed,hexblades curse| hex,hex| Hidden,hidden| Incapacitated,incapacitated| Inspiration,inspiration| Invisible,invisible| Light,xxxLight| Marked,marked| Mounted,mounted| Paralyzed,paralyzed| Petrified,petrified| Poisoned,poisoned| Prone,prone| Readied,readied| Restrained,restrained| Slow,slow| Stunned,stunned| ThreeQuarterCover,cover three quarter| Torch,torch| Unconscious,unconscious| Wild Shaped,wild shape},duration=10,direction=1 Here is what it looks like in play, assigning the blinded condition to a bear: As soon as the condition is assigned, this pops up in chat, to remind me of the rule: If three rounds later, I need to be reminded what that eyeball means, can click a reporting macro: !cmaster --config,announcements,key=announceTurn,value=true !cmaster --show,assigned !cmaster --config,announcements,key=announceTurn,value=false Which calls up this on the selected token: Each condition on the list (bold type) is a link which can call up the rule display from the previous screen shot. To remove all conditions, I run this: !token-mod --set statusmarkers|=dead|-dead Finally, I hard coded the 10 rounds decreasing by 1 count per round in the initial macro. I only use Combat Master for this purpose, preferring to handle the rest manually, but those values (at the end of the macro) could be replaced by queries if you prefer. The Association for the Prevention of Cruelty to Fictitious Animals would like to report that no tokenized bears were actually blinded during this exercise. This was for demonstration purposes only.
Jimmy K. said: What I'd like to do next is make it something the players are in control of, but also avoid them having to scroll through an extensive list of icons that covers half the map beneath the token. Suggestions: 1. I think TokenMod is the best way to go for an API script, as it has all the functionality that you're looking for, with a bit of up-front work to organize things into chat menus or queries. 2. Take a look at the Stylening thread on the forum and look into using Stylus to adjust the display of the Token Marker popout in addition to macros. Here's what my Token Marker menu and Macro chat menu looks like: Here's my macro for my Chat Menu: !noarchive /w GM &{template:npcaction} {{rname=Status Marker List}} {{description=  [**Status**](#" %{DIV|Green}) [Concentrating](!token-mod %{DIV|ReportToggle}Concentrating" --set statusmarkers|!Concentrating #" %{DIV|Green}) | [Held Action](!token-mod %{DIV|ReportToggle}Held Action" --set statusmarkers|!Held-Action #" %{DIV|Green}) [Dead](!token-mod --report gm|"{name} is dead" --order back --set tint_color|ffaaaa showplayers_name|off #" %{DIV|Red}) | [Alive](!token-mod --report gm|"{name} is alive" --order front --set tint_color|transparent showplayers_name|on #" %{DIV|Blue})  [**Helpful**](#" %{DIV|Blue}) [Blessed](!token-mod %{DIV|ReportToggle}Blessed" --set statusmarkers|!Blessed #" %{DIV|Blue}) | [Enlarged](!token-mod %{DIV|ReportToggle}Enlarged" --set statusmarkers|!Enlarged #" %{DIV|Blue}) | [Flying](!token-mod %{DIV|ReportToggle}Flying" --set statusmarkers|!Flying #" %{DIV|Blue}) | [Hasted](!token-mod %{DIV|ReportToggle}Hasted" --set statusmarkers|!Hasted #" %{DIV|Blue}) | [Heroism](!token-mod %{DIV|ReportToggle}Heroism" --set statusmarkers|!Heroism #" %{DIV|Blue}) | [Hidden](!token-mod %{DIV|ReportToggle}Hidden" --set statusmarkers|!Hidden #" %{DIV|Blue}) | [Inspiration](!token-mod %{DIV|ReportToggle}Inspiration" --set statusmarkers|!Inspiration #" %{DIV|Blue}) | [Invisible](!token-mod %{DIV|ReportToggle}Invisible" --set statusmarkers|!Invisible #" %{DIV|Blue}) | [Raging](!token-mod %{DIV|ReportToggle}Raging" --set statusmarkers|!Raging #" %{DIV|Blue}) | [Ritual](!token-mod %{DIV|ReportToggle}Ritual" --set statusmarkers|!Ritual #" %{DIV|Blue}) | [Sacred Weapon](!token-mod %{DIV|ReportToggle}Sacred Weapon" --set statusmarkers|!Sacred-Weapon #" %{DIV|Blue}) | [Shrunken](!token-mod %{DIV|ReportToggle}Shrunken" --set statusmarkers|!Shrunken #" %{DIV|Blue}) | [Stable](!token-mod %{DIV|ReportToggle}Stable" --set statusmarkers|!Stable #" %{DIV|Blue}) | [Warded](!token-mod %{DIV|ReportToggle}Warded" --set statusmarkers|!Warded #" %{DIV|Blue})  [**Harmful**](#" %{DIV|Red}) [Bane](!token-mod %{DIV|ReportToggle}Bane" --set statusmarkers|!Bane #" %{DIV|Red}) | [Banished](!token-mod %{DIV|ReportToggle}Banished" --set statusmarkers|!Banished #" %{DIV|Red}) | [Blind](!token-mod %{DIV|ReportToggle}Blind" --set statusmarkers|!Blind #" %{DIV|Red}) | [Charmed](!token-mod %{DIV|ReportToggle}Charmed" --set statusmarkers|!Charmed #" %{DIV|Red}) | [Confused](!token-mod %{DIV|ReportToggle}Confused" --set statusmarkers|!Confused #" %{DIV|Red}) | [Cursed](!token-mod %{DIV|ReportToggle}Cursed" --set statusmarkers|!Cursed #" %{DIV|Red}) | [Deafened](!token-mod %{DIV|ReportToggle}Deafened" --set statusmarkers|!Deafened #" %{DIV|Red}) | [Drowning](!token-mod %{DIV|ReportToggle}Drowning" --set statusmarkers|!Drowning #" %{DIV|Red}) | [Dying](!token-mod %{DIV|ReportToggle}Dying" --set statusmarkers|!Dying #" %{DIV|Red}) | [Encumbered](!token-mod %{DIV|ReportToggle}Encumbered" --set statusmarkers|!Encumbered #" %{DIV|Red}) | [Exhaustion](!token-mod %{DIV|ReportToggle}Exhaustion" --set statusmarkers|!Exhaustion #" %{DIV|Red}) | [Frightened](!token-mod %{DIV|ReportToggle}Frightened" --set statusmarkers|!Frightened #" %{DIV|Red}) | [Frozen](!token-mod %{DIV|ReportToggle}Frozen" --set statusmarkers|!Frozen #" %{DIV|Red}) | [Grappled](!token-mod %{DIV|ReportToggle}Grappled" --set statusmarkers|!Grappled #" %{DIV|Red}) | [Hexed](!token-mod %{DIV|ReportToggle}Hexed" --set statusmarkers|!Hexed #" %{DIV|Red}) | [Incapacitated](!token-mod %{DIV|ReportToggle}Incapacitated" --set statusmarkers|!Incapacitated #" %{DIV|Red}) | [Marked](!token-mod %{DIV|ReportToggle}Marked" --set statusmarkers|!Marked #" %{DIV|Red}) | [On-Fire](!token-mod %{DIV|ReportToggle}On Fire" --set statusmarkers|!On-fire #" %{DIV|Red}) | [Paralyzed](!token-mod %{DIV|ReportToggle}Paralyzed" --set statusmarkers|!Paralyzed #" %{DIV|Red}) | [Petrified](!token-mod %{DIV|ReportToggle}Petrified" --set statusmarkers|!Petrified #" %{DIV|Red}) | [Poisoned](!token-mod %{DIV|ReportToggle}Poisoned" --set statusmarkers|!Poisoned #" %{DIV|Red}) | [Prone](!token-mod %{DIV|ReportToggle}Prone" --set statusmarkers|!Prone #" %{DIV|Red}) | [Restrained](!token-mod %{DIV|ReportToggle}Restrained" --set statusmarkers|!Restrained #" %{DIV|Red}) | [Silenced](!token-mod %{DIV|ReportToggle}Silenced" --set statusmarkers|!Silenced #" %{DIV|Red}) | [Slowed](!token-mod %{DIV|ReportToggle}Slowed" --set statusmarkers|!Slowed #" %{DIV|Red}) | [Stunned](!token-mod %{DIV|ReportToggle}Stunned" --set statusmarkers|!Stunned #" %{DIV|Red}) | [Suffocating](!token-mod %{DIV|ReportToggle}Suffocating" --set statusmarkers|!Suffocating #" %{DIV|Red}) | [Unconscious](!token-mod %{DIV|ReportToggle}Unconscious" --set statusmarkers|!Unconscious #" %{DIV|Red})}} {DIV|Blue} (Make a similar one for green and red) style="background: none; background-color: transparent; border: none; padding: 0px; text-decoration: none; display: inline-block; color: blue; {DIV|ReportToggle} --report gm|"{name} ?{Add or Remove||Add,is|Remove,is no longer}  !noarchive is just a custom scriptlet that makes it so that the chat message isn't archived. 3. FYI You can organize your Status Markers if you split them into different Token Marker Sets.  They will be loaded by group (in reverse order that you load them into the game) into the Status Marker list.
Thank you so much for the suggestions, all. Lots for me to experiment with. Appreciate you taking the time. Will pop back if I have any questions.
Jarren K. said: Suggestions: 2. Take a look at the Stylening thread on the forum and look into using Stylus to adjust the display of the Token Marker popout in addition to macros. Here's what my Token Marker menu and Macro chat menu looks like: I like this a lot from an aesthetic perspective, but I don't think there's any way I'm going to get all my players using Stylus. 3. FYI You can organize your Status Markers if you split them into different Token Marker Sets.  They will be loaded by group (in reverse order that you load them into the game) into the Status Marker list. This was very helpful information, thank you. I now at least have them in the right order (condition and states -> buffs -> debuffs -> numbers). Just a question of getting the API / macro up and running.
keithcurtis said: It does require configuring CM with you condition list, choosing markers and inputting explanations... Here is what it looks like in play, assigning the blinded condition to a bear: This looks perfect for my purposes, and super helpful, thank you. Only thing is - how do I configure CM? I downloaded it via the API Script Library within Roll20, but do I need to grab it from GitHub instead, and go into the code? Or is that overengineering a simpler process?
1613692850

Edited 1613692881
So I'm making good progress here - I have your very helpful macro working as intended. My players send their thanks. But I have a potentially stupid question. Is there a way I can combine GroupCheck and Combat Master? I'd like to be able to automatically set CM conditions using a GC macro, if possible. Can that be done? Or would I have to duplicate the set of conditions in GC as well? keithcurtis said: Here is the macro which assigns conditions: !cmaster --add,condition=?{Set Condition| AFK,afk| Blinded,blinded| Burrowing,burrowing| Charmed,charmed| Concentrating,concentrating| Cover,cover| Deafened,deafened| Diseased,diseased| Dodging,dodging| Ethereal,ethereal| x1,exhaustion 1| x2,exhaustion 2| x3,exhaustion 3| x4,exhaustion 4| x5,exhaustion 5| x6,exhaustion 6| Flying,flying| Frightened,frightened| Grappled,grappled| HalfCover,cover half| Haste,haste| Cursed,hexblades curse| hex,hex| Hidden,hidden| Incapacitated,incapacitated| Inspiration,inspiration| Invisible,invisible| Light,xxxLight| Marked,marked| Mounted,mounted| Paralyzed,paralyzed| Petrified,petrified| Poisoned,poisoned| Prone,prone| Readied,readied| Restrained,restrained| Slow,slow| Stunned,stunned| ThreeQuarterCover,cover three quarter| Torch,torch| Unconscious,unconscious| Wild Shaped,wild shape},duration=10,direction=1
1613693345
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Not sure I understand the question. What is Groupcheck doing with conditions or token markers? Does it have that functionality?
1613694164

Edited 1613697183
I use a Group Saving Throw macro, as follows: !group-check --whisper {{ --?{Ability Save|Strength,Strength Save|Dexterity,Dexterity Save|Constitution,Constitution Save|Intelligence,Intelligence Save|Wisdom,Wisdom Save|Charisma,Charisma Save} --ro ?{Roll Type|Normal,roll1|Advantage,adv|Disadvantage,dis} --process --subheader vs DC ?{DC} --button ApplyDamage !apply-damage ~dmg [[?{Damage|0}]] ~type ?{Damage on Save|Half,half|None,none} ~DC ?{DC} ~saves RESULTS(,) ~ids IDS(,) ?{Status| None,~| Red,~status red| Blue,~status blue| Green,~status green| Orange,~status orange| Purple,~status purple| Pink,~status pink| Yellow,~status yellow| ―, | Concentrating,~status blue| Readying,~status stopwatch| ―, | Prone,~status back-pain| Restrained,~status fishing-net| Grappled,~status grab| ―, | Incapacitated,~status interdiction| Stunned,~status pummeled| Unconscious,~status sleepy| ―, | Charmed,~status charmed| Frightened,~status screaming| ―, | Poisoned,~status half-heart| Blinded,~status bleeding-eye| Deafened,~status lightning-helix| Paralyzed,~status padlock| Petrified,~status broken-skull| ―, | Dodging,~status bolt-shield| Cover (half),~status broken-shield:2| Cover (three-quarters),~status broken-shield:5| Cover (full),~status white-tower| Invisible,~status ninja-mask| ―, } }} This reads to me like they're pointing at the default token names. As a test, I've changed the Charmed line from its previous target (restrained heart or something similar) to match the token marker filename I use for Charmed, but it doesn't seem to work. It would be even better if I could somehow get GroupCheck to apply a condition via CombatMaster, so that I can have the extra functionality of querying the marker to see what it means, but I'd settle for GroupCheck just applying the relevant marker.