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

MACRO SYNTAX ALTERATION

There is a feature of Roll20 that I have come to enjoy and which I need help in recreating.  This feature is related to condition statuses where if you apply a condition status to a player, not only will it affix an icon to represent said condition to the player token, it will also post an information card outlining the rules for that condition to the global chat. However, not being a fan of the default status icons, I opted to purchase a condition status icon pack from the market place and associate it with my game. After doing this, the information card would no longer post to the chat as previously mentioned.  I'll spare you the details but suffice it to say that after spending several hours trying to figure out what exactly was pushing that status information card to the chat, I determined that its part of the default Roll20 environment and is directly dependent on a player specifically using the "Default Token Marker" (DTM) pack for status identification. Even if you make copies of the DTM status icon and give it an identical name, it will not work as previously described. The only way to have this operate is to either use the Roll20 DTM or you can copy the original over to another marker library however in both of those cases you cannot rename or reassign the images of those markers as they are protected. The only way to rename them is to make an in-direct copy and upload it back to Roll20 but this automatically breaks the functions.  The best solution I can come up with to circumvent this problem, and still use my new status tokens, is to create my own status cards, upload them to Roll20 as images, alter the macro I am using, and post them via URL to the chat. I performed some rudimentary testing and this works surprisingly well. The issue is, I lack the coding prowess to figure out the syntax to weave this into the existing macro I am using and I am hoping that one of you has a similar macro I can build from or if you can look at the code below, and tell me how and where to enter an additional command for each status that will assign the status icon and post the information card image from the upload URL. !token-mod ?{Status|Concentrating, --set statusmarkers#!stopwatch|Readying, --set statusmarkers#!stopwatch|-, |Blinded, --set statusmarkers#!bleeding-eye --flip light_hassight|Charmed, --set statusmarkers#!broken-heart|Deafened, --set statusmarkers#!edge-crack|Frightened, --set statusmarkers#!screaming|Grappled, --set statusmarkers#!grab|Invisibility, --set statusmarkers#!ninja-mask|Incapacitated, --set statusmarkers#!interdiction|Paralyzed, --set statusmarkers#!pummeled|Petrified, --set statusmarkers#!frozen-orb|Poisoned, --set statusmarkers#!chemical-bolt|Prone, --set statusmarkers#!back-pain|Restrained, --set statusmarkers#!fishing-net|Stunned, --set statusmarkers#!fist|Unconscious, --set statusmarkers#!sleepy|-, |Blessed, --set statusmarkers#!angel-outfit|Raging, --set statusmarkers#!overdrive|Marked, --set statusmarkers#!archery-target|-, |Dead, --set statusmarkers#=dead|-, |Clear Conditions, --set statusmarkers#-Blinded#-broken-heart#-edge-crack#-screaming#-grab#-pummeled#-aura#-chemical-bolt#-back-pain#-fishing-net#-fist#-frozen-orb#-interdiction#-sleepy#-ninja-mask#-dead|Clear All, --set statusmarkers#-Blinded#-broken-heart#-edge-crack#-screaming#-grab#-pummeled#-aura#-chemical-bolt#-back-pain#-fishing-net#-fist#-frozen-orb#-interdiction#-sleepy#-ninja-mask#-angel-outfit#-overdrive#-blue#-stopwatch#-archery-target#-dead} The way this functions is as follows: Select player token Activate macro Select appropriate status Press enter RESULT:    Player is given the associated condition status icon to their token and an information card is automatically pushed to the global chat If the DM selects the same token and tries to assign the same status, the status is removed and no information card is pushed to the chat REQUEST: Help alter macro code to recreate the aforementioned functionality but where the information card is pushed to the chat in conjunction with or directly after a status has been selected or summited. If anyone knows an easier way to do what I am trying to do, I am open to suggestions.  (Sorry for the long post)
Are you using the Condefinition script? It sounds like that's the source of the 'information card' that you're describing. If not, which scripts are you using?  If you are using Condefinition, it can be customized to work with any custom status markers.
1712161507
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Aeroica! I'd recommend looking into the Condefinition or Combat Master (One Click) scripts.
1712164824

Edited 1712164848
Jarren  said: Are you using the Condefinition script? It sounds like that's the source of the 'information card' that you're describing. If not, which scripts are you using?  If you are using Condefinition, it can be customized to work with any custom status markers. Hey Jarren, I "was" using an old API called StatusInfo. I was told this hasnt been supported and is a bit of relic from when Roll20 didn't fully support status conditions. I just installed Condefinition but it wont load due to a syntax error. I copied and pasted directly from the link provided.
1712164917

