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

Getting one roll to specify different actions

September 04 (8 years ago)
Hello,

I am trying to get a roll that if the result is = <1 it displays one thing, if it is 2 or 3 displays another, and if it is 4+ it displays yet another. I can generate the roll easily, it is getting the numerical result to display something that is other than just the number I can't figure out.

Here is the temporary macro I have, but I want to learn more and make better macros for my group.

/me Uses Soul Drain (free action) to get the ISP he needs. Rolling a [[1d@{spirit}!-?{Power Points|0}]]. Spirit total of 1 or less suffers a wound and unconscious for [[1d6]] hours. 2 or 3 suffers a wound. 4 or better equals [[?{Power Points|0}]] Gained Power Points

How do I get the 'Spirit total of 1 or...." part to just display 

"/me Uses Soul Drain to get the ISP he needs."

with the result being listed after that statement becoming

"and fails miserably, taking a wound and falling unconscious for the next [[1d6]] hours!"
or
"failing to acquire the ISP he needs and takes a wound!"
or
"and gains [[?{Power Points|0}]] Power Points!"
September 04 (8 years ago)
Hi, Greyye.

For an application like this, the typical solution usually lies with [the conventional usage] of Rollable Tables. However, Rollable Tables don't really work well with variables (i.e. Roll Queries)—the aforementioned solution would require a number of Rollable Tables about equal to maximum power points that can be spent (which might mean a lot of Tables!) If ?{Power Points} won't go too high, this solution might be your best option.

An alternative (advanced) solution lies with what I call "budget conditional statements", which I outline a bit in this thread.
September 04 (8 years ago)
Thank you Silvyre, I will discuss it with my GM since I do not have a paid account and do not have access to the "add" button in that window for making tables.

The non-macro math for what I am looking to do is [[1d10-variable = ?; if ? =<1 (response one); if ?= 2 or 3 (response two); if ?= 4+ (response three which is equal to variable)]]

I know that Roll20 is not wanting if\then commands in the coding, but they would be so handy!
September 04 (8 years ago)
Yes, only GMs can create and edit Rollable Tables. You could create your own game to test out Rollable Tables.

Conditional statements are almost exclusively the domain of API Scripts. (Access to the API is available in games in which the Creator has an active Pro subscription.)