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

Skill Check Macro with Pass/Fail

Not sure it matters, but we play D&D 3.5.  I have been trying to make a macro that allows me, the DM, to make a Spot check for each of the PCs with a single click.  Their Spot Skill does not change often so I am fine hard coding it.  The macro below works, it asks me for the target number (DC) then rolls for each character and gives me the total of roll+skill.

What I would like it to do now is compare the roll to the target and let me know if each character meets or beats it.  It can say  PASS or FAIL, or change the number a different color, just something so I can easily glance at the list, tell who passed so I can let them know they noticed the trap door or whatever.  Once I get this one done I plan to make others for Listen, Sense Motive, etc.  Have been looking through help and the forum but not made any progress past this point.

Thanks!



/em makes LISTEN CHECKS VS DC?{DC|15}

..

Chonk gets a [[d20+7]]

Knots gets a [[d20+5]]

Onoya gets a [[d20+6]]

Elendril gets a [[d20+9]]

May 23 (1 year ago)
Gauss
Forum Champion

Yes, this is doable. 

First, make a Rollable table. 
Name: 0PassFail
Create one result with a name of: Fails

Second, make a second Rollable Table
Name: 1PassFail
Create one result with a name of: Passes

Next the macro: 

/em makes LISTEN CHECKS VS DC?{DC|15}
..
Chonk [[1t[[[{d20+7,0d0}>[[?{DC|15}]]]]PassFail]]]
Knots [[1t[[[{d20+5,0d0}>[[?{DC|15}]]]]PassFail]]]
Onoya [[1t[[[{d20+6,0d0}>[[?{DC|15}]]]]PassFail]]]
Elendril [[1t[[[{d20+9,0d0}>[[?{DC|15}]]]]PassFail]]]

May 23 (1 year ago)
timmaugh
Forum Champion
API Scripter

Unfortunately macros do not natively offer logical conditionals. Gauss's solution works because it uses a couple of single-item tables (so you're sure to get that thing if you roll from that table).

I see "Pro" next to your name, so let me show you how you can do this pretty easily if you install the MetaScriptToolbox (packaging up these scripts):

!{{
  /em makes LISTEN CHECKS VS DC?{DC|15}
  ..
  Chonk gets a [[d20+7]] **{&if $[[0]] >= ?{DC}}Success!{&else}Failure!{&end}**
  Knots gets a [[d20+5]] **{&if $[[1]] >= ?{DC}}Success!{&else}Failure!{&end}**
  Onoya gets a [[d20+6]] **{&if $[[2]] >= ?{DC}}Success!{&else}Failure!{&end}**
  Elendril gets a [[d20+9]] **{&if $[[3]] >= ?{DC}}Success!{&else}Failure!{&end}**
}}


If you want to get a slightly more formatted look, you can use a roll template with the Toolbox, instead:

!{{
  /em makes LISTEN CHECKS VS DC?{DC|15}
  (^){^&template:default}({)name=Listen Checks vs DC?{DC|15}(}) ({)Chonk=[[d20+7]] **{&if $[[0]] > ?{DC}}Success!{&else}Failure!{&end}**(}) ({)Knots=[[d20+5]] **{&if $[[1]] > ?{DC}}Success!{&else}Failure!{&end}**(}) ({)Onoya=[[d20+6]] **{&if $[[2]] > ?{DC}}Success!{&else}Failure!{&end}**(}) ({)Elendril=[[d20+9]] **{&if $[[3]] > ?{DC}}Success!{&else}Failure!{&end}**(})
}}

Also, just a final word... there's no reason these rolls couldn't be retrieved from the character sheet through an attribute retrieval. I don't know the sheet to name the attribute, but it would be something like:

@{Chonk|SpotSkill}

That would make it so that you don't ever have to edit these command lines, again, even if someone's Spot skill changes.

Thanks a lot!  Will take me a bit to go through that and get it tested but wanted to let you both know I appreciate the help.

Have been playing with both methods and they each need one thing to be game ready that I am struggling with.  I did follow the advice and tie the skill number to the character sheet, except for Knots whose player uses paper.

I found D&D 3.5 has custom roll templates so moved the table method into a 3.5 Skill Template.  I confirmed only the GM can see the rolls.  The problem is I would like to see the numbers in addition to pass fail.  If the target is 15 and Chonk got a 16 he hears something, but Knots gets a 25 so she knows it is a dragon snoring.

