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

Generic attack macro for NPC [Pathfinder 2]

1595118110

Edited 1595119547
Hello, I've been trying to create a generic macro that I could use with any selected token to attack. I've tried with   %{selected|repeating_melee-strikes_$id_ATTACK-DAMAGE-NPC}   but to no avail. In fact, I'd like a macro similar to this one I created: /w gm @{selected|token_name} secretly rolls [[1d20+?{Select Saving|Vigueur, @{selected|saving_throws_fortitude}|Reflexes, @{selected|saving_throws_reflex}|Volonté, @{selected|saving_throws_will}|}]] But that would propose me to select between the several melee attack (and then one for range attacks, etc) Anyone knows how to do that? EDIT: I tried this too, but it is not working at all -_- &{template:rolls}{{charactername=@{selected|character_name}}}  {{header=strikes}} {{notes_show=@{selected|roll_show_notes}}} {{info01_name=Melee}} {{info01=?{Attaque de mélée|attaque 1 {[@{selected|repeating_melee-strikes_$0_weapon}](~selected||repeating_melee-strikes_$0_ATTACK-DAMAGE-NPC)} |attaque 2 {[@{selected|repeating_melee-strikes_$1_weapon}](~selected||repeating_melee-strikes_$1_ATTACK-DAMAGE-NPC) } }}
1595140638

Edited 1595141672
Oosh
Sheet Author
API Scripter
There's a thread here for an NPC attacks & stats chat menu. It's for 5e so the code itself won't be much use to you, but if the output looks like something you can use we can throw together a PF2 version of it, presumably? I've only very briefly look at the sheet, but I don't see why it wouldn't be possible. I had a quick dig to get you started: &{template:rolls} {{header=NPC Attack Menu}} {{subheader=@{selected|character_name}}} {{notes_show=[[1]]}} {{notes=**Melee Attacks:** [@{selected|repeating_melee-strikes_$0_weapon}](~selected|repeating_melee-strikes_$0_ATTACK-DAMAGE-NPC) [@{selected|repeating_melee-strikes_$1_weapon}](~selected|repeating_melee-strikes_$1_ATTACK-DAMAGE-NPC) **Ranged Attacks:** [@{selected|repeating_ranged-strikes_$0_weapon}](~selected|repeating_ranged-strikes_$0_ATTACK-DAMAGE-NPC) [@{selected|repeating_ranged-strikes_$1_weapon}](~selected|repeating_ranged-strikes_$1_ATTACK-DAMAGE-NPC)}} This is the output (I've got some CSS styling on, so yours might look a little different): Does this look like what you want? You can throw whatever you want in there obviously, AC and HP at the top etc. etc.
Thanks a lot for putting time into this :) My brother and I came with a similar result as what you did (CCS apart), but the problem is that if the token doesn't have one or more of these actions, it gives a list of error messages. I was going more for a drop-down menu, but I'm starting to think it's just not possible.
1595206213
Oosh
Sheet Author
API Scripter
Nesting loads of Ability links is difficult, and you definitely won't be able to suppress the errors. That 5e NPC chat menu thread has a CSS solution for hiding the error messages which could easily be adapted to PF2 if you're willing to use Stylus.