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

[D&D 3.5] Tinkering with attack macro for archery feats (Manyshot / Rapid Shot / Point Blank Shot), could use some help

Hey everyone, I've been working on the attack roll macro's included with the 3.5 character sheet by Diana P., trying to incorporate the Manyshot and Rapid Shot feats. I had it working for a minute, and then I changed something, and now it's not working anymore and I don't know what's going wrong. Maybe someone here can help? Here's what I have so far: @{weapon1attackcalc} looks like: 1d20cs>@{weapon1critmin} +@{bab}[BAB] +@{epicattackbonus}[Epic AB] + @{weapon1stat}[Ability] +@{size}[size] +@{weapon1enh}[Weapon Enh] +@{weapon1focus}[Weapon Focus] + ?{Within 30 ft?|Yes, 1|No, 0}[PBS] + ?{Long Shot|<100 ft, 0|100 - 200 ft, -2|200 - 300 ft, -4|300 - 400 ft, -6|400 - 500 ft, -8|500 - 600 ft, -10|600 - 700 ft, -12|700 - 800 ft, -14|800 - 900 ft, -16|900 - 1000 ft, -18}[Long Shot] +?{Manyshot|No, 0|1 Extra Arrow, 1|2 Extra Arrows, 2|3 Extra Arrows, 3}*0 - ( [[ ( 1 - ( floor( ( 0 - ?{Manyshot} ) / ( abs( 0 - ?{Manyshot} ) + 0.5 ) ) + 1 ) ) ]] * [[ ?{Manyshot}*2 + 2 ]] ) + ?{Additional Attack Bonus?|0}[Ad'l Atk Bon] Notes: I took out the Flanking and Power Attack parts, because they're never relevant for ranged weapons, and I've added promts for range increments, Point Blank Shot and Manyshot. Range increments and Point Blank Shot are pretty straightforward, Manyshot is more complex: a drop down prompt asks for the number of extra arrows, and assigns a value of 0, 1, 2 or 3 to the Roll Query ?{Manyshot}. Then I use this bit of trickery to check if ?{Manyshot} >= 1. [[ ( 1 - ( floor( ( 0 - ?{Manyshot} ) / ( abs( 0 - ?{Manyshot} ) + 0.5 ) ) + 1 ) ) ]] This function returns 1 if ?{Manyshot} is 1 or more, and 0 if it's less than 1. If Manyshot was used, the appropriate modifier is applied to the attack roll. @{weapon1attackmacro} looks like: &{template:DnD35Attack} {{pcflag=true}} {{name=@{character_name}}} {{subtags=attacks with a @{weapon1name} }} {{attack1=hitting AC [[ @{weapon1attackcalc} ]] }} {{critconfirm1=Crit?: [[ @{weapon1attackcalc} ]] }} {{damage1=for [[ @{weapon1damage} ]]dmg}} {{critdmg1=+ [[ @{weapon1crit} ]] crit dmg}} {{fullattackflag= [[ 0d1 ]] }} This parses everything correctly. @{weapon1fullattack} is where I got stuck. This is what I have now: &{template:DnD35Attack} {{pcflag=true}} {{name=@{character_name}}} {{subtags=attacks with a @{weapon1name} }} {{attack1=A1: [[ @{weapon1attackcalc} -2*?{Rapid Shot|No, 0|Yes, 1} ]] }} {{critconfirm1=Crit?: [[ @{weapon1attackcalc} ]] }} {{damage1=D1: [[ @{weapon1damage} ]] }} {{critdmg1=+ [[ @{weapon1crit} ]] }} {{fullattackflag= [[ ?{Full Attack?|No, 0d1|Yes, d1} ]] }} {{attack2=A2: [[ @{weapon1attackcalc}-5 -2*?{Rapid Shot} ]] }} {{critconfirm2=Crit!: [[ @{weapon1attackcalc}-5 -2*?{Rapid Shot} ]] }} {{damage2=D2: [[ @{weapon1damage} ]] }} {{critdmg2=+ [[ @{weapon1crit} ]] }} {{attack3=A3: [[ @{weapon1attackcalc}-10 -2*?{Rapid Shot} ]] }} {{critconfirm3=Crit!: [[ @{weapon1attackcalc}-10 -2*?{Rapid Shot} ]] }} {{damage3=D3: [[ @{weapon1damage} ]] }} {{critdmg3=+ [[ @{weapon1crit} ]] }} {{attack4=A4: [[ @{weapon1attackcalc}-15 -2*?{Rapid Shot} ]] }} {{critconfirm4=Crit!: [[ @{weapon1attackcalc}-15 -2*?{Rapid Shot} ]] }} {{damage4=D4: [[ @{weapon1damage} ]] }} {{critdmg4=+ [[ @{weapon1crit} ]] }} {{attack5=RS: [[ ?{Rapid Shot}*(@{weapon1attackcalc} -2*?{Rapid Shot}) ]] }} {{critconfirm5=Crit?: [[ ?{Rapid Shot}*(@{weapon1attackcalc} -2*?{Rapid Shot}) ]] }} {{damage5=DRS: [[ ?{Rapid Shot}*@{weapon1damage} ]] }} {{critdmg5=+ [[ ?{Rapid Shot}*@{weapon1crit} ]] }} I added a prompt to ask if the attack uses Rapid Shot. I added a fifth attack where all variables are multiplied by 0 if Rapid Shot isn't used, and if Rapid Shot is used, all the attack rolls are modified appropriately. However, something is wrong and the macro doesn't give an output. I had the macro working earlier, so I know it's possible, but I changed something without an appropriate backup, and I can't reconstruct what I had done earlier. Anyone have any idea what I'm doing wrong? Thanks for your help!
Well, after a couple of hours of trial and error I am still unable to reproduce my working script. I did clean up the code to make the underlying structure easier to see. Maybe someone spots something in there that I've been missing. @{CHARNAME|weapon1fullattackmacro} &{template:DnD35Attack}     {{pcflag=true}}     {{name=@{character_name} }}     {{subtags=attacks with a @{weapon1name} }}         {{attack1=A1: [[@{weapon1attackcalc}-2*?{Rapid Shot|No, 0|Yes, 1} ]] }}         {{critconfirm1=Crit?: [[@{weapon1attackcalc} ]] }}             {{damage1=D1: [[@{weapon1damage} ]] }}             {{critdmg1=+ [[@{weapon1crit} ]] }}     {{fullattackflag= [[?{Full Attack?|No, 0d1|Yes, d1} ]] }}         {{attack2=A2: [[@{weapon1attackcalc}-5-2*?{Rapid Shot} ]] }}         {{critconfirm2=Crit!: [[@{weapon1attackcalc}-5-2*?{Rapid Shot} ]] }}             {{damage2=D2: [[@{weapon1damage} ]] }}             {{critdmg2=+ [[@{weapon1crit} ]] }}         {{attack3=A3: [[@{weapon1attackcalc}-10-2*?{Rapid Shot} ]] }}         {{critconfirm3=Crit!: [[@{weapon1attackcalc}-10-2*?{Rapid Shot} ]] }}             {{damage3=D3: [[@{weapon1damage} ]] }}             {{critdmg3=+ [[@{weapon1crit} ]] }}         {{attack4=A4: [[@{weapon1attackcalc}-15-2*?{Rapid Shot} ]] }}         {{critconfirm4=Crit!: [[@{weapon1attackcalc}-15-2*?{Rapid Shot} ]] }}             {{damage4=D4: [[@{weapon1damage} ]] }}             {{critdmg4=+ [[@{weapon1crit} ]] }}         {{attack5=RS: [[?{Rapid Shot}*(@{weapon1attackcalc}-2*?{Rapid Shot}) ]] }}         {{critconfirm5=Crit?: [[?{Rapid Shot}*(@{weapon1attackcalc}-2*?{Rapid Shot}) ]] }}             {{damage5=DRS: [[?{Rapid Shot}*@{weapon1damage} ]] }}             {{critdmg5=+ [[?{Rapid Shot}*@{weapon1crit} ]] }} @{CHARNAME|weapon1attackmacro} &{template:DnD35Attack}     {{pcflag=true}}     {{name=@{character_name} }}     {{subtags=attacks with a @{weapon1name} }}         {{attack1=hitting AC [[@{weapon1attackcalc} ]] }}         {{critconfirm1=Crit?: [[@{weapon1attackcalc} ]] }}             {{damage1=for [[@{weapon1damage} ]]dmg}}             {{critdmg1=+ [[@{weapon1crit} ]]crit dmg}}     {{fullattackflag= [[ 0d1 ]] }} @{CHARNAME|weapon1attackcalc} 1d20cs>@{weapon1critmin}     +@{bab}[BAB]     +@{epicattackbonus}[Epic AB]     +@{weapon1stat}[Ability]     +@{size}[size]     +@{weapon1enh}[Weapon Enh]     +@{weapon1focus}[Weapon Focus]     +?{Within 30 ft?|No, 0|Yes, 1}[PBS]     +?{Long Shot|<100 ft, 0|100 - 200 ft, -2|200 - 300 ft, -4|300 - 400 ft, -6|400 - 500 ft, -8|500 - 600 ft, -10|600 - 700 ft, -12|700 - 800 ft, -14|800 - 900 ft, -16|900 - 1000 ft, -18}[Long Shot]     +?{Manyshot|No, 0|1 Extra Arrow, 1|2 Extra Arrows, 2|3 Extra Arrows, 3}*0     -[[ 1 - ( floor( ( 0 - ?{Manyshot} ) / ( abs( 0 - ?{Manyshot} ) + 0.5 ) ) + 1 ) ]] * [[ ?{Manyshot}*2 + 2 ]] )     +?{Additional Attack Bonus?|0}[Ad'l Atk Bon] @{CHARNAME|weapon1damage} 1d8     +@{weapon1damagestat}[Weapon Dmg Ability]     +@{weapon1enh}[Weapon Enh]     +?{Manyshot}d8     +?{Manyshot} * [[@{weapon1damagestat}     +@{weapon1enh} ]]     +?{Additional Damage Bonus?|0}[Ad'l Dmg Bon] @{CHARNAME|weapon1crit} 1d8     +@{weapon1damagestat}[Weapon Dmg Ability]     +@{weapon1enh}[Weapon Enh]     +?{Additional Damage Bonus?|0}[Ad'l Dmg Bon]