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

Trying to get a macro to properly work, one that rolls for multiple hits and then for multiple instances of damage.

1486548017

Edited 1486549105
Basically, I'm trying to figure out how to get a macro to do the following: I want it to roll a variable amount of hits with a variable modifier, then compare those to a variable AC. Then it pumps out the number of attacks that hit, and uses that number to determine how many die rolls are made and how many times the modifier is multiplied. So, for example, if 3 attacks hit, and the damage an attack did was 1d10+3, it would roll 3d10+9. So far, the closest thing I managed to make is a two-step macro that I need to manually input: [[{?{Number of rolls|1}d20+?{Mod|0}}>?{DC|10}]] [[{[[?{Number of hits|1}*2]]d6+?{Number of hits}*?{Mod|0}}]] (works specifically for 2d6 + modifier attacks) Is there a way to do something, like... [[{?{Number of rolls|1}d20+?{Mod|0}}>?{DC|10}]] = $NumberOfTimesHit [[{[[$NumberOfTimesHit*2]]d6+$NumberOfTimesHit*?{Mod|0}}]] (works specifically for 2d6 + modifier attacks) If there's a way to set a variable, that'd fix my entire problem, but I don't know if there's a way to do it. Thanks! EDIT: I got it to work, but only for attacks with damage rolls that don't have a modifier. So, it would work perfectly for this: [[ [[{?{Number of attacks|1}d20+?{Mod|0}}>?{AC|10}]]d12 ]] (for damage rolls that are just 1d12) But I want it to work for the following: 1 hit: 1d12+3 2 hits: 2d12+6 etc.
Variables are not possible without the use of the API which is a Pro level subscription feature. The Roll queries are held so any ?{.... you enter will carry through the macro.
1486561248

Edited 1486562527
I do have a mob attack macro that I split up into two parts the attack and the damage. You roll the attacks find the number of successes then roll the damage and enter the number of successes. It works pretty well for mobs of attackers, our mage uses it with animate objects. Make a macro #Mob-Attack [[{?{Number of Attackers|10}d20 + ?{To hit modifiers +|8}}>[[?{Target AC|15}]] ]] hits vs **AC**[[?{Target AC}d1]] [Damage](!
#Mob-Damage) #Mob-Damage [[ (?{Number of hits|1}?{Damage die|1d4,)d4|1d6,)d6|1d8,)d8|1d10,)d10|1d12,)d12|2d4,*2)d4|2d6,*2)d6|2d8,*2)d8|2d10,*2)d10|2d12,*2)d12|3d4,*3)d4|3d6,*3)d6|3d8,*3)d8|3d10,*3)d10|3d12,*3)d12} + (?{Damage bonus|4}*?{Number of hits}) ]] ?{damage type|bludgeoning|slashing|piercing|fire|acid|cold|lightning|thunder|force|radiant|necrotic}
I'm a fan of Ed's method of using Command Buttons to make rolling damage easier. Some D&D 5E players wouldn't mind using a single damage roll in this case , which would greatly simplify things.
Ed S. said: I do have a mob attack macro that I split up into two parts the attack and the damage. You roll the attacks find the number of successes then roll the damage and enter the number of successes. It works pretty well for mobs of attackers, our mage uses it with animate objects. Make a macro #Mob-Attack [[{?{Number of Attackers|10}d20 + ?{To hit modifiers +|8}}>[[?{Target AC|15}]] ]] hits vs **AC**[[?{Target AC}d1]] [Damage](!
#Mob-Damage) #Mob-Damage [[ (?{Number of hits|1}?{Damage die|1d4,)d4|1d6,)d6|1d8,)d8|1d10,)d10|1d12,)d12|2d4,*2)d4|2d6,*2)d6|2d8,*2)d8|2d10,*2)d10|2d12,*2)d12|3d4,*3)d4|3d6,*3)d6|3d8,*3)d8|3d10,*3)d10|3d12,*3)d12} + (?{Damage bonus|4}*?{Number of hits}) ]] ?{damage type|bludgeoning|slashing|piercing|fire|acid|cold|lightning|thunder|force|radiant|necrotic} Thanks a lot for that! Even more so since now I know how the syntax for what I wanted to do works, but also because I can just straight up use your macro with a couple of small edits. That helped a lot. Silvyre said: I'm a fan of Ed's method of using Command Buttons to make rolling damage easier. Some D&D 5E players wouldn't mind using a single damage roll in this case , which would greatly simplify things. Definitely doesn't sit well with me - if 5 enemies do 5*(11+2) out of 5(d12+2) or 5*(2+2) out of 5(d12+2), that's gonna be devastating. But thanks for letting me know!
My favorite part of that macro is the drop down for the damage. I think I covered all the cases with it and it really speeds things up. 
1486881736
Andrew C
Marketplace Creator
Then the other "cheat" is to average the damage based off dice averages. 2d6 averages 7, 2d8 averages 9, etc.
Andrew (Halfling Gypsy) said: Then the other "cheat" is to average the damage based off dice averages. 2d6 averages 7, 2d8 averages 9, etc. Yeah, that one IS a great cheat that I've been considering using for sure!