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

rolls showing a certain result

what im wanting to do is roll 1d20+something and have the result show certain effects that can happen depending on the roll. example dc 15 you push target back dc 20 you push a target back and make an attack etc. so if i rolled a 1d20+2 and got 15+ it shows only the dc 15 effect if i rolled 1d20+2 and got the 20+ effect it shows the effects of dc 20 or dc 15 and 20 (either would work) does a marco like this exist 
1469508656
Lithl
Pro
Sheet Author
API Scripter
You want  Rollable Tables . Unfortunately, they don't really have support for modifiers on the roll, so you would be forced to use the API (a Pro feature) or create a new table for every possible modifier you want to use.
Another strategy (also using Rollable Tables) exists, and is outlined here and here . Essentially, Create a Rollable Table with one Table Item corresponding to each 'certain effect'. Each of these Rollable Tables should have the same name but varies only by a corresponding number. e.g. "Effect-0", "Effect-1", "Effect-2", etc. Devise a mathematical function that inputs [[1d20+?{Mod}]] and outputs the number corresponding to the appropriate Rollable Table. Nest this function within the roll expression for that table. e.g. /r 1t[Effect-[[ {{floor((1d20 + ?{Mod|2} - 10) / 5), 0d0}kh1, 2 + 0d0}kl1 ]]]] (The above contains an extra closing bracket, which is required for this to work.)
1469535532

Edited 1469535583
The Aaron
Pro
API Scripter
One slightly different approach is to create 1 table for each possible roll and use a formula like this: [[ 1t[Effect [[1d20+@{modifier}]] ] ]] So, you might have tables named: Effect15, Effect16, Effect17, Effect18, Effect19 Each would have a single entry with a value of: You push target back That would give you the scaling you want with a little less work. (As usual, Silvyre says it better!)
I messed with this a little bit and it seems to work.  I used this formula to round the roll to one of five effects.  This way you only need to have 5 tables to cover DC0, DC5, DC10, DC15, DC20.  You would label your tables as Effect0 thru Effect4.  No need to make a table for each possible dice roll. /r 1t[Effect[[floor((1d20+2)/5)]]]] It can further be automated to use a variable for the modifier instead of a fixed number (1d20+@{selected|modifier}) or use the query ?{modifer|1} /r 1t[Effect[[floor((1d20+?{modifier|1})/5)]]]]