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

PF1e Macro formula not resolving

I'm trying to write a macro for a PF1e game using the PC template, and have most of it working.  However part of the attack roll and damage rolls has a formula in place for calculating power attack.    " (1+floor(@{bab}/4))" I know this logic will work when used as a custom buff. However I cannot get it to be calculated via a custom macro. Does anyone know if I'm doing something wrong with this, or if there is a limitation with the template:pc?
1771871339

Edited 1771871360
Gauss
Forum Champion
Hi Josh R.,  Please supply the full macro. Also please supply a screenshot of where you are putting it. 
The macro in question broken up into multiple lines for readability. &{template:pc} {{name=POUNCE}} {{attack= }} {{type=attackdamage}} {{atkvs=Melee Attack vs AC}}  {{rollname=Bite}}  {{roll=[[1d20k1cs>20+@{melee_mod}+@{attack_bonus}-((1+floor(@{bab}/4))*{1,?{Power Attack?|None,0|Power Attack,2|Leap Attack,4}}kl)+5]]}}  {{critconfirm=[[1d20k1cs>20+@{melee_mod}+@{attack_bonus}-((1+floor(@{bab}/4))*{1,?{Power Attack?|None,0|Power Attack,2|Leap Attack,4}}kl)+5]]}}  {{rolldmg1=[[(?{Size?|Large,2d8|Huge,3d6|Gargantuan,3d8}+4d6+floor(@{strength_mod}*.5)+@{damage_bonus}+@{melee_damage_bonus}+((1+floor(@{bab}/4))*?{Power Attack?|None,0|Power Attack,2|Leap Attack,4})+5)*?{Battle Leap?|No,1|Yes,2}]]}}  {{rolldmg1crit=[[((?{Size?|Large,2d8|Huge,3d6|Gargantuan,3d8}+4d6+floor(@{strength_mod}*.5)+@{damage_bonus}+@{melee_damage_bonus}+((1+floor(@{bab}/4))*?{Power Attack?|None,0|Power Attack,2|Leap Attack,4})+5)*?{Battle Leap?|No,1|Yes,2})*2]]}}  {{rolldmg1type=Bite}}  {{roll1name=Claw1}}  {{roll1=[[1d20k1cs>20+@{melee_mod}+@{attack_bonus}-((1+floor(@{bab}/4))*{1,?{Power Attack?|None,0|Power Attack,2|Leap Attack,4}}kl)+5]]}}  {{critconfirm1=[[1d20k1cs>20+@{melee_mod}+@{attack_bonus}-((1+floor(@{bab}/4))*{1,?{Power Attack?|None,0|Power Attack,2|Leap Attack,4}}kl)+5]]}}  {{roll1dmg1=[[(?{Size?|Large,2d6|Huge,3d6|Gargantuan,4d6}+4d6+@{strength_mod}+@{damage_bonus}+@{melee_damage_bonus}+((1+floor(@{bab}/4))*?{Power Attack?|None,0|Power Attack,2|Leap Attack,4})+5)*?{Battle Leap?|No,1|Yes,2}]]}}  {{roll1dmg1crit=[[((?{Size?|Large,2d6|Huge,3d6|Gargantuan,4d6}+4d6+@{strength_mod}+@{damage_bonus}+@{melee_damage_bonus}+((1+floor(@{bab}/4))*?{Power Attack?|None,0|Power Attack,2|Leap Attack,4})+5)*?{Battle Leap?|No,1|Yes,2})*2]]}}  {{roll1dmg1type=Claw,Improved Grab}}  {{roll2name=Claw2}}  {{roll2=[[1d20k1cs>20+@{melee_mod}+@{attack_bonus}-((1+floor(@{bab}/4))*{1,?{Power Attack?|None,0|Power Attack,2|Leap Attack,4}}kl)+5]]}}  {{critconfirm2=[[1d20k1cs>20+@{melee_mod}+@{attack_bonus}-((1+floor(@{bab}/4))*{1,?{Power Attack?|None,0|Power Attack,2|Leap Attack,4}}kl)+5]]}}  {{roll2dmg1=[[(?{Size?|Large,2d6|Huge,3d6|Gargantuan,4d6}+4d6+@{strength_mod}+@{damage_bonus}+@{melee_damage_bonus}+((1+floor(@{bab}/4))*?{Power Attack?|None,0|Power Attack,2|Leap Attack,4})+5)*?{Battle Leap?|No,1|Yes,2}]]}}  {{roll2dmg1crit=[[((?{Size?|Large,2d6|Huge,3d6|Gargantuan,4d6}+4d6+@{strength_mod}+@{damage_bonus}+@{melee_damage_bonus}+((1+floor(@{bab}/4))*?{Power Attack?|None,0|Power Attack,2|Leap Attack,4})+5)*?{Battle Leap?|No,1|Yes,2})*2]]}}  {{roll2dmg1type=Claw,Improved Grab}}  {{roll3name=Rake1}}  {{roll3=[[1d20k1cs>20+@{melee_mod}+@{attack_bonus}-((1+floor(@{bab}/4))*{1,?{Power Attack?|None,0|Power Attack,2|Leap Attack,4}}kl)+5]]}}  {{critconfirm3=[[1d20k1cs>20+@{melee_mod}+@{attack_bonus}-((1+floor(@{bab}/4))*{1,?{Power Attack?|None,0|Power Attack,2|Leap Attack,4}}kl)+5]]}}  {{roll3dmg1=[[(?{Size?|Large,2d6|Huge,3d6|Gargantuan,4d6}+4d6+@{strength_mod}+@{damage_bonus}+@{melee_damage_bonus}+((1+floor(@{bab}/4))*?{Power Attack?|None,0|Power Attack,2|Leap Attack,4})+5)*?{Battle Leap?|No,1|Yes,2}]]}}  {{roll3dmg1crit=[[((?{Size?|Large,2d6|Huge,3d6|Gargantuan,4d6}+4d6+@{strength_mod}+@{damage_bonus}+@{melee_damage_bonus}+((1+floor(@{bab}/4))*?{Power Attack?|None,0|Power Attack,2|Leap Attack,4})+5)*?{Battle Leap?|No,1|Yes,2})*2]]}}  {{roll3dmg1type=Rake}}  {{roll4name=Rake2}}  {{roll4=[[1d20k1cs>20+@{melee_mod}+@{attack_bonus}-((1+floor(@{bab}/4))*{1,?{Power Attack?|None,0|Power Attack,2|Leap Attack,4}}kl)+5]]}}  {{critconfirm4=[[1d20k1cs>20+@{melee_mod}+@{attack_bonus}-((1+floor(@{bab}/4))*{1,?{Power Attack?|None,0|Power Attack,2|Leap Attack,4}}kl)+5]]}}  {{roll4dmg1=[[(?{Size?|Large,2d6|Huge,3d6|Gargantuan,4d6}+4d6+@{strength_mod}+@{damage_bonus}+@{melee_damage_bonus}+((1+floor(@{bab}/4))*?{Power Attack?|None,0|Power Attack,2|Leap Attack,4})+5)*?{Battle Leap?|No,1|Yes,2}]]}}  {{roll4dmg1crit=[[((?{Size?|Large,2d6|Huge,3d6|Gargantuan,4d6}+4d6+@{strength_mod}+@{damage_bonus}+@{melee_damage_bonus}+((1+floor(@{bab}/4))*?{Power Attack?|None,0|Power Attack,2|Leap Attack,4})+5)*?{Battle Leap?|No,1|Yes,2})*2]]}}  {{roll4dmg1type=Rake}}  {{roll5name=Haste}}  {{roll5=[[1d20k1cs>20+@{melee_mod}+@{attack_bonus}-((1+floor(@{bab}/4))*{1,?{Power Attack?|None,0|Power Attack,2|Leap Attack,4}}kl)+5]]}}  {{critconfirm5=[[1d20k1cs>20+@{melee_mod}+@{attack_bonus}-((1+floor(@{bab}/4))*{1,?{Power Attack?|None,0|Power Attack,2|Leap Attack,4}}kl)+5]]}}  {{roll5dmg1=[[(?{Size?|Large,2d6|Huge,3d6|Gargantuan,4d6}+4d6+@{strength_mod}+@{damage_bonus}+@{melee_damage_bonus}+((1+floor(@{bab}/4))*?{Power Attack?|None,0|Power Attack,2|Leap Attack,4})+5)*?{Battle Leap?|No,1|Yes,2}]]}}  {{roll5dmg1crit=[[((?{Size?|Large,2d6|Huge,3d6|Gargantuan,4d6}+4d6+@{strength_mod}+@{damage_bonus}+@{melee_damage_bonus}+((1+floor(@{bab}/4))*?{Power Attack?|None,0|Power Attack,2|Leap Attack,4})+5)*?{Battle Leap?|No,1|Yes,2})*2]]}}  {{roll5dmg1type=Haste}}
Screenshot of Attributes and Abilities where I am keeping the macro and running it from.
1771876706
timmaugh
Roll20 Production Team
API Scripter
I think it's actually this bit that's causing your issue: {1,?{Power Attack?|None,0|Power Attack,2|Leap Attack,4}}kl This needs to be wrapped in inline roll brackets... but in that case, then "kl" needs to become a "kl1"... otherwise nothing will happen. So the above should be: [[{1,?{Power Attack?|None,0|Power Attack,2|Leap Attack,4}}kl1]] Everywhere you are utilizing that math of multiplying by this value... ...buuuuuuuuuuuuuuuut... I'm not sure why you're doing things this way and not just changing your "None" value to be a "1"? That should alleviate the "keep low" mechanic altogether.
"This needs to be wrapped in inline roll brackets... but in that case, then "kl" needs to become a "kl1"... otherwise nothing will happen. So the above should be:" That's exactly what I was missing.   Thank you Timmaugh. "...buuuuuuuuuuuuuuuut... I'm not sure why you're doing things this way and not just changing your "None" value to be a "1"? That should alleviate the "keep low" mechanic altogether." To try to defend my madness, in an effort to understand the system better I am attempting to write a macro that will handle three different states of power attack, and in that roll#= field I need the variable to 1 or 0.  In case you are not familiar with Pathfinder 1e power attack, its an ability where you lose some "to hit" to gain some damage.   The complication comes from with leap attack, you take the same to hit penalty but the do more damage.   Its an attempt to have one choice calculate the three states, where x = 1+floor(@{bab}/4 State 1 - No power attack -0 to attack roll +0 to damage roll State 2- Power attack -x to attack roll +2x to damage roll State 3 - Leap Attack -x to attack roll +4x to damage roll I hope that makes sense, I'm not a coder and not very familiar with the vernacular.  
1771882604
timmaugh
Roll20 Production Team
API Scripter
Oh, no... you're right. I was misreading the way those numbers would work. You're absolutely correct. Carry on. =D
1771901932
Gauss
Forum Champion
Josh R.,  Just making sure, timmaugh has answered your question and there is no further issue?
Correct, Timmaugh took care of my issue.  Thanks again for the assistance.