Edited 1712165291
I GOT IT FIXED keithcurtis  said: Hi Aeroica! I'd recommend looking into the  Condefinition  or Combat Master (One Click) scripts. I installed the Condefinition API but it stopped my sandbox stating that there was a syntax error. I copied and pasted directly from the link you provided. Is there something else I need to do?
1712167009

Edited 1712167043
Aeroica  said: I GOT IT FIXED Excellent!  Just for your reference, I have a bunch of custom status markers that I use, s o I modified the 'conditionsArray' starting on Line 51 with this:     const conditionsArray = [ // RULES ONLY - NO MARKERS         [             "dodging",             /dodge action/,             "Until the start of your next turn, any Attack roll made against you has disadvantage if you can see the attacker, and you make Dexterity Saving Throws with advantage. You lose this benefit if you are Incapacitated or if your speed drops to 0.",             `blue`         ],         [             "hidden",             /hide action/,             "Combatants often try to Escape their foes’ notice by Hiding, casting the Invisibility spell, or lurking in darkne⁠ss.<BR>When you Attack a target that you can’t see, you have disadvantage on the at⁠tack roll. This is true whether you’re guessing the target’s Location or you’re targeting a creature you can hear but not see. If the target isn’t in the Location you targeted, you automatically miss, but the DM typically just says that the att⁠ack missed, not whether you guessed the target’s Location correctl<BR>When a creature can’t see you, you have advantage on Attack rolls against it. If you are hidden—both unseen and unheard—when you make an at⁠tack, you give away your Location when the att⁠ack hits or misses.",             `blue`         ],         [             "inspiration",             /gm inspiration/,             "If you have Inspiration, you can expend it when you make an Attack roll, saving throw, or ability check. Spending your Inspiration gives you advantage on that roll.<BR>Additionally, if you have Inspiration, you can reward another player for good Roleplaying, clever thinking, or simply doing something exciting in the game. When another player character does something that really contributes to the story in a fun and interesting way, you can give up your Inspiration to give that character Inspiration.",             `blue`         ],         [             "full-cover",             /full cover/,             "A target with total cover can’t be targeted directly by an Attack or a spell, although some Spells can reach such a target by including it in an area of Effect. A target has total cover if it is completely concealed by an obstacle.<BR><BR>Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.<BR>There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover.",             `blue`         ],         [             "three-quarter-cover",             /three-quarter cover/,             "A target with three-quarters cover has a +5 bonus to AC and Dexterity Saving Throws. A target has three-quarters cover if about three-quarters of it is covered by an obstacle. The obstacle might be a portcullis, an arrow slit, or a thick tree trunk.<BR><BR>Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.<BR>There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover.",             `blue`         ],         [             "half-cover",             /half-cover/,             "A target with half cover has a +2 bonus to AC and Dexterity Saving Throws. A target has half cover if an obstacle blocks at least half of its body. The obstacle might be a low wall, a large piece of furniture, a narrow tree trunk, or a creature, whether that creature is an enemy or a friend.<BR><BR>Walls, trees, Creatures, and other Obstacles can provide cover during Combat, making a target more difficult to harm. A target can benefit from cover only when an Attack or other Effect originates on the opposite side of the cover.<BR>There are three degrees of cover. If a target is behind multiple sources of cover, only the most protective degree of cover applies; the degrees aren’t added together. For example, if a target is behind a creature that gives half cover and a tree trunk that gives three-quarters cover, the target has three-quarters cover.",             `blue`         ],         [             "speed",             /using different speeds/,             "If you have more than one speed, such as your walking speed and a flying speed, you can switch back and forth between your speeds during your move. Whenever you switch, subtract the distance you’ve already moved from the new speed. The result determines how much farther you can move. If the result is 0 or less, you can’t use the new speed during the current move.<BR><BR>For example, if you have a speed of 30 and a flying speed of 60 because a wizard cast the fly spell on you, you could fly 20 feet, then walk 10 feet, and then leap into the air to fly 30 feet more.",             `blue`         ], // NEUTRAL MARKERS         [             "concentrating",             /concentration| up to /,             "Some spells require you to maintain concentration in order to keep their magic active. If you lose concentration, such a spell ends.<BR>Normal activity, such as moving and attacking, doesn’t interfere with concentration. The following factors can break concentration:<BR>• Casting another spell that requires concentration. You lose concentration on a spell if you cast another spell that requires concentration. You can’t concentrate on two spells at once.<BR>• Taking damage. Whenever you take damage while you are concentrating on a spell, you must make a Constitution saving throw to maintain your concentration. The DC equals 10 or half the damage you take, whichever number is higher. If you take damage from multiple sources, such as an arrow and a dragon’s breath, you make a separate saving throw for each source of damage.<BR>• Being incapacitated or killed. You lose concentration on a spell if you are incapacitated or if you die.<BR>• The DM might also decide that certain environmental phenomena, such as a wave crashing over you while you’re on a storm-tossed ship, require you to succeed on a DC 10 Constitution saving throw to maintain concentration on a spell.",           `Concentrating`         ],             [             "held-action",             /ready action|held action/,             "Sometimes you want to get the jump on a foe or wait for a particular circumstance before you act. To do so, you can take the Ready action on your turn, which lets you act using your reaction before the start of your next turn.<BR>First, you decide what perceivable circumstance will trigger your reaction. Then, you choose the action you will take in response to that trigger, or you choose to move up to your speed in response to it. Examples include 'If the cultist steps on the trapdoor, I’ll pull the lever that opens it,' and 'If the goblin steps next to me, I move away.'<BR>When the trigger occurs, you can either take your reaction right after the trigger finishes or ignore the trigger.<BR>When you ready a spell, you cast it as normal but hold its energy, which you release with your reaction when the trigger occurs. To be readied, a spell must have a casting time of 1 action, and holding onto the spell’s magic requires concentration (explained in chapter 10). If your concentration is broken, the spell dissipates without taking effect. For example, if you are concentrating on the web spell and ready magic missile, your web spell ends, and if you take damage before you release magic missile with your reaction, your concentration might be broken.",           `Held-Action`         ], // HELPFUL MARKERS          [             "aid",             /Your spell bolsters your allies with toughness and resolve.|aid spell/,             "Your spell bolsters your allies with toughness and resolve. Each target's hit point maximum and current hit points increase by 5 for the duration.",           `Aid`         ],         [             "aura",             /paladin aura/,             "An effect radiates out from you. Until the spell ends, the aura moves with you, centered on you.",           `Aura`         ],         [             "bless",             /you bless up to|bless spell/,             "Whenever a blessed target makes an attack roll or a saving throw before the spell ends, the target can roll a d4 and add the number rolled to the attack roll or saving throw.",           `Blessed`         ],         [             "invisible",             /(be|and|is|magically|become|becomes) invisible|invisible condition/,             "• 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.<BR>• Attack rolls against the creature have disadvantage, and the creature’s Attack rolls have advantage.",           `Invisible`         ], // HARMFUL MARKERS         [             "blinded",             /(are|be|and|is|magically|become|becomes) (blind|blinded)|blinded condition/,             "• A blinded creature can’t see and automatically fails any ability check that requires sight.<BR>• Attack rolls against the creature have advantage, and the creature’s attack rolls have disadvantage.",             `Blind`         ],         [             "charmed",             /(be|and|is|magically|become|becomes) charmed|charmed condition/,             "• A charmed creature can’t attack the charmer or target the charmer with harmful abilities or magical effects.<BR>• The charmer has advantage on any ability check to interact socially with the creature.",           `Charmed`         ],         [             "deafened",             /(be|and|is|magically|become|becomes) deafened|deafened condition/,             "• A deafened creature can’t hear and automatically fails any ability check that requires hearing.",           `Deafened`         ],         [             "exhaustion",             /(be|and|is|magically|become|becomes) exhausted|(of|magical) exhaustion|exhausted condition/,             "Some special ablities and environmental hazards, such as starvation and the long-term effects of freezing or scorching temperatures, can lead to a spcial condition called exhaustion. Exhaustion is measured in six levels. An Effect can give a creature one or more levels of exhaustion, as specified in the effect’s description.<BR><BR><table><thead><tr><th>Lvl </th><th>Effect</th></tr></thead><tbody><tr><td>1</td><td>Disadvantage on Ability Checks</td></tr><tr><td>2</td><td>Speed halved</td></tr><tr><td>3</td><td>Disadvantage on attack rolls and Saving Throws<br></td></tr><tr><td>4</td><td>Hit point maximum halved</td></tr><tr><td>5</td><td>Speed reduced to 0</td></tr><tr><td>6</td><td>Death</td></tr></tbody></table><BR>If an already exhausted creature suffers another effect that causes exhaustion, its current level of exhaustion increases by the amount specified in the effect’s description.<BR><BR>A creature suffers the effect of its current level of exhaustion as well as all lower levels. For example, a creature suffering level 2 exhaustion has its speed halved and has disadvantage on Ability Checks.<BR><BR>An Effect that removes exhaustion reduces its level as specified in the effect’s description, with all exhaustion Effects Ending if a creature’s exhaustion level is reduced below 1.<BR><BR>Finishing a Long Rest reduces a creature’s exhaustion level by 1, provided that the creature has also ingested some food and drink. Also, being raised from the dead reduces a creature's exhaustion level by 1.",           `Exhaustion`         ],         [             "frightened",             /(be|and|is|magically|become|becomes) frightened|frightened condition/,             "• A frightened creature has disadvantage on Ability Checks and attack rolls while the source of its fear is within Line of Sight.<BR>• The creature can’t willingly move closer to the source of its fear.",           `Frightened`         ],         [             "grappled",             /(be|and|is|magically|becomes|considered|to) grapple|grappled|grappled condition/,             "• A grappled creature’s speed becomes 0, and it can’t benefit from any bonus to its speed.<BR>• The condition ends if the grappler is <a style='background-color: transparent;padding: 0px;color: #702c91;display: inline-block;border: none;' href='!condef incapacitated'>incapacitated</a>.<BR>• The condition also ends if an effect removes the grappled creature from the reach of the Grappler or Grappling Effect, such as when a creature is hurled away by the thunderwave spell.",           `Grappled`         ],         [             "incapacitated",             /(be|and|is|magically|become|becomes) incapacitated|incapacitated condition/,             "• An incapacitated creature can’t take actions or reactions.",           `Incapacitated`         ],         [             "paralyzed",             /(be|and|is|magically|become|becomes) paralyzed|paralyzed condition/,             "• A paralyzed creature is <a style='background-color: transparent;padding: 0px;color: #702c91;display: inline-block;border: none;' href='!condef incapacitated'>incapacitated</a> and can’t move or speak.<BR>• The creature automatically fails Strength and Dexterity Saving Throws.<BR>• Attack rolls against the creature have advantage.<BR>• Any Attack that hits the creature is a critical hit if the attacker is within 5 feet of the creature.",           `Paralyzed`         ],         [             "petrified",             /(be|and|is|magically|become|becomes|becoming) petrified|(turns to|turning to) stone|petrified condition/,             "• 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.<BR>• The creature is <a style='background-color: transparent;padding: 0px;color: #702c91;display: inline-block;border: none;' href='!condef incapacitated'>incapacitated</a>, can’t move or speak, and is unaware of its surroundings.<BR>• Attack rolls against the creature have advantage.<BR>• The creature automatically fails Strength and Dexterity Saving Throws.<BR>The creature has Resistance to all damage.<BR>• The creature is immune to poison and disease, although a poison or disease already in its system is suspended, not neutralized.",           `Petrified`         ],         [             "poisoned",             /(be|and|is|magically|become|becomes) poisoned|poisoned condition/,             "• A poisoned creature has disadvantage on attack rolls and Ability Checks.",           `Poisoned`         ],         [             "prone",             /(be|and|is|magically|become|becomes|knocked|fall|falls) prone|prone condition/,             "• A prone creature’s only Movement option is to crawl, unless it stands up and thereby ends the condition.<BR>• The creature has disadvantage on attack rolls. <BR>• An attack roll against the creature has advantage if the attacker is within 5 feet of the creature. Otherwise, the attack roll has disadvantage.",           `Prone`         ],         [             "restrained",             /(be|and|is|magically|become|becomes) restrained|restrained condition/,             "• A restrained creature’s speed becomes 0, and it can’t benefit from any bonus to its speed.<BR>• Attack rolls against the creature have advantage, and the creature’s Attack rolls have disadvantage.<BR>• The creature has disadvantage on Dexterity Saving Throws.",           `Restrained`         ],         [             "stunned",             /(be|and|is|magically|become|becomes) stunned|stunned condition/,             "• A stunned creature is <a style='background-color: transparent;padding: 0px;color: #702c91;display: inline-block;border: none;' href='!condef incapacitated'>incapacitated</a>, can’t move, and can speak only falteringly.<BR>• The creature automatically fails Strength and Dexterity Saving Throws.<BR>• Attack rolls against the creature have advantage.",           `Stunned`         ],         [             "unconscious",             /(be|and|is|magically|become|becomes) unconscious|unconscious condition/,             "• An unconscious creature is <a style='background-color: transparent;padding: 0px;color: #702c91;display: inline-block;border: none;' href='!condef incapacitated'>incapacitated</a>, can’t move or speak, and is unaware of its surroundings<BR>• The creature drops whatever it’s holding and falls prone.<BR>• The creature automatically fails Strength and Dexterity Saving Throws.<BR>• Attack rolls against the creature have advantage.<BR>• Any Attack that hits the creature is a critical hit if the attacker is within 5 feet of the creature.",           `Unconscious`         ]     ]     // END SET STATUS CONDITIONS OR TOKEN MARKERS