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

How to include defender's AC against an incoming attack? D&D 5e OGL

I am trying to find a way to have all attacks rolled from npcs check if their attack meets player AC. I have been trying with limited success using macros (but I have access to APIs!) on how I can incorporate that in chat. What I want in chat to be is (Attacker) swings his weapon at (Defender) Default roll from rolling off NPC sheet Confirmation of (Hit! / Miss!) based off of (Defender)s AC vs (Attacker's roll) Is there any way I can achieve this? Thanks all
1587505091
GiGs
Pro
Sheet Author
API Scripter
I'm not using that system so I cant give specifics, but you can use somes AC in combat by prefixing with target, like @{target|AC} You'll get prompted to select a token, and the macro will then use the AC of the character that token is linked to.
Thanks! I did get that part working. But all it does when I add it is put a number at the very end. (Their AC). I don't know how to make that roll be opposed to the @{target|AC}. I've tried inserting that portion into multiple areas of the attack ability without success.
1587510057
GiGs
Pro
Sheet Author
API Scripter
If you post the macro you're using to make the attack, we can help you.
This is what happens when my "Cultist" token makes an attack from his character sheet. I don't know where exactly to add the new information in so i can get confirmation of a hit. I assume whatever I would add would be somewhere near {{r1=[[@{Cultist|d20}+(3+0)]]}} which seems to be that npc rolling to hit. @{Cultist|wtype}&{template:npcatk} {{attack=1}} {{damage=1}} {{dmg1flag=1}}  @{Cultist|npc_name_flag} {{rname=[Scimitar](~-M4ve-uU8GQXsF6yimHn|repeating_npcaction_-M4ve052AwkuPvXuFtHd_npc_dmg)}} {{rnamec=[Scimitar](~-M4ve-uU8GQXsF6yimHn|repeating_npcaction_-M4ve052AwkuPvXuFtHd_npc_crit)}} {{type=[Attack](~-M4ve-uU8GQXsF6yimHn|repeating_npcaction_-M4ve052AwkuPvXuFtHd_npc_dmg)}} {{typec=[Attack](~-M4ve-uU8GQXsF6yimHn|repeating_npcaction_-M4ve052AwkuPvXuFtHd_npc_crit)}} {{r1=[[@{Cultist|d20}+(3+0)]]}} @{Cultist|rtype}+(3+0)]]}} {{description=}} @{Cultist|charname_output}