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

3.5 Character Sheet Macros

So I was going through the macros and decided I wanted to have one of my characters quarterstaffs to pop up with the option of if they wanted to use the attack as an offhand. In my head it'd roll the standard attack if they select no, and roll the double attack if they select yes with the negative modifiers for their rolls already done. So I figured I'd toss it into the weapon1attackmacro and came up with the following- ?{Offhand attack?|No, {{attack1=A1: [[@{weapon1attackcalc}]]}}|Yes, {{attack1=A1: [[@{weapon1attackcalc}-4]]}} {{attack1=A2: [[@{weapon1attackcalc}-8]]}} } Needless to say it didn't work out too well. Any input on how I can achieve this goal, or am I completely misunderstanding all of it?
1586023158

Edited 1586023292
Ziechael
Forum Champion
Sheet Author
API Scripter
You are running into the html replacement issue for nesting 'problematic' characters in a query, namely '}', ',' and '|' (end curly brace, commas and pipes). Try this out: ?{Offhand attack?|No, {{attack1=A1: [[@{weapon1attackcalc}]]|Yes, {{attack1=A1: [[@{weapon1attackcalc}-4]]}} {{attack1=A2: [[@{weapon1attackcalc}-8]] }}} Edit: just realised that won't likely work out too well because @{weaponattackcalc} calls other problematic characters which will break the macro... you might need to write out a complete and bespoke macro with your functionality in it. Give it a go and see how you get on with the knowledge gleaned from the wiki .
Ziechael said: Thanks for the reply! I tried inputting the changes you offered and it did spit out the same kind of issue I had. While going through the questions one of them would say "Flank (1=yes)*2[Flank]+?{Additional Attack Bonus?:" which was the same result I've been getting myself. So should I put that offhand attack query into the weapon calc instead and that would solve my issue, or is the problem I'm having just a simple ID:10-t  error?
1586077220
Ziechael
Forum Champion
Sheet Author
API Scripter
So the issue you are getting is that the attack, full attack and damage macros (yellow, or maybe green I'm colour blind) call the red/pink ones as part of their operation. Your options would be to make html changes to the red/pink ones to cater to the query (which would break them for normal operation) or to write a bespoke macro to set as a character ability: Here is what the full attack macro looks like when fully expanded: &{template:DnD35Attack} {{pcflag=true}} {{name=@{character_name}}} {{subtags=attacks with a @{weapon1name} }} {{attack1=A1: [[ 1d20cs>@{weapon1critmin} +@{bab}[BAB] +@{epicattackbonus}[Epic AB] + @{weapon1stat}[Ability] +@{size}[size] +@{weapon1enh}[Weapon Enh] +@{weapon1focus}[Weapon Focus] + ?{Flank (1=yes)|0}*2[Flank] +?{Power Attack? (put in penalty with negative sign ie -3)|0}[Pwr Attk] +?{Additional Attack Bonus?|0}[Ad'l Atk Bon]  ]] }} {{critconfirm1=Crit?: [[ 1d20cs>@{weapon1critmin} +@{bab}[BAB] +@{epicattackbonus}[Epic AB] + @{weapon1stat}[Ability] +@{size}[size] +@{weapon1enh}[Weapon Enh] +@{weapon1focus}[Weapon Focus] + ?{Flank (1=yes)|0}*2[Flank] +?{Power Attack? (put in penalty with negative sign ie -3)|0}[Pwr Attk] +?{Additional Attack Bonus?|0}[Ad'l Atk Bon]  ]] }} {{fumbleroll=Fumble: [[ d20 ]] }} {{damage1=D1: [[ 1d6 + @{weapon1damagestat}[Weapon Dmg Ability] +@{weapon1enh}[Weapon Enh] +@{weapon1specialize}[Weapon Spec] +?{Power Attack Bonus?|0}[Pwr Attk] +?{Additional Damage Bonus?|0}[Ad'l Dmg Bon] ]] }} {{critdmg1=+ [[  [[ (@{weapon1critmult}-1) ]]d6 + [[ (@{weapon1critmult}-1) ]] *( @{weapon1damagestat}[Weapon Dmg Ability] +@{weapon1enh}[Weapon Enh] +@{weapon1specialize}[Weapon Spec] +?{Power Attack Bonus?|0}[Pwr Attk] +?{Additional Damage Bonus?|0}[Ad'l Dmg Bon])  ]] }} {{fullattackflag= [[ ?{Full Attack?|No, 0d1|Yes, d1} ]] }} {{attack2=A2: [[ 1d20cs>@{weapon1critmin} +@{bab}[BAB] +@{epicattackbonus}[Epic AB] + @{weapon1stat}[Ability] +@{size}[size] +@{weapon1enh}[Weapon Enh] +@{weapon1focus}[Weapon Focus] + ?{Flank (1=yes)|0}*2[Flank] +?{Power Attack? (put in penalty with negative sign ie -3)|0}[Pwr Attk] +?{Additional Attack Bonus?|0}[Ad'l Atk Bon] -5 ]] }} {{critconfirm2=Crit!: [[ 1d20cs>@{weapon1critmin} +@{bab}[BAB] +@{epicattackbonus}[Epic AB] + @{weapon1stat}[Ability] +@{size}[size] +@{weapon1enh}[Weapon Enh] +@{weapon1focus}[Weapon Focus] + ?{Flank (1=yes)|0}*2[Flank] +?{Power Attack? (put in penalty with negative sign ie -3)|0}[Pwr Attk] +?{Additional Attack Bonus?|0}[Ad'l Atk Bon] -5 ]] }} {{damage2=D2: [[ 1d6 + @{weapon1damagestat}[Weapon Dmg Ability] +@{weapon1enh}[Weapon Enh] +@{weapon1specialize}[Weapon Spec] +?{Power Attack Bonus?|0}[Pwr Attk] +?{Additional Damage Bonus?|0}[Ad'l Dmg Bon] ]] }} {{critdmg2=+ [[  [[ (@{weapon1critmult}-1) ]]d6 + [[ (@{weapon1critmult}-1) ]] *( @{weapon1damagestat}[Weapon Dmg Ability] +@{weapon1enh}[Weapon Enh] +@{weapon1specialize}[Weapon Spec] +?{Power Attack Bonus?|0}[Pwr Attk] +?{Additional Damage Bonus?|0}[Ad'l Dmg Bon])  ]] }} {{attack3=A3: [[ 1d20cs>@{weapon1critmin} +@{bab}[BAB] +@{epicattackbonus}[Epic AB] + @{weapon1stat}[Ability] +@{size}[size] +@{weapon1enh}[Weapon Enh] +@{weapon1focus}[Weapon Focus] + ?{Flank (1=yes)|0}*2[Flank] +?{Power Attack? (put in penalty with negative sign ie -3)|0}[Pwr Attk] +?{Additional Attack Bonus?|0}[Ad'l Atk Bon] -10 ]] }} {{critconfirm3=Crit!: [[ 1d20cs>@{weapon1critmin} +@{bab}[BAB] +@{epicattackbonus}[Epic AB] + @{weapon1stat}[Ability] +@{size}[size] +@{weapon1enh}[Weapon Enh] +@{weapon1focus}[Weapon Focus] + ?{Flank (1=yes)|0}*2[Flank] +?{Power Attack? (put in penalty with negative sign ie -3)|0}[Pwr Attk] +?{Additional Attack Bonus?|0}[Ad'l Atk Bon] -10 ]] }} {{damage3=D3: [[ 1d6 + @{weapon1damagestat}[Weapon Dmg Ability] +@{weapon1enh}[Weapon Enh] +@{weapon1specialize}[Weapon Spec] +?{Power Attack Bonus?|0}[Pwr Attk] +?{Additional Damage Bonus?|0}[Ad'l Dmg Bon] ]] }} {{critdmg3=+ [[  [[ (@{weapon1critmult}-1) ]]d6 + [[ (@{weapon1critmult}-1) ]] *( @{weapon1damagestat}[Weapon Dmg Ability] +@{weapon1enh}[Weapon Enh] +@{weapon1specialize}[Weapon Spec] +?{Power Attack Bonus?|0}[Pwr Attk] +?{Additional Damage Bonus?|0}[Ad'l Dmg Bon])  ]] }} {{attack4=A4: [[ 1d20cs>@{weapon1critmin} +@{bab}[BAB] +@{epicattackbonus}[Epic AB] + @{weapon1stat}[Ability] +@{size}[size] +@{weapon1enh}[Weapon Enh] +@{weapon1focus}[Weapon Focus] + ?{Flank (1=yes)|0}*2[Flank] +?{Power Attack? (put in penalty with negative sign ie -3)|0}[Pwr Attk] +?{Additional Attack Bonus?|0}[Ad'l Atk Bon] -15 ]] }} {{critconfirm4=Crit!: [[ 1d20cs>@{weapon1critmin} +@{bab}[BAB] +@{epicattackbonus}[Epic AB] + @{weapon1stat}[Ability] +@{size}[size] +@{weapon1enh}[Weapon Enh] +@{weapon1focus}[Weapon Focus] + ?{Flank (1=yes)|0}*2[Flank] +?{Power Attack? (put in penalty with negative sign ie -3)|0}[Pwr Attk] +?{Additional Attack Bonus?|0}[Ad'l Atk Bon] -15 ]] }} {{damage4=D4: [[ 1d6 + @{weapon1damagestat}[Weapon Dmg Ability] +@{weapon1enh}[Weapon Enh] +@{weapon1specialize}[Weapon Spec] +?{Power Attack Bonus?|0}[Pwr Attk] +?{Additional Damage Bonus?|0}[Ad'l Dmg Bon] ]] }} {{critdmg4=+ [[  [[ (@{weapon1critmult}-1) ]]d6 + [[ (@{weapon1critmult}-1) ]] *( @{weapon1damagestat}[Weapon Dmg Ability] +@{weapon1enh}[Weapon Enh] +@{weapon1specialize}[Weapon Spec] +?{Power Attack Bonus?|0}[Pwr Attk] +?{Additional Damage Bonus?|0}[Ad'l Dmg Bon])  ]] }} So to create a bespoke one, you could just create a shorter version of that and add in the offhand modifiers and save it as a separate ability on your sheet. Then you can use the normal attack for normal attacks and the offhand macro for offhand attacks without having to mess about with html nested queries and the headaches they provide: &{template:DnD35Attack} {{pcflag=true}} {{name=@{character_name}}} {{subtags=attacks with a @{weapon1name} }} {{attack1=Main: [[ 1d20cs>@{weapon1critmin} +@{bab}[BAB] +@{epicattackbonus}[Epic AB] + @{weapon1stat}[Ability] +@{size}[size] +@{weapon1enh}[Weapon Enh] +@{weapon1focus}[Weapon Focus] + ?{Flank (1=yes)|0}*2[Flank] +?{Power Attack? (put in penalty with negative sign ie -3)|0}[Pwr Attk] +?{Additional Attack Bonus?|0}[Ad'l  Atk Bon]-4 ]] }} {{critconfirm1=Crit?: [[ 1d20cs>@{weapon1critmin} +@{bab}[BAB] +@{epicattackbonus}[Epic AB] + @{weapon1stat}[Ability] +@{size}[size] +@{weapon1enh}[Weapon Enh] +@{weapon1focus}[Weapon Focus] + ?{Flank (1=yes)|0}*2[Flank] +?{Power Attack? (put in penalty with negative sign ie -3)|0}[Pwr Attk] +?{Additional Attack Bonus?|0}[Ad'l  Atk Bon]-4 ]] }} {{fumbleroll=Fumble: [[ d20 ]] }} {{damage1=D1: [[ 1d6 + @{weapon1damagestat}[Weapon Dmg Ability] +@{weapon1enh}[Weapon Enh] +@{weapon1specialize}[Weapon Spec] +?{Power Attack Bonus?|0}[Pwr Attk] +?{Additional Damage Bonus?|0}[Ad'l Dmg Bon] ]] }} {{critdmg1=+ [[ [[ (@{weapon1critmult}-1) ]]d6 + [[ (@{weapon1critmult}-1) ]] *( @{weapon1damagestat}[Weapon Dmg Ability] +@{weapon1enh}[Weapon Enh] +@{weapon1specialize}[Weapon Spec] +?{Power Attack Bonus?|0}[Pwr Attk] +?{Additional Damage Bonus?|0}[Ad'l Dmg Bon]) ]] }} {{fullattackflag= [[ d1 ]] }} {{attack2=Offhand: [[ 1d20cs>@{weapon1critmin} +@{bab}[BAB] +@{epicattackbonus}[Epic AB] + @{weapon1stat}[Ability] +@{size}[size] +@{weapon1enh}[Weapon Enh] +@{weapon1focus}[Weapon Focus] + ?{Flank (1=yes)|0}*2[Flank] +?{Power Attack? (put in penalty with negative sign ie -3)|0}[Pwr Attk] +?{Additional Attack Bonus?|0}[Ad'l  Atk Bon]-8 ]] }} {{critconfirm2=Crit!: [[ 1d20cs>@{weapon1critmin} +@{bab}[BAB] +@{epicattackbonus}[Epic AB] + @{weapon1stat}[Ability] +@{size}[size] +@{weapon1enh}[Weapon Enh] +@{weapon1focus}[Weapon Focus] + ?{Flank (1=yes)|0}*2[Flank] +?{Power Attack? (put in penalty with negative sign ie -3)|0}[Pwr Attk] +?{Additional Attack Bonus?|0}[Ad'l  Atk Bon]-8 ]] }} {{damage2=D2: [[ 1d6 + @{weapon1damagestat}[Weapon Dmg Ability] +@{weapon1enh}[Weapon Enh] +@{weapon1specialize}[Weapon Spec] +?{Power Attack Bonus?|0}[Pwr Attk] +?{Additional Damage Bonus?|0}[Ad'l Dmg Bon] ]] }} {{critdmg2=+ [[ [[ (@{weapon1critmult}-1) ]]d6 + [[ (@{weapon1critmult}-1) ]] *( @{weapon1damagestat}[Weapon Dmg Ability] +@{weapon1enh}[Weapon Enh] +@{weapon1specialize}[Weapon Spec] +?{Power Attack Bonus?|0}[Pwr Attk] +?{Additional Damage Bonus?|0}[Ad'l Dmg Bon]) ]] }} There will likely be some details in there you'd change, such as the number/type of queries or the damage die used etc.
Ziechael said: I had a feeling it would come to that. Just damn... Was hoping it wouldn't. Oh well, thanks for all the help my dude!