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

Multiattack Macro

Hey! So i've been messing aroung with macros lately, and i'm trying to develop a macro to make it easy to attack with my necromancer's skeletons. They r condensed in one big token called the Undead Army, but i would like to design a macro that would ask me how many skeletons would like to attack and than roll a attack for all of each one of them. But i also want it to look cool so i've been trying to add a template to the whole thing &{template:npcaction} {{attack=1}} {{damage=1}} {{dmg1flag=1}} {{name= Three Skeletons}} {{rname= Horde Strike 3x}} {{r1=[[1d20+4]]}} {{always=1}} {{r2=[[1d20+4]]}} {{dmg1=[[1d6+7]]}} {{dmg1type=slashing}} {{crit1=[[6]]}}  &{template:npcaction} {{attack=1}} {{damage=1}} {{dmg1flag=1}} {{name=}} {{rname=}} {{r1=[[1d20+4]]}} {{always=1}} {{r2=[[1d20+4]]}} {{dmg1=[[1d6+7]]}} {{dmg1type=slashing}} {{crit1=[[6]]}} &{template:npcaction} {{attack=1}} {{damage=1}} {{dmg1flag=1}} {{name=}} {{rname=}} {{r1=[[1d20+4]]}} {{always=1}} {{r2=[[1d20+4]]}} {{dmg1=[[1d6+7]]}} {{dmg1type=slashing}} {{crit1=[[6]]}}   This macro works for 3 attacks but when i try to implement a ?{Mob size|1,  &{template:npcaction} {{attack=1}} {{damage=1}} {{dmg1flag=1}} {{name= Three Skeletons}} {{rname= Horde Strike 3x}} {{r1=[[1d20+4]]}} {{always=1}} {{r2=[[1d20+4]]}} {{dmg1=[[1d6+7]]}} {{dmg1type=slashing}} {{crit1=[[6]]}}  |, 2...} it doesn't read correcly :/. I also ve no idea of what i'm doing, i'm sure the code looks like a mess xD, can anyone help me :'( ? (Also sry for any mispelling, eng is not my native language xD)
1678165927
timmaugh
Forum Champion
API Scripter
Are scripts available or an option? That is, was the game started by a pro member?
1678166080
GiGs
Pro
Sheet Author
API Scripter
Roll20 doesnt support looping in macros - you cant make a macro to roll a unspecified number of attacks. Well there is a way, but it requires one macro for attacks, and a separate macro from damage. I don't use the sheet you're building so I'm not familiar with the template. I'll show you basic roll syntax and you can incorporate it into you macro. If you want to make multiple rolls against the same target, use this: /r {?{How many|5}d20+4}>?{Target AC|10} Or /r {?{How many|5}d20+?{Attack Bonus|4}}>?{Target AC|10} This allows you to declare how many attacks there, and will then tell you how many hit the target. You can then have a separate macro where yo uenter how many damage rolls there: /r ?{How Many Hits|1}d6 + 7 * ?{How Many Hits} or /r ?{How Many Hits|1}d6 + ?{Damage Bonus|0} * ?{How Many Hits}
GiGs said: Roll20 doesnt support looping in macros - you cant make a macro to roll a unspecified number of attacks. Well there is a way, but it requires one macro for attacks, and a separate macro from damage. I don't use the sheet you're building so I'm not familiar with the template. I'll show you basic roll syntax and you can incorporate it into you macro. If you want to make multiple rolls against the same target, use this: /r {?{How many|5}d20+4}>?{Target AC|10} Or /r {?{How many|5}d20+?{Attack Bonus|4}}>?{Target AC|10} This allows you to declare how many attacks there, and will then tell you how many hit the target. You can then have a separate macro where yo uenter how many damage rolls there: /r ?{How Many Hits|1}d6 + 7 * ?{How Many Hits} or /r ?{How Many Hits|1}d6 + ?{Damage Bonus|0} * ?{How Many Hits} Thank u so much! I didn't expect to receive an answer so fast xD. I'll try this for sure! Reducing all that Skeletons actions to 2 actions should simplify combat a lot (Specially when u r a lvl 10 necromancer wandering around with 45 skeletons lol) timmaugh said: Are scripts available or an option? That is, was the game started by a pro member? Yes our DM is a pro member and he is hosting a Dungeon of the Mad Mage game for us in DND 5e
1678213812
timmaugh
Forum Champion
API Scripter
Since scripts are available, you could do this using metascipts (ZeroFrame, Plugger, with possibly APILogic and Fetch depending on how many bells & whistles you wanted). GiGs seems to have you sorted for now, but if you wanted an output of each attack on its own line, I can mock up an example of a metascript solution so you can see what that would look like.
1678397205
GiGs
Pro
Sheet Author
API Scripter
Tim has a good suggestion, but I dread to think about this with 45 skeleton's each making their own attacks: timmaugh said: if you wanted an output of each attack on its own line
timmaugh said: Since scripts are available, you could do this using metascipts (ZeroFrame, Plugger, with possibly APILogic and Fetch depending on how many bells & whistles you wanted). GiGs seems to have you sorted for now, but if you wanted an output of each attack on its own line, I can mock up an example of a metascript solution so you can see what that would look like. Thank you Timmaugh! I would love to see that mock up! i ve been wanting to learn more about roll20 metascript stuff, is there a guide somewhere with all the syntax? I do have some experience with Java and C already (and some very limted experience with HTML and CSS xD). The macros are working fine, i'm using a code that i adapted from a user on reddit for the attack. The only problem with it is that it aways rolls all the dices, so it can be kinda laggy sometimes. &{template:default}{{name=💀The skeletons attack!}}{{[[[{?{number of skeletons},1}kl1]]](#.#)=[[1d20+4]]}}{{[[[{?{number of skeletons},2}kl1]]](#.#)=[[1d20+4]]}}{{[[[{?{number of skeletons},3}kl1]]](#.#)=[[1d20+4]]}}{{[[[{?{number of skeletons},4}kl1]]](#.#)=[[1d20+4]]}}{{[[[{?{number of skeletons},5}kl1]]](#.#)=[[1d20+4]]}}{{[[[{?{number of skeletons},6}kl1]]](#.#)=[[1d20+4]]}}{{[[[{?{number of skeletons},7}kl1]]](#.#)=[[1d20+4]]}}{{[[[{?{number of skeletons},8}kl1]]](#.#)=[[1d20+4]]}}{{[[[{?{number of skeletons},9}kl1]]](#.#)=[[1d20+4]]}}{{[[[{?{number of skeletons},10}kl1]]](#.#)=[[1d20+4]]}} For the dmg roll i'm using the one GiGs showed me! (Thank u again GiGs!). I just changed it to the default template :P &{template:default} {{name= 💀The skeletons unleash a barrage of arrows 🏹!}} {{Piercing=[[?{How Many Hits|1}d6 + 7 * ?{How Many Hits}]]}}
1678549234

Edited 1678552769
timmaugh
Forum Champion
API Scripter
I've got a working model of this, but I want to make sure I have a few mechanics correct. You have a template part that says {{crit1=[[6]]}}... does that mean that the attack roll scores a critical on a 6? And if a critical is scored, what is the mechanic to increase damage... double the original roll, or rolling the attack again and adding... or something else? Also, is there a mechanic for if the to-hit roll hits the target? For instance, rolling over the target's AC? And is there a standard way to determine if you are rolling with advantage? A sheet attribute?
1678599851
timmaugh
Forum Champion
API Scripter
Here is a working option. This will ask how many skeletons are attacking and whether they are attacking with advantage (or disadvantage, or normally). It does not yet take into account the defensive capability of the target (ie, AC). It assumes that scoring a crit should reroll the damage again. Oh, and it totals the damage for you at the bottom. Here is a screenshot of 15 skeletons attacking at the same time. That's gonna hurt. Here's the setup... REQUIRED SCRIPTS: ZeroFrame (v1.1.0, due in the merge this week), Muler, APILogic, and MathOps I created a character called NecroMule (you can use an existing character - like your necromancer - just replace all references to NecroMule with your character's name). On that character, I created 2 abilities named TemplateParts and NecroHordeAttack . TemplateParts: skelpart={\& if get.NecroMule.TemplateParts.skelcounter <= get.NecroMule.TemplateParts.skelneeded/get}{{ Skeleton get.NecroMule.TemplateParts.skelcounter/get= {\\&global ([rollget.NecroMule.TemplateParts.skelcounter/getresult][\\][\\]{\&if withAdv = Normal}1d20+4{\&elseif withAdv = Advantage}2d20kh1+4{\&else}2d20kl1+4{\&end}\\]\\]) }{\&global ([dmgget.NecroMule.TemplateParts.skelcounter/getresult] [\][\]1d6+7\]\])}{\\&global ([critget.NecroMule.TemplateParts.skelcounter/getresult] {\&if dmgget.NecroMule.TemplateParts.skelcounter/getresult.value = 13}[\\][\\]1d6+7\\]\\]{\&else}[\\][\\]0\\]\\]{\&end})} rollget.NecroMule.TemplateParts.skelcounter/getresult ... dmgget.NecroMule.TemplateParts.skelcounter/getresult{\&if dmgget.NecroMule.TemplateParts.skelcounter/getresult.value = 13} ... critget.NecroMule.TemplateParts.skelcounter/getresult{\&end}}} set\\.NecroMule.TemplateParts.overalldmg = {\\&math dmgget\.NecroMule.TemplateParts.skelcounter/getresult.value + get\.NecroMule.TemplateParts.overalldmg/get + critget.NecroMule.TemplateParts.skelcounter/getresult.value}/set set\\.NecroMule.TemplateParts.skelcounter = {\&math get.NecroMule.TemplateParts.skelcounter/get + 1}/set get\\\.NecroMule.TemplateParts.skelpart/get {\&else}{{Overall Damage=**get\.NecroMule.TemplateParts.overalldmg/get **}} {\& end} skelcounter=0 skelneeded=0 overalldmg=0 NecroHordeAttack: !&{template:default}{{name=Necro Horde Attack}}{{ TOKEN=**ROLL  ... DMG ...CRIT **}}get.NecroMule.TemplateParts.skelpart/get {&simple} set.NecroMule.TemplateParts.skelneeded = ?{How many skeletons?|5}/set set.NecroMule.TemplateParts.skelcounter = 1/set set.NecroMule.TemplateParts.overalldmg = 0/set{&global ([withAdv] ?{Advantage?|Normal|Advantage|Disadvantage})} Run the NecroHordeAttack and answer the roll queries.