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 .
×
May your rolls be chill this holiday season!
Create a free account

Conditionals in Macros?

Are there any sort of conditionals in the Roll20 Macro language (Similar to many languages if/elif/else statements)? I'd specifically like to have an effect (A small amount of cold damage) hit all creatures with a certain 'marker' on them (Not sure what to call them, but they're the things you assign to tokens by clicking on them, then hitting the button next to edit.). Would there be any way to do this, or will I have to do it manually?
Howdy Zavier Y. Not as such, no. Roll20, to the best of my knowledge, has no user-accessible if/then functions whatsoever. The things you're talking about are called "token icons" by most, and 'status indicator overlays' by the Wiki: Without the API ( a mentor-level feature ), what you ask is simply not possible. Mostly. I have one idea for a possible work-around which I'll share later in this post. With the API, it may be possible to do what you ask. I'm not sure, as I'm not one of the API wizards around here. You might ask in the API forum ; it's possible The Aaron, Vince, Brian, or one of the other API Wizards could come up with something. Barring that, one possibility could be a macro which looks for an Attribute on the character sheet. For example, let's say you want a cold damage macro that only affects those who are vulnerable to cold damage... Set up a character sheet, with an Attribute called "Cold", and give it a value of 0 or 1. 0 means they are immune to cold damage, 1 means they are not. Then a macro could look like: The White Dragon breathes cold at you and does [[ ((@{target|cold}) * (3d6)) ]] points of cold damage. Square brackets to make it an inline roll (hiding the mechanics). @{target|cold} calls up the value stored as the attribute "Cold" in the journal entry linked to the token you choose when you use the macro. Then, multiplying the dieroll (3d6) by the attribute's value (0 or 1) you get a response of either 0 or the dieroll, depending. This would return an output like: The White Dragon breathes cold at you and does [14] points of cold damage. Granted, you'd have to manually choose each target, but it's something. -Phnord