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

If/Then/Else

First off, sorry if this has been asked before. I tried searching though, but nothing came up. I'm trying to create a macro that seems like it will require an if/then/else kind of statement to work out. Rolling a d10, I need to be able to determine what the option is based on each individual roll. Is there a way to do this? Cheers.
1478046418
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
There are no logic operators in the  roll20 dice reference which has everything you can do in the chat interface involving dice, numbers, and manipulation of results.  Silvyre came up with a frankenstein If/Else syntax , although I don't personally understand it a bit. Hope that helps, and happy rolling, Scott
Scott C. said: There are no logic operators in the  roll20 dice reference which has everything you can do in the chat interface involving dice, numbers, and manipulation of results.  Silvyre came up with a frankenstein If/Else syntax , although I don't personally understand it a bit. Hope that helps, and happy rolling, Scott Yeah, I saw that. I couldn't interpret it either, but I'll keep plugging away. Cheers.
1478047844
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Could you post up what you're hoping to accomplish using if/then/else. There may be a way to do it that doesn't involve Silvyre's math voodoo (or maybe he'll drop by to explain it) ;).
Going to be playing a 4e game as a wild magic sorcerer. Just looking for a way to manage the daily resistance type. (Roll 1d10. Each value has its own type.) Totally frivolous, but I wanted to see if it could be done.
1478049265
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Oh, that's actually pretty easy. Ask your DM to make a  rollable table that has each type as an entry. Weight them appropriately, and make it accessible to players. When you would roll your d10 for the resistance, roll on the table instead.
1478049310

Edited 1478049409
Scott C. said:   Silvyre came up with a frankenstein If/Else syntax , although I don't personally understand it a bit. I did not write this section of the Wiki (I think Steve K. did). I did add (Math Only) to the header in an attempt to guard against misuse.
1478049400
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Oh, I could of sworn that was from one of your forum posts about conditionals. My bad.
M W. said: Rolling a d10, I need to be able to determine what the option is based on each individual roll. Is there a way to do this? You might be able to do what you'd like using Rollable Tables .