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

Hit or Miss d20 roll vs. secret target AC

Hello all. Working in D&D5e, using the DnD5e_Character_Sheet. I am trying to set up a Ability that will compare the player's d20 to hit roll to the target's AC, and only roll damage if the attack succeeds. The target's AC has to stay a secret. Here is what I have so far, and would appreciate any guidance you can offer: Name: !Ranged-Weapon-Attack-1 ?{Battlecry} /me attacks with her @{selected|rangedweaponname1}, rolling a [[1d20 + @{selected|dexterity_mod} + @{selected|PB}>@{target|foe|npc_AC}]] doing [[d@{selected|rangeddmg1} + @{selected|dexterity_mod}]] @{selected|rangeddmgtype1} damage. Can anyone help me out please?
It's impossible to hide any stats from players in Roll20 without a pure API solution. They can simply type /talktomyself and then enter @{target||npc_AC} or any attribute they want to see that way if the token is linked to a character sheet.
Thank you Sky. To clarify, the secret of the AC is not a deal breaker. I am much more interested in how to compare the d20 roll to the AC and return a Boolean condition of some type; something I can use to then trigger a damage roll or a miss dialogue.
1493957984

Edited 1493958052
You can't really do that either without the API. You can do [[ [[1d20>@{target|ac}]] * 1d8]] damage.
Thank you again. It appears to be skipping the comparison altogether and simply multiplying the d20 roll (which it is no longer animating, interestingly) and by the d4 roll (which is is still animating). Here is the macro as it stands: /me attacks @{target|foe|token_name} with her @{selected|rangedweaponname1}. /em rolls a [[ [[1d20 + @{selected|dexterity_mod} + @{selected|PB}>@{target|foe|npc_AC}]]*[[d@{selected|rangeddmg1} + @{selected|dexterity_mod}]] ]] @{selected|rangeddmgtype1} damage. Here are the results: Nissa Garrick "Nim" attacks worg 2 with her dart. Nissa Garrick "Nim" rolls a 54piercing damage.
1494002679
Lithl
Pro
Sheet Author
API Scripter
Tim M. said: [[1d20 + @{selected|dexterity_mod} + @{selected|PB}>@{target|foe|npc_AC}]] This is not comparing npc_AC to (d20 + dexterity_mod + PB). This is comparing npc_AC to PB, and adding that value to d20 + dexterity_mod. Wrap your roll+modifiers in curly braces (ie: {d20 + ...}>@{...}) and that ought to fix your problem.