For example, my favored enemy bonus applies to both an attack and damage. So I use the following in the macro for the attack bonus:
[[ ?{Favored Enemy?|None,0|Giant,@{customa1-mod}|Goblin,@{customa2-mod}|Monstrous Humanoid,@{customa3-mod}} ]]
Then I use the following in the damage macro:
[[ ?{Favored Enemy?} ]]
The second time you reference that query, it uses the value that was calculated from the first time the query was called during that "roll".
So where it gets tricky is when you want to use one query, but you want to apply a different value for the attack vs. damage. To do that, you need to separate the query value from the values you want, then do a little bit of math. So for example, if the target is within 30 feet, I want to add +1 to my attack for Point Blank Shot, but I also want to add +4 to my damage roll for Intuitive Shot. To do that, I set the following in the macros:
Attack: [[ ?{Target within 30 ft?|No,0|Yes,1} ]]
Damage: [[ ?{Target within 30 ft?}*4 ]]
So the first time the query is called from the Attack macro, if I answer Yes, it sets the value of that query to 1, which it then uses directly in the attack macro. But in the damage macro, it takes that value of 1 and multiplies it by 4.
If you want to add something like variable sneak attack damage if you're flanking, then you should be able to do something like the following, which is what I use for adding the Bane attack and damage bonuses:
Attack: [[ ?{Bane?|No,0|Yes,2} ]]
Damage: [[ ?{Bane?} + ?{Bane?}d6 ]]
So if you answer Yes, it will add +2 to the attack roll, and 2 + 2d6 to the damage roll.
That's certainly helpful to minimize the number of prompts you need to display to the users. If the query is really a binary Yes/No or On/Off situation, you may just want the query to return 1 or 0, then do math in the appropriate places to get the correct bonuses to apply. Unfortunately, I couldn't get that to work quite correctly for the Rapid Shot modification to the iterative attack macros, since I needed the query in that instance to return other code if the query response was Yes, so having it return 1 or 0 wouldn't work.Statistics: Posted by Tahlvin — Wed Sep 20, 2017 8:56 am
]]>