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

Using roll value as table index

Hi all,

Currently playing Warhammer, I was wondering how I could write a macro to return "success" or "failure" depending on the value of the D100 I would have rolled.

My last try was to define a new table called "status" with two elements ( "success" and "failure" ) and by using [[{{1d100>50}}]] I would return either 0 or 1. That would be the index in the table and then output "success" if below 50 and "failure" if above or equal to 50. I do not figured out how to do it properly. Is there a way to do it ?

I have also checked how to use an IF THEN ELSE statement but according to the documentation I have found, it does not exists.

Thanks !

March 25 (5 years ago)
The Aaron
Roll20 Production Team
API Scripter

There isn't a way to do branching (if/then/else etc) in a Macro or Dice roll.  Depending on the odds you need, you can create a Rollable Table with the weight set correctly and the values of Success and Failure.

Thanks for your answer but doing this would need the GM to create one table per charac for each player. I would prefer to do it on my side.

I will make it simplier then, if someone needs it, here is what I made :

?{roll|roll} [[1d100]] / ?{threshold|???}

that would open a popup to ask what kind of roll you make then a second to define the threshold and output something like :

roll 26 / 37

To define quick macros, I wrote something like that

Init : [[1d100]] / 49

Not exactly what I wanted but it will do the job anyway.

XOX

March 26 (5 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter

If you only need two options, one for success and one for failure, check out this little hack.