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

Average Damage

Hello guys, I'm new to the forum and I'm having some problems understanding the syntax used in macros, if anyone has any tips or guides that I can take a look at, I would appreciate it. Anyway, I'm looking for a macro that will see if the damage done is less than the average damage the attack can cause and, in this case, return the average. Thanks!!
1595057718

Edited 1595057785
Oosh
Sheet Author
API Scripter
The wiki page is a good place to start, also just picking apart the macros created by the character sheets. There is no conditional logic in macros - all it does is output to chat and roll dice. But there's plenty of Stupid Tricks to be found even with such limits. You cannot read the rolled value and then use an IF statement, largely because IF statements don't exist. But you can use the "keep highest" dice rolling function to hack together the functionality you want. For a 2d6 weapon: /roll {2d6,0d0+7}kh1 Grouped rolls {2d6,0d0+7} need to be the same type - either a dice roll or integer. Since 2d6 is a roll, we need to put 0d0+7 as the second option, instead of just 7 or the roller gets mad. Silly but true. You can get fancier, and make it a universal macro for any damage dice: /roll {?{How many dice?|1}d?{What size die?|4|6|8|10|12|20},0d0+[[floor(?{How many dice?}*(?{What size die?}+1)/2)]]}k1 So there you have two of the more useful tools in macros - advanced dice operators and Queries! Oh yeah, don't forget the dice reference page... very handy.