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

Help with Chat Box Macros - am I in over my head

Hi Guys, I've hit a brick wall in trying to make Chat Box macro and nothing I do seems to work... I've a player in my PF1E game who's a Paladin and they switch between one-handed and two-handed attacks fairly often so I've made two macros for these two attacks, within these macros I've also included drop down queries for Smite-Evil so that it adds the appropriate to hit modifier and damage modifier.  1H Power &{template:pc} {{showchar=[[1]]}}{{attack=Yes}}{{charname=@{character_name}}}{{name=Ominous Battle axe}}{{type=attack}} {{atkvs=1h Melee vs AC}}{{roll=[[1d20+@{bab}[BAB]+@{strength_mod}[Str]+@{repeating_attacks_$2_atkmod}[Mod]-[[(1+floor(@{bab}/4))]][Power Attack]+?{Smite Evil?:|Yes, @{charisma_mod}|No, 0}[Smite Evil]]]}}{{critconfirm=[[1d20+@{bab}[BAB]+@{strength_mod}[Str]+@{repeating_attacks_$2_atkmod}[Mod]-[[(1+floor(@{bab}/4))]][Power Attack]+?{Smite Evil?:|Yes, @{charisma_mod}|No, 0}[Smite Evil]]]}}{{damage=1}}{{dmg1flag=1}}{{dmg1=[[1d8+@{strength_mod}[Str]+@{repeating_attacks_$2_dmgmod}[Damage Mod]+[[(1+floor(@{bab}/4))*2]][Power Attack]+?{Smite Evil to Damage?:|Yes - First Attack vs Evil Outsider;Dragon or Undead, [[@{class1_level}*2]]|Yes, @{class1_level}|No, 0}[Smite Evil] ]]}} {{dmg1type=slashing}}{{dmg1crit=[[(3d8)+@{strength_mod}[Str]+@{repeating_attacks_$2_dmgmod}[Damage Mod]+[[(1+floor(@{bab}/4))*2]][Power Attack]+?{Smite Evil to Damage?:|Yes - First Attack vs Evil Outsider;Dragon or Undead, [[@{class1_level}*2]]|Yes, @{class1_level}|No, 0} [Smite Evil])*3]]}} {{shownotes=[[1]]}}{{notes=@{repeating_attacks_$2_notes}}} 2H Power Attack: &{template:pc} {{showchar=[[1]]}}{{attack=Yes}}{{charname=@{character_name}}}{{name=Ominous Battle axe}}{{type=attack}} {{atkvs=2h Melee vs AC}}{{roll=[[1d20+@{bab}[BAB]+@{strength_mod}[Str]+@{repeating_attacks_$2_atkmod}[Mod]-[[(1+floor(@{bab}/4))]][Power Attack]+?{Smite Evil?:|Yes, @{charisma_mod}|No, 0}[Smite Evil]]]}}{{critconfirm=[[1d20+@{bab}[BAB]+@{strength_mod}[Str]+@{repeating_attacks_$2_atkmod}[Mod]-[[(1+floor(@{bab}/4))]][Power Attack]+?{Smite Evil?:|Yes, @{charisma_mod}|No, 0}[Smite Evil]]]}}{{damage=1}}{{dmg1flag=1}}{{dmg1=[[1d8+[[floor(@{strength_mod}*1.5)]][Str]+@{repeating_attacks_$2_dmgmod}[Damage Mod]+[[(1+floor(@{bab}/4))*3]][Power Attack]+?{Smite Evil to Damage?:|Yes - First Attack vs Evil Outsider;Dragon or Undead, [[@{class1_level}*2]]|Yes, @{class1_level}|No, 0}[Smite Evil] ]]}} {{dmg1type=slashing}}{{dmg1crit=[[(3d8)+([[floor(@{strength_mod}*1.5)]][Str]+@{repeating_attacks_$2_dmgmod}[Damage Mod]+[[(1+floor(@{bab}/4))*3]][Power Attack]+?{Smite Evil to Damage?:|Yes - First Attack vs Evil Outsider;Dragon or Undead, [[@{class1_level}*2]]|Yes, @{class1_level}|No, 0} [Smite Evil])*3]]}} {{shownotes=[[1]]}}{{notes=@{repeating_attacks_$2_notes}}} These work as I hoped and will fingers crossed be useful to her, however to avoid clogging up the screen I wanted to just have one macro which would then give her the attack macros to choose from. I made the following Template and it creates the buttons however when I click the buttons all it does is come up with " TypeError: Cannot read property 'substring' of undefined" &{template:default}{{name=Power Attacks}}{{[2H](~2H-Power-Attack) [1H](~1H-Power-Attack)}} Where am I going wrong - is there something in the original macro's causing this issue - does it not like drop downs within the nested abilities? Thanks in advance!
1585901100
Ziechael
Forum Champion
Sheet Author
API Scripter
You might need to help the buttons know who to run the macro from: [Label](~<keyword>|<ability name>) As with  Attribute  and  Ability  calls, the  keyword  is your choice of  selected ,  target  or a character_name. You can also use a character_id as a keyword.
Doh - that worked, slightly frustrating it was so obvious!!....Thanks so much
1585915765
Ziechael
Forum Champion
Sheet Author
API Scripter
Most things here are obvious... once you know about them lol. We've al been there so asking for help is always better than hours of banging your head on the desk, trust me ;)