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

Using Macro that calls a Macro, Second will not output

1667931709

Edited 1667931772
Ed S. posted this specific macro.   I'm new to macros, been decades since I did any programming.   So this: 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} And in case it's not clear, I'm trying to find a simple macro solution for mob attacks and damage generation. I read this as:  First create two macros, Mob-Attack and Mob-Damage, where the the first generates a button to run the second.  This does not work for me because the second macro does NOT output anything in the chat - while the first macro works just fine.   Odd, because if I run the second macro by itself, it works.  I suspect there is some syntax that is carrying over from the first to the second that messes up the coding in the second, but I am not familiar enough with these yet.  Thoughts?  thank you
I just cut-and-pasted those into macros and it worked for me.  I clicked on the 'Mob-Attack' button and just hit enter for the default values, then clicked on the 'Damage' button from chat and hit enter for the default values for the next macro.
1667934915

Edited 1667935111
Okay, that's just odd.  I rebuilt them, and now they work.  Well, thank you for the sanity check.  Just out of curiousity, is there a way to feed the output number of attacks directly into the Damage macro without manually entering it?  
You can't feed the output number into a separate query without a custom Mod script, but you could probably build a single macro that includes both the attack and damage rolls at once.  
1667939048

Edited 1667939274
There might be a more elegant way to do this, but I think this will work to display both the attack and damage roll at the same time: !?{Number of Attackers|10} ?{To hit modifiers +|8} ?{Target AC|15} ?{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} ?{damage type|bludgeoning|slashing|piercing|fire|acid|cold|lightning|thunder|force|radiant|necrotic} $[[3.computed]] hits vs **AC**[[?{Target AC}]] for [[ ([[{?{Number of Attackers}d20 + ?{To hit modifiers +}}>[[?{Target AC}]] ]]?{Damage die} + (?{Damage bonus}*[[{?{Number of Attackers}d20 + ?{To hit modifiers +}}>[[?{Target AC}]] ]]) ]] ?{damage type} Or if you want it prettier, you can use a roll template (assuming you're using a character sheet with a good template). Here's an example using the 'npcaction' roll template for the 'D&D 5E by Roll20' sheet: !?{Number of Attackers|10} ?{To hit modifiers +|8} ?{Target AC|15} ?{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} ?{damage type|bludgeoning|slashing|piercing|fire|acid|cold|lightning|thunder|force|radiant|necrotic} &{template:npcaction} {{rname=Mob Attack}} {{description=$[[3.computed]] hits vs **AC**[[?{Target AC}]] for [[ ([[{?{Number of Attackers}d20 + ?{To hit modifiers +}}>[[?{Target AC}]] ]]?{Damage die} + (?{Damage bonus}*[[{?{Number of Attackers}d20 + ?{To hit modifiers +}}>[[?{Target AC}]] ]]) ]] ?{damage type}}}
1667949444

Edited 1667952803
Just a follow-up - I do see a problem with your macro - not sure why, but it's giving me damage even when there are no hits.  Looking at your syntax (and I have YET to find anywhere that has a simple sheet of syntax explanations), I'm betting that because you use a d20 in each side of the calculations, the to-hit numbers rolled are NOT then passed to the extra damage section, but separate and new d20 rolls happen there instead.    Am I right?