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

Token status Marker Macro with TokenMod help

Until recently I had a drop down macro for players that allowed them to select their condition and add it to their token which was working fine. It now seems to try to pickup the selections from within the coding for the None condition, which is there is remove any condition marker with 1 option instead of having to remove each one individually. ?{Condition| None,  !token-mod {{ --set  statusmarkers|-6Blinded|-8Charmed|-9Deafened|-10Exhausted|-11Feared|-2Grappled|-13Incapacitated|-32Invisible|-15Paralyzed|-16Petrified|-17Poisoned|-3Prone|-4Restrained|-19Stunned|-5Unconscious}} All conditions have ended. | Blinded,  !token-mod {{ --set statusmarkers|!6Blinded }} Blinded | Charmed, !token-mod {{ --set statusmarkers|!8Charmed }} Charmed | Deafened, !token-mod {{ --set statusmarkers|!9Deafened }} Deafened | Exhausted, !token-mod {{ --set statusmarkers|!10Exhausted }} Exhausted | Frightened, !token-mod {{ --set statusmarkers|!11Feared }} Frightened | Grappled, !token-mod {{ --set statusmarkers|!2Grappled }} Grappled | Incapacitated,  !token-mod {{ --set statusmarkers|!13Incapacitated }} Incapacitated | Invisible, !token-mod {{ --set statusmarkers|!32Invisible }} Invisible | Paralyzed, !token-mod {{ --set statusmarkers|!15Paralyzed }} Paralyzed | Petrified, !token-mod {{ --set statusmarkers|!16Petrified }} Petrified | Poisoned, !token-mod {{ --set statusmarkers|!17Poisoned }} Poisoned | Prone, !token-mod {{ --set statusmarkers|!3Prone }} Prone | Restrained, !token-mod {{ --set statusmarkers|!4Restrained }} Restrained | Stunned, !token-mod {{ --set statusmarkers|!19Stunned }} Stunned | Unconscious, !token-mod {{ --set statusmarkers|!5Unconscious }} Unconscious } It then posts into chat as:   (Poisoned was selected in this case) Whick K. (GM): -17Poisoned} All conditions have ended. | Blinded, Blinded | Whick K. (GM): Charmed, Charmed | Deafened, Deafened | Whick K. (GM): Exhausted, Exhausted | Frightened, Frightened | Whick K. (GM): Grappled, Grappled | Incapacitated, Incapacitated | Whick K. (GM): Invisible, Invisible | Paralyzed, Paralyzed | Whick K. (GM): Petrified, Petrified | Poisoned, Poisoned | Whick K. (GM): Prone, Prone | Restrained, Restrained | Whick K. (GM): Stunned, Stunned | Unconscious, Unconscious } I have looked through the tokenmod help and in forums but can't seem to find anything that helps. Thanks in advance.
1689396172
timmaugh
Pro
API Scripter
You are dealing with query control characters (commas, vertical pipes, and right braces) being present in your Token Mod command WITHIN your query. When the query is parsed, the parser sees those characters and thinks you mean to control the query (moving from label to value for a comma, to the next item in the list for a pipe, or ending the query for a right brace). Once the query is ended, the rest of your command is just text, so whatever is on a new line gets sent to the chat prior panel. Replace these characters with their HTML equivalents: , = , | = | } = &brace; You don't have to replace control characters that are a part of sheet or token calls (ie, @{selected|hp}) since according to the Roll20 order of operations, those are processed before the query. You only will need to replace the characters that are a part of the TokenMod commands.
1689403638
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Also, the Token Mod curly braces are not needed. They are generally only used to break a command into multiline display. Further, Token Mod can also natively accept commands given with a hashtag rather than a pipe, specifically to counter nested query issues. So this: !token-mod {{ --set statusmarkers|!5Unconscious }} can be replaced with this: !token-mod --set statusmarkers#!5Unconscious
Thanks guys.  removing the curly brackets and using the # seems to have worked. I also added the conditions descriptions and bolded the condition name. ?{Condition| None, !token-mod --set statusmarkers#-6Blinded#-8Charmed#-9Deafened#-10Exhausted#-11Feared#-2Grappled#-13Incapacitated#-32Invisible#-15Paralyzed#-16Petrified#-17Poisoned#-3Prone#-4Restrained#-19Stunned#-5Unconscious **All conditions have ended.** | Blinded, !token-mod --set statusmarkers#!6Blinded **Blinded** • A blinded creature can’t see and automatically fails any ability check that requires sight. • Attack rolls against the creature have advantage and the creature’s attack rolls have disadvantage. | Charmed, !token-mod --set statusmarkers#!8Charmed **Charmed** • A charmed creature can’t attack the charmer or target the charmer with harmful abilities or magical effects. • The charmer has advantage on any ability check to interact socially with the creature. | Deafened, !token-mod --set statusmarkers#!9Deafened **Deafened** • A deafened creature can’t hear and automatically fails any ability check that requires hearing. | Exhausted, !token-mod --set statusmarkers#!10Exhausted **Exhausted** | Frightened, !token-mod --set statusmarkers#!11Feared **Frightened** • A frightened creature has disadvantage on ability checks and attack rolls while the source of its fear is within line of sight. • The creature can’t willingly move closer to the source of its fear. | Grappled, !token-mod --set statusmarkers#!2Grappled **Grappled** • A grappled creature’s speed becomes 0 and it can’t benefit from any bonus to its speed. • The condition ends if the grappler is incapacitated (see the condition). • The condition also ends if an effect removes the grappled creature from the reach of the grappler or grappling effect | Incapacitated, !token-mod --set statusmarkers#!13Incapacitated **Incapacitated** • An incapacitated creature can’t take actions or reactions. | Invisible, !token-mod --set statusmarkers#!32Invisible **Invisible** • An invisible creature is impossible to see without the aid of magic or a special sense. For the purpose of hiding the creature is heavily obscured. The creature’s location can be detected by any noise it makes or any tracks it leaves. • Attack rolls against the creature have disadvantage and the creature’s attack rolls have advantage. | Paralyzed, !token-mod --set statusmarkers#!15Paralyzed **Paralyzed** • A paralyzed creature is incapacitated (see the condition) and can’t move or speak. • The creature automatically fails Strength and Dexterity saving throws. • Attack rolls against the creature have advantage. • Any attack that hits the creature is a critical hit if the attacker is within 5 feet of the creature. | Petrified, !token-mod --set statusmarkers#!16Petrified **Petrified** • A petrified creature is transformed - along with any nonmagical object it is wearing or carrying - into a solid inanimate substance (usually stone). Its weight increases by a factor of ten and it ceases aging. • The creature is incapacitated (see the condition) can’t move or speak - and is unaware of its surroundings. • Attack rolls against the creature have advantage. • The creature automatically fails Strength and Dexterity saving throws. • The creature has resistance to all damage. • The creature is immune to poison and disease - although a poison or disease already in its system is suspended—not neutralized. | Poisoned, !token-mod --set statusmarkers#!17Poisoned **Poisoned** • A poisoned creature has disadvantage on attack rolls and ability checks. | Prone, !token-mod --set statusmarkers#!3Prone **Prone** • A prone creature’s only movement option is to crawl (see Movement) unless it stands up and thereby ends the condition. • The creature has disadvantage on attack rolls. • An attack roll against the creature has advantage if the attacker is within 5 feet of the creature. Otherwise the attack roll has disadvantage. • Standing from prone costs half movement. | Restrained, !token-mod --set statusmarkers#!4Restrained **Restrained** • A restrained creature’s speed becomes 0 and it can’t benefit from any bonus to its speed. • Attack rolls against the creature have advantage and the creature’s attack rolls have disadvantage. The creature has disadvantage on Dexterity saving throws. | Stunned, !token-mod --set statusmarkers#!19Stunned **Stunned** A stunned creature is incapacitated (see the condition) can’t move - and can speak only falteringly. • The creature automatically fails Strength and Dexterity saving throws. • Attack rolls against the creature have advantage. | Unconscious, !token-mod --set statusmarkers#!5Unconscious **Unconscious** • An unconscious creature is incapacitated (see the condition) can’t move or speak - and is unaware of its surroundings. • The creature drops whatever it’s holding and falls prone. • The creature automatically fails Strength and Dexterity saving throws. • Attack rolls against the creature have advantage. • Any attack that hits the creature is a critical hit if the attacker is within 5 feet of the creature. } Anyone else that wants to use it feel free, now that it works thanks to the champions above. As a note the status markers are from the D&D Token Markers set not the Default Token Markers, but you can replace the token marker to any you wish to in the code. Thanks again.
1689443322
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Since you are a Pro user, you might be interested in looking at the Condefinitions script .