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

Stored variable in macro

So I have a pair of macros that I want to combine instead of doing it manually. (D&D 3.5) So I have a macro where I parry an attack. And my DM is having me do a counter attack and I get to add the result of my parry into my damage. So what I am hoping to do is store the parry result to add into the damage calc result. How can I do that? My DM has the PRO sub if that helps.
1696816955
GiGs
Pro
Sheet Author
API Scripter
You cant do that as two separate macros, at least not with a free account. Your second macro would need a query where it asks you for the parry result, and then adds that into the effect.
1697018835
Ziechael
Forum Champion
Sheet Author
API Scripter
Could you share your current Parry macro and damage macro... depending on the mechanic that drives the ability to add the parry result it might be possible in a single macro ;) Bonus points for sharing the source of the ability/rules that support or govern its usage.
1697034208
timmaugh
Forum Champion
API Scripter
Since mods are available, you can do this with ZeroFrame (part of the MetaScriptToolbox)... but as Ziechael just requested, sharing your attack and parry command lines will make it easier to adapt for you.
Sorry for being unclear. I am currently using 2 macros out of necessity. I want to make it a single macro.
Parry/counter attack macro:  [[1d20 + @{selected|BAB}[BAB] +@{selected|weapon1stat}[Ability] +@{selected|size}[size] +@{selected|weapon1enh}[Weapon1 Enh] +@{selected|weapon1focus}[Weapon1 Focus]+?{Opponents|0}]] parry /w gm [[1d20 + @{selected|BAB}[BAB] +@{selected|weapon1stat}[Ability] +@{selected|size}[size] +@{selected|weapon1enh}[Weapon1 Enh] +@{selected|weapon1focus}[Weapon1 Focus]+?{Opponents|0}]] counter attack Damage Macro: [[@{selected|weapon1damage} + (d0 +@{selected|weapon1damagestat}[Weapon1DamageStat] +@{selected|weapon1enh}[Weapon1 Enh] +@{selected|weapon1specialize}[Weapon1 Specialization]) ]] damage I am adding the final result of the parry to my damage manually. I want to combine them into 1 macro that automatically add the final result of the parry roll to the damage  automatically. 
1697040554
timmaugh
Forum Champion
API Scripter
OK, if your GM installs the MetaScriptToolbox, you can do this... and you can format the options a number of ways. First, here's a very minor tweak on what you already had: !{{    [[1d20 + @{selected|BAB}[BAB] +@{selected|weapon1stat}[Ability] +@{selected|size}[size] +@{selected|weapon1enh}[Weapon1 Enh] +@{selected|weapon1focus}[Weapon1 Focus]+?{Opponents|0}]] parry   /w gm [[1d20 + @{selected|BAB}[BAB] +@{selected|weapon1stat}[Ability] +@{selected|size}[size] +@{selected|weapon1enh}[Weapon1 Enh] +@{selected|weapon1focus}[Weapon1 Focus]+?{Opponents|0}]] counter attack    [\][\]@{selected|weapon1damage} + (d0 +@{selected|weapon1damagestat}[Weapon1DamageStat] +@{selected|weapon1enh}[Weapon1 Enh] +@{selected|weapon1specialize}[Weapon1 Specialization]) + $[[0]].value[parry]\]\] damage }} Since you're combining this all into a single macro... if it were me, I would combine my parry and damage lines into a single templated output. Here's an example using the default template: !{{   (^){^&template:default}{{name=Parry and Riposte}}{{Parry= [[1d20 + @{selected|BAB}[BAB] +@{selected|weapon1stat}[Ability] +@{selected|size}[size] +@{selected|weapon1enh}[Weapon1 Enh] +@{selected|weapon1focus}[Weapon1 Focus]+?{Opponents|0}]]}}{{Damage= [\][\]@{selected|weapon1damage} + (d0 +@{selected|weapon1damagestat}[Weapon1DamageStat] +@{selected|weapon1enh}[Weapon1 Enh] +@{selected|weapon1specialize}[Weapon1 Specialization]) + $[[0]].value[parry]\]\]}}    /w gm [[1d20 + @{selected|BAB}[BAB] +@{selected|weapon1stat}[Ability] +@{selected|size}[size] +@{selected|weapon1enh}[Weapon1 Enh] +@{selected|weapon1focus}[Weapon1 Focus]+?{Opponents|0}]] counter attack }}
That worked perfect. Thank you so much.