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 .
×

2 Conditional Statements in an Ability

Hello everyone. I am having a problem with conditional statements in Roll20. I am running a Star Wars FFG game. If you are unfamiliar with the system, when forming your dice pool you compare your two corresponding stats. The greater of the two equals the number of dice in the pool and the lesser of the two equals to the number of dice upgraded. I have created two dice tables: [gi] for normal dice and [yi] for upgraded. I am writing an ability that rolls a Presence / Cool pool. It is made up of four parts: If Pres > Cool, roll (Pres - Cool) normal dice Else, roll (Cool - Pres) normal dice + If Pres > Cool, roll (Cool) upgraded dice Else, roll (Pres) upgraded dice Within Roll20, the Ability reads like this: /roll {{@{Pres}, 0}>@{Cool}} * (@{Pres}-@{Cool})t[gi] + (@{Cool}-@{Pres})t[gi] + {{@{Pres}, 0}>@{Cool}} * @{Cool}t[yi] + @{Pres}t[yi] When this is rolled, the first two parts of the equation works. But when it gets to the third and fourth steps, it rolls dice as if the second if statement is true and false. I thought the problem might be that I could not have two conditional statements in one ability, but it works when I copy and paste the first two parts over the second two. I would appreciate any help. Please let me know if I can clarify any points. Thank you.
1482496550

Edited 1482496692
Tetsuo
Forum Champion
So, if I'm understanding the mechanic, you don't need an if/then statement. You could simply do: [[ [[ [[{@{Pres}, @{Cool}}kh1]] - [[{@{Pres}, @{Cool}}kl1]] ]]t[gi] + [[{@{Pres}, @{Cool}}kl1]]t[yi] ]] This will subtract the lower from the higher and roll the result on the gi table, then roll the lower of the two on the gi table, then combine the results.
1482504702
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
could also use absolute value: [[ [[ abs(@{Cool}-@{Pres}) ]]t[gi] + [[{@{Pres}, @{Cool}}kl1]]t[yi] ]]
1482526871
Tetsuo
Forum Champion
For some reason, I was unaware of the abs command. I thought only floor and ceil existed. 
Franky H. said: For some reason, I was unaware of the abs command. I thought only floor and ceil existed.  I can't blame you; it has only one line of documentation on the Dice Reference Wiki page.
Thank you to everyone who replied. The absolute value solution works great. I greatly appreciate the help.
What if Presence and Cool are equal? Wouldn't that give you no normal dice? This may be a stupid question since I am unfamiliar with FFG Star Wars rules...
1482553787
Lithl
Pro
Sheet Author
API Scripter
Rabulias said: What if Presence and Cool are equal? Wouldn't that give you no normal dice? This may be a stupid question since I am unfamiliar with FFG Star Wars rules... I haven't played the system, but I believe this is an opposed check, so it's your  Presence and your opponent's  Cool.
1482623227

Edited 1482623588
Rabulias said: What if Presence and Cool are equal? Wouldn't that give you no normal dice? This may be a stupid question since I am unfamiliar with FFG Star Wars rules... You are correct, you would only be rolling upgraded dice, called Proficiency Dice in Star Wars FFG. The system can be overwhelming at first but it is very easy to get the hang of. I'm a fan of the narrative dice system and recommend anyone give it a try. This webcomic wrote a series of strips that goes over the system, it's a good place to start if it sounds interesting to you:&nbsp; <a href="http://www.uptofourplayers.com/comic/edge-empire-rulez-pt-1/" rel="nofollow">http://www.uptofourplayers.com/comic/edge-empire-rulez-pt-1/</a>