/w gm &{template:DnD35StdRoll}{{name=Listen Checks}} {{skillflag=true}} {{Chonk [[1t[[[{d20+@{Chonk|Listen},0d0}>[[?{DC|10}]]]]PassFail]]]
Knots [[1t[[[{d20+5,0d0}>[[?{DC|10}]]]]PassFail]]]
Onoya [[1t[[[{d20+@{Onoya|listen},0d0}>[[?{DC|10}]]]]PassFail]]]
Elendril [[1t[[[{d20+@{Elendril|listen},0d0}>[[?{DC|10}]]]]PassFail]]]}}


Using the Script Toolbox version I made a few tweaks but I can't get it to just show the result to me.  I tried /talktomyself but that does not work with scripts.  Tried playing with /w gm but it either breaks the script or does nothing.  Thanks!

!{{
  /gm  LISTEN CHECKS VS DC?{DC|10}
  (^){^&template:default}({)name=Listen Checks vs DC?{DC|10}(}) ({)Chonk=[[d20+@{Chonk|Listen}]] **{&if $[[0]] >= ?{DC}}Success!{&else}Failure{&end}**(}) ({)Knots=[[d20+5]] **{&if $[[1]] >= ?{DC}}Success!{&else}Failure{&end}**(}) ({)Onoya=[[d20+@{Onoya|listen}]] **{&if $[[2]] >= ?{DC}}Success!{&else}Failure{&end}**(}) ({)Elendril=[[d20+@{Elendril|listen}]] **{&if $[[3]] >= ?{DC}}Success!{&else}Failure{&end}**(})

}}

May 24 (1 year ago)
Gauss
Forum Champion

Here you go: 

/w gm 
&{template:default} {{name=Listen Checks}} {{skillflag=true}} {{Chonk [[1t[[[{[[d20+@{Chonk|Listen}]],0}>[[?{DC|10}]]]]PassFail]]] $[[0]]
Knots [[1t[[[{[[d20+5]],0}>[[?{DC|10}]]]]PassFail]]] $[[4]]
Onoya [[1t[[[{[[d20+@{Onoya|listen}]],0}>[[?{DC|10}]]]]PassFail]]] $[[6]]
Elendril [[1t[[[{[[d20+@{Elendril|listen}]],0}>[[?{DC|10}]]]]PassFail]]] $[[10]]}}

May 24 (1 year ago)

Edited May 24 (1 year ago)

Thanks a lot!

In case someone else finds this later I wanted to leave a resolution that was easy to follow.  If there is a way to make the API one also work I would be curious to see how.

This is the final code I ended up with...


/w gm &{template:DnD35StdRoll} {{name=Listen Checks}} {{skillflag=true}} {{Chonk [[1t[[[{[[d20+@{Chonk|Listen}]],0}>[[?{DC|10}]]]]PassFail]]] $[[0]]

Knots [[1t[[[{[[d20+5]],0}>[[?{DC|10}]]]]PassFail]]] $[[4]]

Onoya [[1t[[[{[[d20+@{Onoya|listen}]],0}>[[?{DC|10}]]]]PassFail]]] $[[6]]

Elendril [[1t[[[{[[d20+@{Elendril|listen}]],0}>[[?{DC|10}]]]]PassFail]]] $[[10]]}}


And it looks like this...

