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

Simple roll under Attribute+Skill command?

Hi there!

I'm a complete noob, and this is almost embarrassing to ask, but.

/roll 1d20<@{Selected|Dex}+@{Selected|Coordination} Why doesn't this work?

I'm sure there are even better commands to do what I want to do.

I want to combine "Attribute" and "Skill" into a value that a d20 needs to roll under to succeed.

Thank you!

October 18 (6 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator

You need to combine them. Think of it like the order of operations for multiplication and addition, 3*2+4 doesn't do 3*6, it does 3*2=6 and then adds the 4. In this case you need to use an inline roll to combine the two values that will make up your target number:

/roll 1d20<[[@{Selected|Dex}+@{Selected|Coordination}]]

Thank you!

Why are there two brackets like this?

[[Brackets]]
October 18 (6 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator

These are inline roll brackets. They're the same as doing /r ..., but you can also nest them in a /r command or within other inline rolls (up to a point). So this is telling the roll engine to calculate the value within those brackets first, then check the roll against the number. Unfortunately the engine can't handle parentheses in this case where you are using the success/failure syntax (it expects a number immmediately after the comparison sign).

/me Rolls Coordination against TN [[@{Selected|Dex}+@{Selected|Coordination}]]
/roll 1d20<[[@{Selected|Dex}+@{Selected|Coordination}]]


So... now, where do I go from here if I want the results to announce Failure / Success after the fact?

October 18 (6 years ago)

Edited October 18 (6 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator

The 0 shows failure, and the 1 shows success (although the /r syntax also shows "success" or "failure"), it should just be working. What output are you getting?

Oh, it's working.


FireVisor (GM): 16

rolling 1d20<16
(
8
)
=
1 Success

But it says 0 Successes...

And I'm just thinking it would be neat if it showed Failure instead... et.c
October 18 (6 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator

Oh, that's right, it counts the success. Sorry, I'd forgotten that as i don't use success/failure much. Unfortunately any customization would require either a custom roll template or an API script. Both require a pro sub to do yourself (and use in the script's case). The roll template is part of a character sheet, and if your system already has a character sheet on Roll20, it might already handle this.

October 18 (6 years ago)

Edited October 18 (6 years ago)

There IS a way to get it to display Success or Failure, but it's a little silly, and it'll hide the actual rolls.

Create a Rollable Table named 0. Create a single item in the table named Failure. Now create a Rollable Table named 1. Create a single item in the table named Success.

Now make your macro look like this:

/me Rolls Coordination against TN [[@{Selected|Dex}+@{Selected|Coordination}]]
/roll 1t[[[ 1d20<[[@{Selected|Dex}+@{Selected|Coordination}]] ]]]

You won't be able to see what the roll actually was, just whether it was successful or a failure.

October 18 (6 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator

Oh, nice answer David. I had forgotten you can take advantage of the way inline rolls are resolved to do that.