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 .
×
This post has been closed. You can still view previous posts, but you can't post any new replies.

If/Then, Else, Switch

Just putting down a thread to voice support for the implementation of these. The chat log is easily cluttered. These statements would go a long way towards giving macros a way to simplify things. Rather than showing all the rolls and numbers to get to that point, one could just output "Critical hit! 57 damage!"
1375734206
Gauss
Forum Champion
Have you tried inline rolling? It will do the output like you want although there wont be an If/then, else, switch element.&nbsp; <a href="https://wiki.roll20.net/Dice_Reference#Inline_Dice_Rolls" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Inline_Dice_Rolls</a> - Gauss
Yeah and it's a mess. rolling 1d20&gt;17 (18) = 1 Successes Just look at all that wasted space. But the crit thing is just and example. I want to do something a bit more complex, where each side of the die outputs a different message. (basically a random encounter generator)
1375734939
Gauss
Forum Champion
MicManGuy, what you just quoted is not inline dice rolling. Inline rolling is a single number. Here is an image of regular vs inline dice rolling:&nbsp; You can also type words around the inline.&nbsp; Example: Input: George attacks and gets [[1d20&gt;17]] successes! Output: George attacks and gets 0 successes! Regarding a different output message depending on what side of the die is rolled you can use Rollable tables for that.&nbsp; <a href="https://wiki.roll20.net/Card_Decks_and_Rollable_Tables#Rollable_Tables" rel="nofollow">https://wiki.roll20.net/Card_Decks_and_Rollable_Tables#Rollable_Tables</a> - Gauss
1375741640
Alex L.
Pro
Sheet Author
Gauss said: MicManGuy, what you just quoted is not inline dice rolling. Inline rolling is a single number. Here is an image of regular vs inline dice rolling:&nbsp; You can also type words around the inline.&nbsp; Example: Input: George attacks and gets [[1d20&gt;17]] successes! Output: George attacks and gets 0 successes! Regarding a different output message depending on what side of the die is rolled you can use Rollable tables for that.&nbsp; <a href="https://wiki.roll20.net/Card_Decks_and_Rollable_Tables#Rollable_Tables" rel="nofollow">https://wiki.roll20.net/Card_Decks_and_Rollable_Tables#Rollable_Tables</a> - Gauss If you want anything more complex then you need to be a mentor and use the API.
1375821969

Edited 1375822022
Alex L. said: If you want anything more complex then you need to be a mentor and use the API. Yeah, I just recently discovered that that was actually a thing. I don't suppose that there's a master list of every command available? That would actually be very helpful. I had to keep sifting through patch notes in order to find many of the features. I think rollable tables might be good enough for what I want to do (which isn't any of the examples I've made, I just don't feel like posting a wall of text). But making a table to accomplish each and every if/then statement i want to make is needlessly complex. So, like I said. Just voicing support for the inclusion of If/then statements.
1375853095
Alex L.
Pro
Sheet Author
MicManGuy said: Alex L. said: If you want anything more complex then you need to be a mentor and use the API. Yeah, I just recently discovered that that was actually a thing. I don't suppose that there's a master list of every command available? That would actually be very helpful. I had to keep sifting through patch notes in order to find many of the features. I think rollable tables might be good enough for what I want to do (which isn't any of the examples I've made, I just don't feel like posting a wall of text). But making a table to accomplish each and every if/then statement i want to make is needlessly complex. So, like I said. Just voicing support for the inclusion of If/then statements. Riley has already stated its not going to happen on more than one occasion so I wouldn't get your hopes up. And the same as everything its all on the wiki.
+1 to this, I know it's probably not going to happen, but one can dream...
+1 to this, because it would be neat, but honestly it's not a must have. (just very cool)
1379802151

Edited 1379802258
it would be nice to to something like roll 1d20 if 20 then 30 +1d6 damage else 3d10 or roll 1d20 swich 1: crit FAIL 2-19: 3d10 20: 30 +1d6
1379811599

Edited 1379813286
Lithl
Pro
Sheet Author
API Scripter
afmart said: it would be nice to to something like roll 1d20 if 20 then 30 +1d6 damage else 3d10 or roll 1d20 swich 1: crit FAIL 2-19: 3d10 20: 30 +1d6 This could be done with a rollable table: Name Weight Critical Failure 500 3 9 4 27 5 54 6 90 7 135 8 189 9 252 10 324 11 405 12 495 13 567 14 621 15 657 16 675 17 675 18 657 19 621 20 567 21 495 22 405 23 324 24 252 25 189 26 135 27 90 28 54 29 27 30 9 31 83 32 83 33 83 34 83 35 83 36 83 That doesn't give you the specific die rolls (you'd need a table with 1007 items for that), but if you only care about the roll totals, a 35-element table is pretty reasonable, I think. (Those weights are not perfect due to rounding, but they're within 0.02% of the correct values of actual dice rolls for the specified setup.)