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

Checking a single roll versus multiple conditions.

Is it possible to use conditionals like && or || just like you would in programming to check for dice rolls? An example would be, /roll 1d100<@{selected|Martial-Arts}&&@{selected|Kick} The above obviously does not work, however I was wondering if there is any method to make this work. What I want it to do is check a single 1d100 against both Martial Arts and Kick (Call of Cthulhu) and show me stuff like "1 success" or "2 successes". The method I use right now is roll a single 1d100 and just show the current values of Martial Arts and Kick so you can just manually check it yourself, however on long sessions your senses start to get dull and you may misread a roll. On another note, is it possible to check for crits and fumbles? In call of cthulhu usually getting a 1~5 on a 1d100 makes it a critical success and 95~100 on a 1d100 makes it a fumble or critical failure. Is there a way to make it so when the result is on those ranges it shows a different message to notify if it's a crit or a fumble?
1419511882
Pat S.
Forum Champion
Sheet Author
The standard dice roller is not built to handle what you ask for as is. You will have to use the API to make multiple comparisions in a single roll. At this time the crits and fumbles do not work with ranges of numbers. It only highlights the max and min of the die rolled. Again this would require the API to work.
1419628827

Edited 1419629025
Lithl
Pro
Sheet Author
API Scripter
Instead of /roll d100<Martial Arts && Kick, you could use: /roll d100<[[{@selected|Martial-Arts}, @{selected|Kick}}kl1]] This creates an inline roll which results in the lower of Martial Arts or Kick, and uses that has the number to compare. An inline roll is used here because the RHS of the inequality only works with a single number, not expressions. Instead of /roll d100<Martial Arts || Kick, you could use: /roll d100<[[{@{selected|Martial-Arts}, @{selected|Kick}}kh1]] This is the same as above, except it uses the higher of Martial Arts or Kick rather than taking the lower value. Basically, d100<Martial Arts && Kick becomes d100<min(Martial Arts, Kick) and Martial Arts || Kick becomes d100<max(Martial Arts, Kick). Since the && version will only be true if the roll is below both values, it must necessarily be lower than the smaller of the two values. Since the || version will be true if the roll is below either value, it must necessarily be lower than the larger of the two values.
I see, thanks for the help guys.