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

Conditional Statements in Macros

June 12 (13 years ago)
Is there currently an option to add conditional statements to macros?

e.g.
if(/r 1d20 > 9)
Save!
June 12 (13 years ago)
Conditionals would be cool.

I'd love for the macro capabilities to be powerful with variables and conditionals and the ability to play a sound--like a mini programming language. It would really allow a great amount of capability in the program for those that want to use the extra capabilities, but would still be simple for those who don't need the extra capabilities. I'd love to see the macro capabilities expanded out.

Can you imagine:

if(/r 1d20>9){
play "SwordClankFX.mp3"}
else {
play "SwordWiffFX.mp3"}
}
June 13 (13 years ago)
Axel Castilla
KS Backer
Agreed. Conditionals is what is needed for getting results like the ones asked in this thread: http://community.roll20.net/discussion/826/alternative-macro-for-rolling-against-target-number#Item_1

A dice roll could, then, display results & messages such as "Success by X" or "Failure by X" --X is the margin of success or failure regarding the specified Target Number, as in this screenshot of another VTT: