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

Help with a Macro for Target Number / Difficulty Class

Hi, 

I´m really new here (as of this post, just a couple of weeks) and I´m just getting use to Roll20. I loved it btw and I´m learning things as I go. I just learned how to use Macros and FXs, the map thing is really fun to do. 

The only thing I couldn´t figure out was how to set a DC or target number for my players to beat, hoping that SUCCESS or FAILURE appear at the chat as a visual incentive instead of just telling them by the mic.
In other words: Is there a macro for me to set a DC or target number an then, when my players roll a dice, they find out if they succeded or not?

Thanks in advance.

July 01 (5 years ago)
GiGs
Pro
Sheet Author
API Scripter

I dont know what your normal macro looks like, but the basic principle is simple:

/roll {1d20+5}>10


I don´t actually have a macro, I just wanted to know if I could set a DC (for example 5, so when one of my players rolls a d20 he/she should get a 5 or higher in his/her roll for a success). As a GM I just want to set it so my player can roll against it,I don´t want to roll a dice.

Again, sorry. I´m pretty new at this.

July 01 (5 years ago)
GiGs
Pro
Sheet Author
API Scripter

You likely need to create a macro for this purpose, and set it as visible to players. This page describes how they work:

https://wiki.roll20.net/Macros

If youre specific about what you need, we can help. You'll have to tell us how rolls work, what modifiers might apply, etc.


Ok. I'll try to explain with an example:


GM : There's a boulder in your path.

Warrior: ok. I try to move it aside.

GM: ok. Roll for STR (here the GM sets a target number/DC to beat. In this case 8)

Warrior: * rolls STR. 1D20 = 12

CHAT: SUCCESS


July 02 (5 years ago)
GiGs
Pro
Sheet Author
API Scripter

The basic approach would be:

/roll {1d20+@{STR}}>8

But you'd need to hard code for every different use case. You can make queries:

/roll {1d20+@{STR}}>?{Difficulty|8}

This will prompt the player to enter a difficulty level, with the defeault set at 8.

If you want to tailor it for different attributes, you can make a query that works for those

/roll {1d20+?{Choose Attribute|
STR,@{STR}|
DEX,@{DEX}|
CON,@{CON}|
INT,@{INT}}}>?{Difficulty|8}

In the above query, the bit on the left side of the comma is the label that appears to the player, while the bit on the right is the attribute value used by the macro.

The above works if every character creates this macro in their character sheet's Abilities section. If you want to make macros that you only have to create once and are usable by everyone, you can add selected| to the attribute terms, like so

/roll {1d20+?{Choose Attribute|
STR,@{selected|STR}|
DEX,@{selected|DEX}|
CON,@{selected|CON}|
INT,@{selected|INT}}}>?{Difficulty|8}

This requires players each have a token that represents their character. With their token selected, they can run this macro, and it will take the values needed from their character sheets.

Create this macro, or one like it, in your Macros sidebar, and make sure Visibility is set to All. It makes sense to tick the Token Action button too. Then whenever a player selects their token, a button will appear at the top left of their screen to launch this macro.


July 02 (5 years ago)

Edited July 02 (5 years ago)
Oosh
Sheet Author
API Scripter

Ninja'd! You can safely ignore most of my post as it's just a repeat of GiGs work. Except the template option down the bottom.


What game/character sheet are you using? That will dictate which Attribute to reference in your roll. The simplest would be:

/r {1d20+@{selected|strength_mod}}>?{DC?|10}

The bold Attribute will change depending on which character sheet you use. This is the Attribute for 5e. The bold 10 is the default value for the Query, change it to whatever you wish.

Adding a Query for the stat used would look like this:

/r {1d20+?{Which Ability?|

Strength,@{selected|strength_mod}|

Dexterity,@{selected|dexterity_mod}}}>?{DC|10}

Note the line breaks after the options in the Ability Query - this is one of the few places you can put a line break in macros without sending a new line to chat. Keep following the pattern to fill in more stats!


Depending on your game/sheet you can also use a template if you prefer the output. The default template is available in any game:

&{template:default}{{name=@{selected|character_name} Ability Check}} ?{DC|10} {{?{Which Ability?|
Strength,Strength Check vs DC?{DC}=[[{1d20+@{selected|strength_mod}}>?{DC}]] success|
Dexterity,Dexterity Check vs DC?{DC}=[[{1d20+@{selected|dexterity_mod}}>?{DC}]] success} }}

This one is starting to get a bit trickier with the HTML entities.