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

Attack Macro help

This is the macro I am attempting to run /roll {1d20+5}>=?{Enemy AC} /roll 1d8+3 I want to roll a 1d20+5 for my attack, then compare it to the input of enemy AC by the player. It asks for the AC But then gives an error. Is there a way to make this happen or is it a lost cause?
1384648339

Edited 1384648456
Pat S.
Forum Champion
Sheet Author
[[{1d20+5}>?{Enemy AC}]] is an inline roller that will ask you (the person that is doing the rolling) for the AC and make the roll. /roll {1d20+5}>?{Enemy AC} is the roller without the = and it works that way also. There is no way outside the use of the API (requires mentor level) to let you make the roll and have another person input the AC. I'm not sure if you can do that with the API either (I'm not a coder so I'm not sure).
I wanted to input the AC but I was looking to use a greater than or equal to. for what ever reason it is rolling the d8 but not the d20
1384648734
Pat S.
Forum Champion
Sheet Author
you have the = sign in it. That is not needed. Just use the > sign.
but doesnt that only output hits that are greater?
1384649873
Pat S.
Forum Champion
Sheet Author
It just outputs a 1 or 0. A 1 is success while a 0 is a failure. This is why I mentioned the API. I think what you want will require it but on the off chance I'm wrong have you read the dice preferences in the wiki?
I have and the plain > actually does the trick. I was thinking along the lines of basic programming. with the above macro if you hit the target ac or above it shows as a success. Thank you for the help.
1384655004
Pat S.
Forum Champion
Sheet Author
You're welcomed. If you need anymore help then ask and someone will help.
1384662965
Gauss
Forum Champion
In Roll20 a > is the same as => and a < is the same as =<. While this is not mathematically correct my guess is that it is set up that way to simplify the characters required.
I do not believe there are any plans to add conditional operators beyond the > or < ones (which are typically used to count successes in systems where you roll several dice and count up the ones that are above number X). So IF/THEN, AND, OR, XOR, etc. are unlikely to be available to the macro system. Rugged reroll has some additional macro functionality in that you can (effectively) infinitely nest macros, but I don't think they're going to go much farther than that by design (macros are not the API). That being said I just have it show me the AC since manually seeing that someone rolled X compared to Y and determining which is higher should be pretty easy. The advantage of doing it manually is that you can easily calculate combat modifiers without needing a roll query. For example, if a Rogue got a 21 to hit vs. AC 22, in your formula it would show as a miss (output 0), but if that rogue has combat advantage (4e) or flanking (3.5/Pathfinder) the roll is instead a 23 and he hits. This is easy to do with the numbers, harder if you're doing a comparison. Just something to consider.
1385500243
Sam
Pro
Sheet Author
Just wanted to mention that in Rugged Reroll, Dan K.'s original macro could be rewritten by saying /roll {1d20+5}>@{target|AC} /roll 1d8+3 which would then let the user select the enemy or target at the time the macro is ran and it will pull in that target's AC attribute