Since most people are not playing D&D 3.5 (yes I'm old) the generic version is here...


/w gm &{template:default} {{name=Listen Checks}} {{Chonk [[1t[[[{[[d20+@{Chonk|Listen}]],0}>[[?{DC|10}]]]]PassFail]]] $[[0]]

Knots [[1t[[[{[[d20+5]],0}>[[?{DC|10}]]]]PassFail]]] $[[4]]

Onoya [[1t[[[{[[d20+@{Onoya|listen}]],0}>[[?{DC|10}]]]]PassFail]]] $[[6]]

Elendril [[1t[[[{[[d20+@{Elendril|listen}]],0}>[[?{DC|10}]]]]PassFail]]] $[[10]]}}


And looks like...

To get it to work you need to create two Rollable Tables, one named 0PassFail with a single item in the table, the word Fail.  The other table is named 1PassFail and has the entry PASS!.  Of course you can adjust for whatever text fits your situation.

I am making these for Spot, Listen and Sense Motive (detect lies) which can all be used passively without the players knowing it is being checked.  I add them as macros, set them so only the GM can see them and placed them on the bar.

If you would like, you can also make this somewhat dynamic in case you don't need all 4 PCs to make the check.

You would need to make 5 total abilities in whatever character is holding this, but it allows you to be more dynamic.

You can make a macro that would call the number of people who need to save:

/w gm &{template:npcaction} {{rname=Number of Listen checks needed}} {{description=[1](~<Name of Character Sheet>|Listen-Check-1) [2](~<Name of Character Sheet>|Listen-Check-2) [3](~<Name of Character Sheet>|Listen-Check-3) [4](~<Name of Character Sheet>|Listen-Check-4)}}

Then create 4 abilities called Listen-Check-# that would correspond to how many checks you need.  Here is an example of #1 where you would only need 1 listen check

/w gm &{template:default} {{name=Listen Checks}} {{@{target|t1|token_name} [[1t[[[{[[d20+@{target|t1|Listen}]],0}>[[?{DC|10}]]]]PassFail]]] $[[0]]}}

Then you can just expand this out to t2,t3,t4 for the remaining attributes.  It will prompt you to target the tokens you need to make the checks.


NOTE: I think the system resolves the targets before parsing the macro so that is why I have not been able to figure out how to dynamically select your number of targets.  However, it is not usually a big deal to just create another attribute in a character sheet

May 25 (1 year ago)
timmaugh
Forum Champion
API Scripter


BARRY S. said:

Have been playing with both methods and they each need one thing to be game ready that I am struggling with.  I did follow the advice and tie the skill number to the character sheet, except for Knots whose player uses paper.

...<SNIP>...

Using the Script Toolbox version I made a few tweaks but I can't get it to just show the result to me.  I tried /talktomyself but that does not work with scripts.  Tried playing with /w gm but it either breaks the script or does nothing.  Thanks!

!{{
  /gm  LISTEN CHECKS VS DC?{DC|10}
  (^){^&template:default}({)name=Listen Checks vs DC?{DC|10}(}) ({)Chonk=[[d20+@{Chonk|Listen}]] **{&if $[[0]] >= ?{DC}}Success!{&else}Failure{&end}**(}) ({)Knots=[[d20+5]] **{&if $[[1]] >= ?{DC}}Success!{&else}Failure{&end}**(}) ({)Onoya=[[d20+@{Onoya|listen}]] **{&if $[[2]] >= ?{DC}}Success!{&else}Failure{&end}**(}) ({)Elendril=[[d20+@{Elendril|listen}]] **{&if $[[3]] >= ?{DC}}Success!{&else}Failure{&end}**(})

}}

If by "just show the result to me" you mean you need it to be whispered to you, then you just need the "/w gm" on the template line ... *after* the deferral declaration.

If you're going to have a line-level deferral, it has to be the first thing. The line-level deferral is this bit of text:

(^)

That informs ZeroFrame that you want the caret-character removed anywhere we encounter it in the rest of this individual line. It's removed just as that line is about to be dispatched, which "hides" the text formations until we're in that message.

If you put the "/w gm" as the first thing, then the carets are removed, and all of the hidden constructions stay hidden. So you would want something more like this:

!{{
  /w gm  LISTEN CHECKS VS DC?{DC|10}
  (^)/w gm {^&template:default}({)name=Listen Checks vs DC?{DC|10}(}) ({)Chonk=[[d20+@{Chonk|Listen}]] **{&if $[[0]] >= ?{DC}}Success!{&else}Failure{&end}**(}) ({)Knots=[[d20+5]] **{&if $[[1]] >= ?{DC}}Success!{&else}Failure{&end}**(}) ({)Onoya=[[d20+@{Onoya|listen}]] **{&if $[[2]] >= ?{DC}}Success!{&else}Failure{&end}**(}) ({)Elendril=[[d20+@{Elendril|listen}]] **{&if $[[3]] >= ?{DC}}Success!{&else}Failure{&end}**(})

}}

I haven't been able to make the DnD35StdRoll template work yet. I have to fix a bug with inline rolls breaking the formatting if they're in certain positions in certain templates. Maybe this will give me the opportunity to chase that down...