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

Trying to make a universal monster attack macro

I trying to make a macro I can use for just about any monster my players might come across but I don't know how to do iterative attack. I would also like to have a query for the iteratives so it's not always rolling a full attack. Here is what my macro looks like so far, it works great for singular attacks but it takes too long if I need my monster to attack more than once. &{template:pf_attack} {{color=Black}} {{header_image=[Attack](-)}} {{name= ?{Attack Name? | }}} {{character_name= ?{Monster Name? | }}} {{Damage Type= ?{Damage Type? | }}} {{attack=[[[[1d20cs>[[19]]+?{Attack Bonus|0}]]]]}} {{damage=[[[[?{Damage Dice|0}+?{Damage Bonus|0}]]]]}} {{crit_confirm=[[[[1d20cs>[[20]]+?{Attack Bonus|0}]]]]}} {{crit_damage=[[[[?{Damage Dice|0}+?{Damage Bonus|0}]]]]}} }
1592602124
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Try this. it works right out of the box on any monster without editing the monster at all. NPC Statblock Chat Menu for D&D 5e sheet — No API required!
keithcurtis said: Try this. it works right out of the box on any monster without editing the monster at all. NPC Statblock Chat Menu for D&D 5e sheet — No API required! sorry I should have said before that this is for a pathfinder 1e game. If that macro still works for that system too then that would be great but my experience with different systems on Roll20 has usually been that the macros are incompatible.  
1592625723

Edited 1592626190
Oosh
Sheet Author
API Scripter
It can certainly be done, it will involve quite a few queries though. Do you want to to ask how many iterative attacks to roll, and a modified AB to apply to each and every roll? It's going to be a bit of work for you typing that in every time. Is there a reason you're not pulling the stats from an NPC sheet? This means you can do all the work before the session, rather than accurately typing in 5+ queries for every attack roll, mid-session. You've also got most of your math in double-double brackets [[[[  ]]]] which destroys mouseover info - is this intentional? Also, which sheet version are you using? Community? I don't play PF and don't really know the templates, or the differences between sheets, but this should work. The bolded part is your basic 2nd attack (first iterative attack) fields. &{template:pf_attack} {{color=Black}} {{header_image=[Attack](-)}} {{name= ?{Attack Name?|Dagger}}} {{character_name= ?{Monster Name|Goblin}}} {{Damage Type= ?{Damage Type?|Slashing}}} {{attack=[[[[1d20cs>[[19]]+?{Attack Bonus|5}]]]]}} {{damage=[[[[?{Damage Dice|1d4}+?{Damage Bonus|5}]]]]}} {{crit_confirm=[[[[1d20cs>[[20]]+?{Attack Bonus|0}]]]]}} {{crit_damage=[[[[?{Damage Dice|0}+?{Damage Bonus|0}]]]]}} ?{2nd Attack?| Yes, {{attack2=[[1d20cs>19 + ?{2nd Attack Bonus|0 }]]}} {{damage2=[[?{Damage Dice} + Damage Bonus}]]}} {{crit_confirm2=[[1d20 + ?{Attack Bonus}]] }} {{crit_damage2=[[?{Damage Dice} + ?{Damage Bonus}]]}} | No,  } As you can see, as soon as you use a query for the iterative attacks, you get into a world of HTML replacement which makes it hard to read. Once inside a query you can't use the characters which will be parsed as query instructions: mainly } , |  unless they are in a character sheet reference, like @{dragon|strength}, then you leave them alone as they are parsed before the query. You would have to nest 3rd and 4th attacks in there too. Note that you can't just do "How many attacks?" => "4" and use the input integer to swing that many times. There's no way to way to make loops based on integers. You have to nest each iterative attack as another Yes/No Query. Also, I put some default values into your queries just so I could mash the enter button to test it. This pf_attack template also seems to break on a blank Query option, hence the " " after the No option. If you don't have this in there, nothing after the query will be parsed and the "No" will be output to chat. Someone familiar with the sheet probably knows why. Or maybe it happens with all templates and I hadn't noticed? edit - if you save a macro (like the above) that contains HTML replacement as a Collections macro, re-opening it will destroy the HTML replacement and it will no longer work. You can either store them as plain text files to copy & paste into the game, or save them as Ability macros on a character sheet where the code will be preserved. edit 2 - I don't know my PF math, I could be re-using queries where I shouldn't in the iterative attack section.
1592629708
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Brandon L. said: keithcurtis said: Try this. it works right out of the box on any monster without editing the monster at all. NPC Statblock Chat Menu for D&D 5e sheet — No API required! sorry I should have said before that this is for a pathfinder 1e game. If that macro still works for that system too then that would be great but my experience with different systems on Roll20 has usually been that the macros are incompatible.   The principle should be sound, but it would require a re-write to match the PF sheet macros and attributes.