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

[PF] Attack macro with variable number of weapons

Hello!
I've been trying for the last couple of hours to make a macro for my full attack, with no luck. I have to admit I'm not good at macros, I've only done a few before, and this is clearly out of my league.

Here's what I'm trying to do: on my character sheet, I created an Attack for my double-barrelled pistol. It has a total of 4 iterative attacks, two at full BAB and two at BAB-5, due to the double shot I intend to take each time. I'll spare you the build details, but my character can shoot with 5 of those guns at once, twice a round, plus one single full BAB attack (rapid shot). Given that each gun has 2 barrels, it's a total of 22 shots.

Here's the tricky part: given that guns can misfire and break, I'm trying to make it so that I have to insert how many guns I'm using for the attack. From 1 single gun, landing 2+1 attacks (for a total of 5 shots), to 5 guns for the total of 22.

Now for BONUS points: At this moment, all 5 guns are the same, with the same enhancement bonus and the same special property additional damage. This might not be the case in the future, so the macro should not only combine 5 Attacks, but allow me to select which ones (so that if, let's say, Gun2 breaks, I can go with 1-3-4-5, but if Gun4 breaks instead I can go with 1-2-3-5). I'm not even sure if it's possible to make such a thing.

I'm not sure which info you might need, so I'll give you some:
- The gun Attacks on my sheet are called "Gun1", "Gun2", "Gun3", "Gun4", and "Gun5"
- The respective "Row ID for macros" are the following: -l3odvtdptphws0fhgqk | -l3odxbvizsvuf-fy6ie | -l3odynerfy2jgvs70bh | -l3odcmb3bvwiakeakrd | -l3oddpd2h84kekuy7qp

Is there any great person out there willing to help me with this? 
Ok, so I have my 5 macros, one for each gun: #Gun1 #Gun2 #Gun3 #Gun4 and #Gun5.

Each macro follows the same kind of action:
%{Bob|repeating_weapon_$0_attack-roll}
%{Bob|repeating_weapon_$1_attack-roll}
%{Bob|repeating_weapon_$2_attack-roll}
%{Bob|repeating_weapon_$3_attack-roll}
%{Bob|repeating_weapon_$4_attack-roll}

That works fine. Now I tried to put them all in a query asking me for each gun if I want to use it:
[[?{Gun1?|No, 0|Yes, #Gun1}]] + [[?{Gun2?|No, 0|Yes, #Gun2}]] ... and so on.
It's not perfect, because using the drop-down menu + Submit button is even slower than clicking the 5 macros separately (a Yes/No button instead would work better), but it's the only way I could find to do something of the kind.
Obviously it doesn't work at all. It doesn't even give me an output in chat, simply does nothing. Any clue on how to make it work?
January 30 (7 years ago)

Edited January 30 (7 years ago)
vÍnce
Pro
Sheet Author
I would probably just use the "Attacks" chat menu button from the sheet (Buttons section found below conditions/buffs). drag and drop the button to the macro quick bar or call it directly %{Bob|attacks}  Click each shot from the menu as needed.

January 30 (7 years ago)

Edited January 30 (7 years ago)
Mr_Bober,  you currently cannot nest most/any macro calls from the community sheets into a drop-down query because the macros in the sheets use syntax that breaks the drop-down query.

The only way to create a drop-down query for the attacks is to recreate the macro text for each attack and adding the repeating row references to the attribute calls.

Example where "-l2c1lbupx2lnbourauw" is the ID for the attack entry:
&{template:pf_attack} {{color=@{rolltemplate_color}}} {{name=@{repeating_weapon_-l2c1lbupx2lnbourauw_name}}} {{attack=[[ 1d20cs>[[ @{repeating_weapon_-l2c1lbupx2lnbourauw_crit-target} ]] + @{repeating_weapon_-l2c1lbupx2lnbourauw_attack_macro} ]]}} {{damage=[[@{repeating_weapon_-l2c1lbupx2lnbourauw_damage-dice-num}d@{repeating_weapon_-l2c1lbupx2lnbourauw_damage-die} + @{repeating_weapon_-l2c1lbupx2lnbourauw_damage_macro}]]}} {{crit_confirm=[[ 1d20 + @{repeating_weapon_-l2c1lbupx2lnbourauw_attack_macro} + [[ @{repeating_weapon_-l2c1lbupx2lnbourauw_crit_conf_mod} ]] ]]}} {{crit_damage=[[ [[ @{repeating_weapon_-l2c1lbupx2lnbourauw_damage-dice-num} * (@{repeating_weapon_-l2c1lbupx2lnbourauw_crit-multiplier} - 1) ]]d@{repeating_weapon_-l2c1lbupx2lnbourauw_damage-die} + ((@{repeating_weapon_-l2c1lbupx2lnbourauw_damage_macro}) * [[ @{repeating_weapon_-l2c1lbupx2lnbourauw_crit-multiplier} - 1 ]]) ]]}} {{type=@{repeating_weapon_-l2c1lbupx2lnbourauw_type}}} {{weapon_notes=@{repeating_weapon_-l2c1lbupx2lnbourauw_notes}}} @{repeating_weapon_-l2c1lbupx2lnbourauw_iterative_attacks} @{repeating_weapon_-l2c1lbupx2lnbourauw_macro_options} {{vs=@{repeating_weapon_-l2c1lbupx2lnbourauw_vs}}} {{vs@{repeating_weapon_-l2c1lbupx2lnbourauw_vs}=@{repeating_weapon_-l2c1lbupx2lnbourauw_vs}}} {{precision_dmg1=@{repeating_weapon_-l2c1lbupx2lnbourauw_precision_dmg_macro}}} {{precision_dmg1_type=@{repeating_weapon_-l2c1lbupx2lnbourauw_precision_dmg_type}}} {{precision_dmg2=@{global_precision_dmg_macro}}} {{precision_dmg2_type=@{global_precision_dmg_type}}} {{critical_dmg1=@{repeating_weapon_-l2c1lbupx2lnbourauw_critical_dmg_macro}}} {{critical_dmg1_type=@{repeating_weapon_-l2c1lbupx2lnbourauw_critical_dmg_type}}} {{critical_dmg2=@{global_critical_dmg_macro}}} {{critical_dmg2_type=@{global_critical_dmg_type}}} {{attack1name=@{repeating_weapon_-l2c1lbupx2lnbourauw_iterative_attack1_name}}}

You can then take the unholy mess and convert it to drop-down query friendly syntax by replacing all the }} with html replacements

&{template:pf_attack} {{color=@{rolltemplate_color}}} {?Which Weapon?
| Club, {{name=@{repeating_weapon_-l2c1lbupx2lnbourauw_name} }} {{attack=[[ 1d20cs>[[ @{repeating_weapon_-l2c1lbupx2lnbourauw_crit-target} ]] + @{repeating_weapon_-l2c1lbupx2lnbourauw_attack_macro} ]] }} {{damage=[[@{repeating_weapon_-l2c1lbupx2lnbourauw_damage-dice-num}d@{repeating_weapon_-l2c1lbupx2lnbourauw_damage-die} + @{repeating_weapon_-l2c1lbupx2lnbourauw_damage_macro}]] }} {{crit_confirm=[[ 1d20 + @{repeating_weapon_-l2c1lbupx2lnbourauw_attack_macro} + [[ @{repeating_weapon_-l2c1lbupx2lnbourauw_crit_conf_mod} ]] ]] }} {{crit_damage=[[ [[ @{repeating_weapon_-l2c1lbupx2lnbourauw_damage-dice-num} * (@{repeating_weapon_-l2c1lbupx2lnbourauw_crit-multiplier} - 1) ]]d@{repeating_weapon_-l2c1lbupx2lnbourauw_damage-die} + ((@{repeating_weapon_-l2c1lbupx2lnbourauw_damage_macro}) * [[ @{repeating_weapon_-l2c1lbupx2lnbourauw_crit-multiplier} - 1 ]]) ]] }} {{type=@{repeating_weapon_-l2c1lbupx2lnbourauw_type} }} {{weapon_notes=@{repeating_weapon_-l2c1lbupx2lnbourauw_notes} }} @{repeating_weapon_-l2c1lbupx2lnbourauw_iterative_attacks} @{repeating_weapon_-l2c1lbupx2lnbourauw_macro_options} {{vs=@{repeating_weapon_-l2c1lbupx2lnbourauw_vs} }} {{vs@{repeating_weapon_-l2c1lbupx2lnbourauw_vs}=@{repeating_weapon_-l2c1lbupx2lnbourauw_vs} }} {{precision_dmg1=@{repeating_weapon_-l2c1lbupx2lnbourauw_precision_dmg_macro} }} {{precision_dmg1_type=@{repeating_weapon_-l2c1lbupx2lnbourauw_precision_dmg_type} }} {{precision_dmg2=@{global_precision_dmg_macro} }} {{precision_dmg2_type=@{global_precision_dmg_type} }} {{critical_dmg1=@{repeating_weapon_-l2c1lbupx2lnbourauw_critical_dmg_macro} }} {{critical_dmg1_type=@{repeating_weapon_-l2c1lbupx2lnbourauw_critical_dmg_type} }} {{critical_dmg2=@{global_critical_dmg_macro} }} {{critical_dmg2_type=@{global_critical_dmg_type} }} {{attack1name=@{repeating_weapon_-l2c1lbupx2lnbourauw_iterative_attack1_name} }}
| Mace, {{name=@{repeating_weapon_-l2b13nuxx2wbh1ubh_name} }} {{attack=[[ 1d20cs>[[ @{repeating_weapon_-l2b13nuxx2wbh1ubh_crit-target} ]] + @{repeating_weapon_-l2b13nuxx2wbh1ubh_attack_macro} ]] }} {{damage=[[@{repeating_weapon_-l2b13nuxx2wbh1ubh_damage-dice-num}d@{repeating_weapon_-l2b13nuxx2wbh1ubh_damage-die} + @{repeating_weapon_-l2b13nuxx2wbh1ubh_damage_macro}]] }} {{crit_confirm=[[ 1d20 + @{repeating_weapon_-l2b13nuxx2wbh1ubh_attack_macro} + [[ @{repeating_weapon_-l2b13nuxx2wbh1ubh_crit_conf_mod} ]] ]] }} {{crit_damage=[[ [[ @{repeating_weapon_-l2b13nuxx2wbh1ubh_damage-dice-num} * (@{repeating_weapon_-l2b13nuxx2wbh1ubh_crit-multiplier} - 1) ]]d@{repeating_weapon_-l2b13nuxx2wbh1ubh_damage-die} + ((@{repeating_weapon_-l2b13nuxx2wbh1ubh_damage_macro}) * [[ @{repeating_weapon_-l2b13nuxx2wbh1ubh_crit-multiplier} - 1 ]]) ]] }} {{type=@{repeating_weapon_-l2b13nuxx2wbh1ubh_type} }} {{weapon_notes=@{repeating_weapon_-l2b13nuxx2wbh1ubh_notes} }} @{repeating_weapon_-l2b13nuxx2wbh1ubh_iterative_attacks} @{repeating_weapon_-l2b13nuxx2wbh1ubh_macro_options} {{vs=@{repeating_weapon_-l2b13nuxx2wbh1ubh_vs} }} {{vs@{repeating_weapon_-l2b13nuxx2wbh1ubh_vs}=@{repeating_weapon_-l2b13nuxx2wbh1ubh_vs} }} {{precision_dmg1=@{repeating_weapon_-l2b13nuxx2wbh1ubh_precision_dmg_macro} }} {{precision_dmg1_type=@{repeating_weapon_-l2b13nuxx2wbh1ubh_precision_dmg_type} }} {{precision_dmg2=@{global_precision_dmg_macro} }} {{precision_dmg2_type=@{global_precision_dmg_type} }} {{critical_dmg1=@{repeating_weapon_-l2b13nuxx2wbh1ubh_critical_dmg_macro} }} {{critical_dmg1_type=@{repeating_weapon_-l2b13nuxx2wbh1ubh_critical_dmg_type} }} {{critical_dmg2=@{global_critical_dmg_macro} }} {{critical_dmg2_type=@{global_critical_dmg_type} }} {{attack1name=@{repeating_weapon_-l2b13nuxx2wbh1ubh_iterative_attack1_name} }}
} }}

(NOTE: I didn't test this specific example, but I've used similar methods many times without issue)
Holy cow... that's a long macro!

Thank you for the help, I'll try and see what I can do with it! 
January 30 (7 years ago)
vÍnce
Pro
Sheet Author
Mark is awesome.  ;-P
Honestly, I don't even get to do too much with macros these days.  PF sheet tends to do everything for you, for the most part.  I just wish it could do all that without being so huge :)  The thing is a beast, lol.