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 .
×
May your rolls be merry + bright! 🎄
Create a free account

Question marco: set a range or conditionals

i wanna know if possible to set a macro similar to conditional, for example if a roll d100 and the result is 20 do the action A or if 40 do te action B. Or if someone tried it. thanks for the attention.
Not possible without an API script, which requires that the GM/Creator have a Pro subscription.
1490772449
Andrew C
Marketplace Creator
You could do it with a Rollable Table, just by weighting the table items.
1490772618

Edited 1490772632
Tetsuo
Forum Champion
Rollable tables would work, as andrew mentioned. Though if you're Action A/B is purely a numerical output, there's a math work around to do it. Could you describe exactly what you're trying to do?
I try to create a rewards table and simplicate the information about the loot. that is the macro code: /w gm &{template:DnD35StdRoll} {{npcflag=true}} {{subtags= Dinero encontrado %[[d100]]}} {{Copper 15 - 29= [[1d6 *1000]]}} {{Silver 30 - 52= [[1d8 *100]]}} {{Gold 53 - 95= [[2d8 *100]]}} {{Platinum 96 - 100= [[2d4 * 10]]}} /w gm &{template:DnD35StdRoll} {{npcflag=true}} {{subtags= Bienes encontrados %[[d100]] }} {{Gema 91 - 95= Gemas encontradas 1}} {{Arte encontrado 96 - 100= Arte encontrado 1}} when i will roll the dice d100 pick any option in the range and return that valor thats i want, that's i want. I tried with rollable table but i failed; i don't know if i can use [[d100]]<0>25 or any similar case. thanks for the quicking responses
That's not really possible without an API script. 
1490790666
Andrew C
Marketplace Creator
Sky> Can do you know if you could load Macro Code in as the name of items on a rollable table?
1490792235
Tetsuo
Forum Champion
Unfortunately, Rollable tables can't handle dice rolls without the assistance of the API.
1490805045
Lithl
Pro
Sheet Author
API Scripter
You could in theory have table items weighted based on both the initial d% and the relevant dice roll(s) for the results. That's a bit of a pain, though, especially considering table weights have to be whole numbers.
Brian said: You could in theory have table items weighted based on both the initial d% and the relevant dice roll(s) for the results. That's a bit of a pain, though, especially considering table weights have to be whole numbers. if don't bothering you, can you explain me?
1490863219
Andrew C
Marketplace Creator
Say you roll on table one... and it has options 1-6. And for each result, there is another table... say 1A-1D, 2A-2D,...,6A-6D. so there are now 24 options. For sanity... we will say that 1s are twice as likely to come up, and As are twice as likely to come up. so... you make one big rollable table. You weight 1A by 4, 1B by 2, ... , 1D by 2, 2A by 2, 2B by 1, ... , 3A by 2, 3B by 1, ... , 6A by 2, 6B by 1, ... , 6D by 1. then when you roll off the table the various chances of each thing come out right. It gets messier the more involved the table becomes, and API only if you include the old "100 = roll twice on this table ignoring further 100s" line.
1490899318
Lithl
Pro
Sheet Author
API Scripter
Andrew (Halfling Gypsy) said: API only if you include the old "100 = roll twice on this table ignoring further 100s" line. Actually, if the table's logic has a finite number of rerolls, you can still  get the weights down in a single bog-standard rolltable table. (Although as you mention, this makes the weighting much more complicated, as this makes the table much more involved.) It's when there's an unbounded number of rerolls that the API is absolutely required to accurately produce the results with the same rates.