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

Custom Macro

Is there a way to make a macro that rolls additional damage dice when an attack roll rolls above a certain number? Example, a magic item lets you roll another 1d4 for damage if the d20 used for the attack roll was a 17 or above.

Yes, for example

&{template:default} [[ 1d8 + [[ {[[ 1d20 + (?{Mod|0}) ]]-(?{Mod}),0}>17 ]]d4 ]] {{Attack=$[[0]]}} {{Damage=$[[2]]}}

Will have to be adjusted for your specific case but it's doable.


RainbowEncoder said:

Yes, for example

&{template:default} [[ 1d8 + [[ {[[ 1d20 + (?{Mod|0}) ]]-(?{Mod}),0}>17 ]]d4 ]] {{Attack=$[[0]]}} {{Damage=$[[2]]}}

Will have to be adjusted for your specific case but it's doable.


Cool, can you explain what each part of this command does? I figure the modifier part is asking what my ability mod is, but the other stuff like attack=0 and damage=2 confuses me


Carbonatedjelly said:


Cool, can you explain what each part of this command does? I figure the modifier part is asking what my ability mod is, but the other stuff like attack=0 and damage=2 confuses me

Those parts are using a trick known as Reusing Rolls, it allows for the display of rolls in other places. Otherwise it's the attack roll plus modifier, then in the outer roll that modifier is subtracted to get the original d20 so it can be compared to 17. That returns 0 or 1 to determine the number d4's.



RainbowEncoder said:


Carbonatedjelly said:


Cool, can you explain what each part of this command does? I figure the modifier part is asking what my ability mod is, but the other stuff like attack=0 and damage=2 confuses me

Those parts are using a trick known as Reusing Rolls, it allows for the display of rolls in other places. Otherwise it's the attack roll plus modifier, then in the outer roll that modifier is subtracted to get the original d20 so it can be compared to 17. That returns 0 or 1 to determine the number d4's.


That makes sense, sorry for asking so many quesitons but this became less self explanatory more I look at various forms. Is there any way to add something that differentiates between the the damages? Also we are using a special way of prof bonus that replaces it with 1d4 instead of a number, how would one incorperate that into the to attack roll?


Carbonatedjelly said:

That makes sense, sorry for asking so many quesitons but this became less self explanatory more I look at various forms. Is there any way to add something that differentiates between the the damages? Also we are using a special way of prof bonus that replaces it with 1d4 instead of a number, how would one incorperate that into the to attack roll?

I'm not sure what you mean by "differentiates between the the damages".

I take it "prof bonus" is an attribute that contains "1d4". In that case it could be switched to using Keep/Drop syntax. Instead of replacing the dice count you'd have it afterwards. So it would be 1d4k1 or 1d4k0.

It may be easier if you post your current macro and describe how you need it to change.




April 16 (4 months ago)

Edited April 16 (4 months ago)


RainbowEncoder said:

Carbonatedjelly said:

That makes sense, sorry for asking so many quesitons but this became less self explanatory more I look at various forms. Is there any way to add something that differentiates between the the damages? Also we are using a special way of prof bonus that replaces it with 1d4 instead of a number, how would one incorperate that into the to attack roll?

I'm not sure what you mean by "differentiates between the the damages".

I take it "prof bonus" is an attribute that contains "1d4". In that case it could be switched to using Keep/Drop syntax. Instead of replacing the dice count you'd have it afterwards. So it would be 1d4k1 or 1d4k0.

It may be easier if you post your current macro and describe how you need it to change.

The homebrewed weapon uses 1d20+4+1d4 to attack, 4 being DEX mod, and 3d4 + 4 slashing damage on hit. The magical enchant it has does an additional 1d4 Necrotic damage by base, and another 1d4 necrotic when rolling above 17. I want to seperate the Necrotic damages from the slashing damage to make it look something like this image.

Here is the current macro I have.
&{template:default} {{name=Mikio's Claws}} [[ 3d4 ) + 4 ) + [[ {[[ 1d20+ 4 + 1d4 ) ]]-( 4 ),0}>17 ]]d4 ]] {{Attack=$[[0]]}} {{Slashing Damage=$[[2]]}}




Ah. The 1d4 as part of the attack roll complicates thing, since it cannot be subtracted to easily get the d20 value. It can be worked around but it will mask the d20 roll. This macro will work

&{template:default} {{name=
$[[$[[0]]]]
[[[ [[1d20>17 + 1]] [[ [[0]] ]] ]]]
Bonus Nec Dmg [[ 2d4 ]]
Std Nec Dmg [[ 1d4 ]]
High Atk [[ (16 + 1d4cf0)[d20] + 4 + 1d4cs0cf0 ]]
Low Atk [[ (1d16cs0)[d20] + 4 + 1d4cs0cf0 ]]

}} {{Attack=$[[5]]
}} {{Slashing Damage=[[ 3d4 + 4 ]]
}} {{Necrotic Damage=$[[3]]
}} {{name=Miki's Claws}}

A d20 is rolled first to check if it's high (>=17) or low (<17). That result is then used to perform some roll index manipulation so that when reusing rolls it points to the appropriate damage/attack rolls. The attack and damage rolls have to rolled so that they conform to the high/low status from the d20 roll. This makes the attack rolls look a little weird.

This is sick, Im trying to make a custom template and stuff now for it too if I can, tysm for the help.