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 .
×

Hits and Damage macros for Large groups of summons

I found that this macro works really well for calculating hits for large groups of summons [[{?{Number of Attackers|10}d20 + ?{To hit modifiers +|8}}>[[?{Target AC|15}]] ]] hits vs **AC**[[?{Target AC}d1]] Does anyone have a recommendation for how to add an advantage/disadvantage dropdown at the beginning for something like pack tactics?
1654267036
GiGs
Pro
Sheet Author
API Scripter
How would advantage or disadvantage work on something like this? How many extra dice would you roll, and how many would you keep?
I think each attack would be evaluated against 2 rolls and then the Ad/Dis result is what is put into the ultimate calculation GiGs said: How would advantage or disadvantage work on something like this? How many extra dice would you roll, and how many would you keep?
1654268458
GiGs
Pro
Sheet Author
API Scripter
I don't think you can do that without an API script (requiring a pro subscription). You need to seperating each die into sets of two which themselves have to be compared to a variable target number - and keep the sets separate, before adding them all up. I think that's beyond the capabilities of the dice engine.
Here's one I made earlier [[ ?{Advantage?| Normal,?{Number of Attackers|10}d20>[[{?{Target AC|15}-(?{To hit modifiers +|8}),1}kh1]]| Advantage,?{Number of Attackers|10}-[[?{Number of Attackers}d20<[[{?{Target AC|15}-(?{To hit modifiers +|8})-1,0}kh1]] ]]d20<[[{?{Target AC}-(?{To hit modifiers +})-1,0}kh1]]| Disadvantage,[[?{Number of Attackers|10}d20>[[{?{Target AC|15}-(?{To hit modifiers +|8}),1}kh1]] ]]d20>[[{?{Target AC}-(?{To hit modifiers +}),1}kh1]]} ]] hits vs **AC**[[?{Target AC}d1]]
1654271072
GiGs
Pro
Sheet Author
API Scripter
Ranbow, can you break down what the Advantage line is doing? In my tests, it doesn't seem to be rolling the correct number of dice. Also, it's consistently rolling against a target number that is 1 too low.
For Advantage the innermost roll is checking how many fail to meet the AC by counting how many rolls are strictly below the target which is where the -1 is coming from. Those failed rolls are then rolled again in the outer roll, counting how many fail a second time by being strictly below the target. That final number is then subtracted from the Number of Attackers to return the number of hits. It is quite scrappy and I definitely made a poor decision in how I chose to handle the target number An equivalent but neater version [[ ?{Advantage| Normal,{?{Number of Attackers|10}d20 + ?{To hit modifiers +|8}}>| Advantage,?{Number of Attackers|10}-{[[{?{Number of Attackers}d20 + ?{To hit modifiers +|8} +1 }<?{Target AC|15}]]d20 + ?{To hit modifiers +} +1 }<| Disadvantage,{[[{?{Number of Attackers|10}d20 + ?{To hit modifiers +|8}}>?{Target AC|15}]]d20 + ?{To hit modifiers +}}>}?{Target AC|15} ]]
I cant seem to get the output to show how many hits land against a particular AC - are you supplementing additional code to deliver that output? RainbowEncoder said: For Advantage the innermost roll is checking how many fail to meet the AC by counting how many rolls are strictly below the target which is where the -1 is coming from. Those failed rolls are then rolled again in the outer roll, counting how many fail a second time by being strictly below the target. That final number is then subtracted from the Number of Attackers to return the number of hits. It is quite scrappy and I definitely made a poor decision in how I chose to handle the target number An equivalent but neater version [[ ?{Advantage| Normal,{?{Number of Attackers|10}d20 + ?{To hit modifiers +|8}}>| Advantage,?{Number of Attackers|10}-{[[{?{Number of Attackers}d20 + ?{To hit modifiers +|8} +1 }<?{Target AC|15}]]d20 + ?{To hit modifiers +} +1 }<| Disadvantage,{[[{?{Number of Attackers|10}d20 + ?{To hit modifiers +|8}}>?{Target AC|15}]]d20 + ?{To hit modifiers +}}>}?{Target AC|15} ]]
Duke said: I cant seem to get the output to show how many hits land against a particular AC - are you supplementing additional code to deliver that output? Oh I forget the hits vs AC at the end [[ ?{Advantage| Normal,{?{Number of Attackers|10}d20 + ?{To hit modifiers +|8}}>| Advantage,?{Number of Attackers|10}-{[[{?{Number of Attackers}d20 + ?{To hit modifiers +|8} +1 }<?{Target AC|15}]]d20 + ?{To hit modifiers +} +1 }<| Disadvantage,{[[{?{Number of Attackers|10}d20 + ?{To hit modifiers +|8}}>?{Target AC|15}]]d20 + ?{To hit modifiers +}}>}?{Target AC|15} ]] hits vs **AC**[[?{Target AC}d1]]
1654274741

Edited 1654275016
GiGs
Pro
Sheet Author
API Scripter
That seems to be working perfectly. I don't understand it, but it's working! I removed the outer [[ ]] and replaced with /roll so i could see the inner roll and trust it was working properly. I'd be happier if I could see all the dice rolls in normal use, but it is a very clever approach. PS: a snippet from when I was trying to figure out how it works: Regarding the hits at the end, I'd drop the d1, just using **AC**[[?{Target AC}]] It's not really a roll and that works just as well for highlighting the AC
1654275261

Edited 1654275476
Gigs would you mind posting your updated code? GiGs said: That seems to be working perfectly. I don't understand it, but it's working! I removed the outer [[ ]] and replaced with /roll so i could see the inner roll and trust it was working properly. I'd be happier if I could see all the dice rolls in normal use, but it is a very clever approach. PS: a snippet from when I was trying to figure out how it works: Regarding the hits at the end, I'd drop the d1, just using **AC**[[?{Target AC}]] It's not really a roll and that works just as well for highlighting the AC
1654275681
GiGs
Pro
Sheet Author
API Scripter
For that screenshot, I was using the code from RainbowEncoder's earlier version, but the latest version seems to be working properly according to my testing (though it doesnt roll 2 dice per die: it rolls one die, then rerolls failure, so it gets the same effect as rolling 2 dice). In that last code, you'll have to remove linebreaks - they'll break the macro. So this should work: [[ ?{Advantage| Normal,{?{Number of Attackers|10}d20 + ?{To hit modifiers +|8}}>| Advantage,?{Number of Attackers|10}-{[[{?{Number of Attackers}d20 + ?{To hit modifiers +|8} +1 }<?{Target AC|15}]]d20 + ?{To hit modifiers +} +1 }<| Disadvantage,{[[{?{Number of Attackers|10}d20 + ?{To hit modifiers +|8}}>?{Target AC|15}]]d20 + ?{To hit modifiers +}}>}?{Target AC|15} ]] hits vs **AC**[[?{Target AC}]]
Also one other thing I thought of -  the way the is constructed today would not allow for a hit to check for a crit correct?  So if i roll an 18 and it hits, the macro wont still reroll to check for a natural 20 - am I understanding that correctly?
1654275900
GiGs
Pro
Sheet Author
API Scripter
By the way, if you put that code in a macro, don't reopen the macro: that will cause it to break. All those } strings are necessary html entities to substitute for } characters, and in the act of opening a macro, Roll20 converts them back into }, which breaks the macro.
1654275962
GiGs
Pro
Sheet Author
API Scripter
You can't see the first group of dice, so you can't know which of those dice rolled a crit.