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

Attack Macro Refinement

First-time poster here and obviously new to Roll20 and macros. I'm using D&D 5E  by Roll 20 Character sheets. I found an attack macro that I like and need some syntax help to refine it. What I'm trying to get it to do is print out the attack roll against the target icon AC, which it does fine, and roll damage based on user query for the number of damage dice and type of damage dice, which it also does well. I am trying to add a critical hit feature that pulls the found values for "normal damage" and doubles them and then adds in the user's original modify query value. Here is the macro code so far: &{template:default} {{name=Attack}} {{Attack Roll=[[ 1d20 + @{selected|melee} ]] }} {{vs AC=[[ @{target|AC} ]] }} {{Normal Damage=[[ ?{Number of damage dice?|1}d?{Type of damage dice?|1} + ?{Modifier?|0} ]] }} {{Critical Damage=[[ Norm Dmg * 2 + Mod ]] }} * Note the above screen capture was when the Marco line "{{Critical Damage=[[ Norm Dmg * 2 + Mod ]] }}" was altered to read "{{Critical Damage=[[ 1d6 ]] }}" I'm trying to get the "Norm Dmg" to pull the already found value for "Normal Damage" and the "Mod" to use the already found value for "Modifier".  For all I know, what I'm asking is not possible. So in the above screen capture example, the "Critical Damage" would be 4 * 2 + 0 as 4 was the value of the original "Normal Damage" call value and the user entered 0 for the modifier query. Is there a way to do this? Do I have the syntax for it messed up?
1585888543
Kraynic
Pro
Sheet Author
The dice roller doesn't remember values to be used later, so a regular macro can't quite do what you are after.  If you are just going to double the damage, you will need to do the math or use an api script to do the rolls (since you can reuse values in the api).  I believe Power Cards could do stuff like this, but I have never used it.  There should be an active thread on the Power Cards api script in the API forum.
Thank you for the quick response. I thought that maybe it wasn't possible to do what I was asking of it in just macros.