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 .
×

Macro with queries

1592365786

Edited 1592367353
I'm writing a macro for my Pathfinder Cavalier/Paladin. I'm happy with what I have so far with calculating the "to hit" but was hoping there is a way to adjust the damage with the same queries that are built in the "to hit" part. Or will I have to just put all the same queries with the corresponding damage adjustments and have to go through all the queries twice? &{template:pf_attack} {{character_name=@{selected|character_name}}} {{subtitle}} {{name=+ @{selected|weapon enhancment} lance}} {{attack= [[ 1d20cs>20 + @{selected|STR-mod} + @{selected|bab} + @{selected|size} + @{selected|weapon focus} + @{selected|weapon enhancment} ?{Charge?|Yes, +4 [Charge]|No, +0} ?{Power Attack?|No, +0|Yes, -3 [PowerAttack]} ?{Smite Evil?|No, +0|Yes, + @{selected|CHA-mod} [Smite]} ?{Challenge?|No, +0|Yes, + @{selected|class-0-level} [Challenge]} ?{Distracting Charge?|No, +0|Yes, +2 [Distracted Charge]} ]] }}
1592384247
Ziechael
Forum Champion
Sheet Author
API Scripter
It is absolutely possible, without knowing the results you want for the damage output I can't really give a useful example but the way it works is that if you use the same name for your query it will reuse the result elsewhere in a macro: ?{Query|1, thing|2, other thing} will return ' thing' or ' other thing' anywhere else that ?{Query} is used. For variable results like Power Attack you can use math and binary to create variable/dynamic stuff: Att: blah... - [[?{Power Attack|No,0|Yes,1}*3]] + bleh Dam: blah... +[[?{Power Attack}*6]] (not sure on the pf power attack rules but you get the idea)