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

Pathfinder attack macros

January 27 (10 years ago)
I am trying to figure out how to make a macro for my slayer's dual weapon attack. I am having a hard time understanding how macros work. I can make a basic macro that I would have to change every time I leveled up, but what I am trying to do is make one that inputs the data needed, that's what I can't figure out. Any help would be appreciated. Please and thank you.
January 27 (10 years ago)
Gen Kitty
Forum Champion
There's a variety of ways you can make macros. I suggest reading through this ( https://wiki.roll20.net/Macros ) and then coming back with any questions you have.
January 27 (10 years ago)
If you are using the pathfinder character sheet you have macro buttons built in to it.
I suggest you create your weapon twice, once for a standard attack, and once for a TWF attack with a -2 attack modifier on it. That way you can choose which macro to roll based on which type of attack you are doing.
January 27 (10 years ago)
Thank you, but I have read through that page already. I also already have the built in macros working the way I'd like them to. What I am trying to do is use either the macro creator on the settings page, or the one on the attributes tab within the character sheet. I'd like to use one of them to make a dual weapon attack macro to attach to my token, instead of having to open my character sheet every time to use the built in macros for each weapon. I have figured out how to create the macro for the dual weapon attack, but I don't know how to have it pull the information for my rolls. I can manually change it each time I level, but I want to try and have it so it updates itself. Could anyone explain this way to me?
January 27 (10 years ago)
Also, something I've been wondering, but can't seem to figure out how to do it... Is there a way to have a macro select a target and pull information from that target? Like, the AC of a target, to see if an attack roll would hit? Then, if there's a way to do that, is there a way to only roll for damage if it succeeds? Same for crits, is there a way to have it only roll the crit damage if it actually was a crit roll?
January 27 (10 years ago)

Edited January 27 (10 years ago)
Hi, I don't pretend to be an expert on this - I get confused with all the macro stuff too. But here's what we figured out to work in the campaign I'm running. In your attritbutes, make a macro for your weapon then the actual text should read "%{selected|repeating_weapon_0_attack}" where the number relates to the # of the attack in the character sheet. It should work.

No idea on pulling the AC from a token, but I keep that sort of stuff secret from my players.

Hope that helps a little!
January 27 (10 years ago)
You dont need to open the sheet each time, you just drag the macro button from the sheet or use %{selected|repeating_weapon_0_attack} where you replace 0 with the number weapon you have created.

If you want to manually build a macro from the ground up (which you have to do because you cant pull calculated fields from a repeating weapon) then the formula is something like.
[[1d20 + (@{repeating_weapon_0_proficiency} + (((@{repeating_weapon_0_enhance} + @{repeating_weapon_0_masterwork}) + abs(@{repeating_weapon_0_enhance} - @{repeating_weapon_0_masterwork})) / 2) + @{repeating_weapon_0_attack} + @{repeating_weapon_0_attack-type} + @{armor-proficiency})]]

And the damage formula is
[[@{repeating_weapon_0_damage-dice-num}d@{repeating_weapon_0_damage-die} + (@{repeating_weapon_0_enhance} + @{repeating_weapon_0_damage} + @{repeating_weapon_0_damage-ability})]]

And the crit damage formula is
[[(@{repeating_weapon_0_damage-dice-num} * (@{repeating_weapon_0_crit-multiplier} - 1))d@{repeating_weapon_0_damage-die} + (((@{repeating_weapon_0_enhance} + @{repeating_weapon_0_damage} + @{repeating_weapon_0_damage-ability}) * (@{repeating_weapon_0_crit-multiplier} - 1))]]
January 27 (10 years ago)
For rolling a crit damage only if you crit, that will come with roll templates in the next update.
January 27 (10 years ago)

Edited January 27 (10 years ago)
Gen Kitty
Forum Champion

Amanda K. said:

I'd like to use one of them to make a dual weapon attack macro to attach to my token, instead of having to open my character sheet
every time to use the built in macros for each weapon. I have figured out how to create the macro for the dual weapon attack, but I don't know how to have it pull the information for my rolls. I can manually change it each time I level, but I want to try and have it so it updates itself. Could anyone explain this way to me?

Here are some excerpts from a macro-writing tutorial series I wrote up for a group I'm in. Maybe it will help you.

---
A macro at its heart is simply a series of commands pre-packaged so they can be fired off with the click of a button or a typed command in chat. There's two different ways you can set up a macro. First is through the Macros sidebar.

Click on the geartab at the topright of your screen, then click the +Add button. This will bring up the Macro editing dialog box. Name it and then type in the commands, one per line, you wish to have in the macro and then save your macro.




If you check the 'Show as Token Action' button, it will appear as a click-able button when you have any token you control selected.


The second method is via your character sheet, as an Ability.

Open your character journal, click on 'Attributes & Abilities', and +add next to Abilities. Hover over your new 'Ability' and click on the pencil icon. This will bring up the Ability editing Dialog box. Name it and then type in the commands, one per line, you wish to have in the macro and then save your macro by clicking on the checkmark.


The benefit of doing macros via this second method are two-fold: firstly, character specific macros can be placed here and not spam your macro sidebar. The second advantage will be explained in a later section.

-----
Thus far we've used static numbers in our macros, aside from our roll queries. Time to kick it up a notch and start using Attributes in our macros!

An attribute is anything that isn't an ability. This tutorial deals with attributes that you control.

Setting attributes is simple. Open your character journal, click on 'Attributes & Abilities', and then click on +Add next to Attributes. Fill in the needed values, there's no special button to click to save your work. Below Is part of Adara's Attributes & Abilities to give you an idea of what you can do.



Here I insert a caveat: In games with a 'Character Sheet' enabled, the sheet can and can cause confusion to your Attributes & Abilities page because a character sheet is just a really really REALLY complicated version of the A&A tab. Be careful here.

Once you've added some attributes, we can start using them in macros. The code below assumes you're using Abilities for your macros.

@{attribute}                      [Pulls Current value]
@{attribute|max}                  [Pulls Max value, if set]

WARNING: Attempting to reference an unset attribute will cause your macro to fail to execute and then you'll be unhappy. Don't be unhappy, make sure all your attributes have values.


/em attacks with his longsword! He his AC [[1d20 +@{HalfLevel} +@{Str} +?{Modifier to Hit|0}]] for a potential [[1d10 + @{Str} + ?{Modifier to Damage|0}]] damage.
/em attempts an Acrobatics check: [[1d20 + @{Acrobatics} + ?{TempMods|0}]]
/em attacks with Clever Strike.  She hits AC [[1d20 +@{HalfLevel} +@{Dex} + ?{Modifier to Hit|0}]] for [[1d6 + @{Dex} + ?{Modifier to Damage|0} + ?{Sneak?|[NH]2d6} ]] potential damage.

The benefit to this approach is mainly for longer-term campaigns. Instead of editing your macros, you edit your attributes. Additionally, I discovered that once I started building macros in this style, I started better understanding the mechanics of 4. The attack macros above are actually incomplete for 4e, leaving out a lot of numbers that need to be input. If you decide you want to explore further, I will post a tutorial specifically on how to write your attack powers for 4e with this method.

This is where the second benefit of using Abilities rather than Macros comes into play. Because this macro is attached to a specific character, the code parser only looks at this specific character journal for the attributes you are referencing. To use attributes in a non-attribute macro, you have to specify the character you wish to pull from:

@{Adara|HP}

The next tutorial covers attributes that the GM controls, for campaigns where the GM cooperates and has these values set ^_-

-----

This level of macro-making requires cooperation on the GM's part and thus is to be considered fully optional.

Macros can pull information not just from your own personal characters, but also from any other token on the game board. The attributes common to 4e games are token_name, AC, Fort, Ref, and Will (or whatever the GM has named those last four. token_name is always token_name).

@{target|descriptor|attribute}
@{target|Foe|token_name}
@{target|Foe|AC}
@{target|Ally|token_name}   [Target your friends, too! You can count on your fellow PCs to have their token_name set]

/em attacks @{target|Foe|token_name} with his longsword! He hits AC [[1d20+11+ ?{Modifier to Hit|0}]] for a potential [[1d10 + 7 + ?{Modifier to Damage|0}]] damage.
/em casts Healing Word; @{target|Ally|token_name} spends a healing surge and gains [[2d6 + ?{Any bonus healing?|0}]] additional healing.

Now, an example of a differently formatted macro that speeds up gameplay but sacrifices a level of mystery many GMs prefer to retain.

/me rolls to attack with his longsword.
Attacks AC [[1d20+11+ ?{Modifier to Hit|0}]] vs [[@{target|Foe|AC}]] @{target|Foe|token_name}'s AC
Damage is [[1d10 + 7 + ?{Modifier to Damage|0}]] | Maximum Damage is [[ 17+ ?{Modifier to Damage} ]]


If the GM is so kind as to set these values on his or her tokens and allow you to make macros that reference them (ask before assuming), you will thank that GM earnestly and not abuse the privilege. I have yet to be a player in a campaign where the defense values are available for PC macro-making, but I wanted to add this section of the tutorial for completeness's sake. Token_name is usually fair game. Usually. Don't be annoyed if your GM says 'stop doing that'.
January 27 (10 years ago)

Edited January 27 (10 years ago)
Thank you both. I will test these next time I am in the game, which should be later today.

Edit: Woah, that one appeared while I was reading/responding. I'll read through that reply as soon as I'm back on a computer.
Thank you all for taking the time to try and help a newby.
January 27 (10 years ago)
Is there a way, to have hidden notes within the macro? Like, if I put a value that I have to manually change, but want to know what that value that I am changing is, is there a way to put a note that is only seen when looking at the macro? I thought, someone had told me, that anything in a macro within < and > would not show up in the chat, but would stay in the macro so I knew what to change when I needed to. I tried that, and had my macro just the way I wanted it, but when I went back in just now to show someone my macro, my notes were gone. Could someone please explain this to me?
January 27 (10 years ago)

Edited January 27 (10 years ago)
vÍnce
Pro
Sheet Author
Try placing "comments" inside of single brackets

example;
[[1d20+@{selected|STR-mod}[Strength Mod]]]
January 27 (10 years ago)
Gen Kitty
Forum Champion

Vince said:

Try placing "comments" inside of single brackets

example;
[[1d20+@{selected|STR-mod}[Strength Mod]]]


There's a caveat to that: If you want to do a math-only expression with inline labels, you must add a diceroll to the math expression. 0d0 works nicely. There's just something about math-only expressions that makes them go KABOOM when combined with inline-labels.

So, if you were doing something like a healing spell that only does flat healing, say 3 plus level? (Don't ask why, it's a quick dumb example off the top of my head) You'd want to do this:

[[0d0 +3 +@{ATTRIBUTE} [COMMENT HERE] ]]
January 28 (10 years ago)

Edited January 28 (10 years ago)
vÍnce
Pro
Sheet Author
Yep. Love the 0d0
January 28 (10 years ago)

Edited January 28 (10 years ago)
Could somepony tell me what these errors mean?
I got two different ones.

SyntaxError: Expected ")", "[", [ |\t] or [+|\-|*|\/|%] but "(" found.
This one came when I tried using this macro:

/em activates her power attack against @{target|token_name}.
Greatsword attack roll against AC: [[1d20 +5<BAB+(STR*1.5)>]]
(Needs at least [[(19<crit-target>) +5<BAB+(STR*1.5)> ]] to crit.)
Potential Damage Result: [[2<damage-dice-num>d6<damage-die> +5 <BAB+STR*1.5> +3 <+2*1.5>]]
Crit: 19<crit-target>/x2<crit-multiplier>
Potential Crit Damage: +[[(2<damage-dice-num> (2<crit-multiplier> - 1))d6<damage-die> + (5<BAB+STR*1.5> +3 <+2*1.5> (2<crit-multiplier> - 1))]]


Could not determine result type of: [{"type":"M","expr":"(19"},{"type":"L","text":"crit-target"},{"type":"M","expr":")+5"},{"type":"L","text":"BAB+(STR*1.5)"}]
This one came from this macro:

/em activates her power attack against @{target|token_name}.
Greatsword attack roll against AC: [[1d20 +5[BAB+(STR*1.5)]]]
(Needs at least [[(19[crit-target]) +5[BAB+(STR*1.5)] ]] to crit.)
Potential Damage Result: [[2[damage-dice-num]d6[damage-die] +5 [BAB+STR*1.5] +3 [+2*1.5]]]
Crit: 19[crit-target]/x2[crit-multiplier]
Potential Crit Damage: +[[(2[damage-dice-num] (2[crit-multiplier] - 1))d6[damage-die] + (5[BAB+STR*1.5] +3 [+2*1.5] (2[crit-multiplier] - 1))]]


The only thing I changed was the greaterthan and lessthan symbols into single brackets

I thought for sure that I had everything set up the same as my own melee attack, but with this one(my friend's) I got errors.
January 28 (10 years ago)

Edited January 28 (10 years ago)
Gen Kitty
Forum Champion

GenKitty said:

Vince said:

Try placing "comments" inside of single brackets

example;
[[1d20+@{selected|STR-mod}[Strength Mod]]]


There's a caveat to that: If you want to do a math-only expression with inline labels, you must add a diceroll to the math expression. 0d0 works nicely. There's just something about math-only expressions that makes them go KABOOM when combined with inline-labels.

So, if you were doing something like a healing spell that only does flat healing, say 3 plus level? (Don't ask why, it's a quick dumb example off the top of my head) You'd want to do this:

[[0d0 +3 +@{ATTRIBUTE} [COMMENT HERE] ]]




You're doing a math-only expression with inline labels. You have to have a dice roll when using inline labels or it will go kaboom.

Try this instead for that line:
(Needs at least [[(0d0+19[crit-target]) +5[BAB+(STR*1.5)] ]] to crit.)

Wow great stuff in this thread!

Next question - how can I make an attack macro that rolls a crit confirmation automatically?

Could I add something to make it do the math on a 19-20? 18-20?

We use simple ones, like:
+1 holy longsword hits AC [[1d20+10]] for [[1d8+3]] slashing and AC [[1d20+5]] for [[1d8+3]] slashing.

Say it was keen. Can I make it do a second potential roll for AC and damage? Can it add what the new result might be if it had hit the crit on the second roll?
January 28 (10 years ago)
Gen Kitty
Forum Champion
For crit confirmation, you can do two things:

A) An extra line in your macro that rolls the crit confirmation so you have it right there at need, and you can gaze sadly at it when you don't roll crits. This is what I used to do.

B) Use the 'reroll once only' mechanic. ro For example: [[1d20ro>19]] will reroll the die if it rolls a 19 or 20. The DISPLAYED result will be the second die, if rolled. Please be aware that the green box will not show on a 19. You have to mouseover the dice result in an inline roll to check to see if a 19 was rolled.

You're a mentor, however, so you can use Powercards, which will allow you to have the boxes color green on any number range you dictate.
January 28 (10 years ago)
This has been incredibly helpful to me, as well. I do have one other simple question I have not found the answer to anywhere. How would you write a macro to be able to target more than one target? I'm playing a spell caster, and am gonna need to know this. I have tried multiple times to work out a formula that works, and cannot get it to respond propperly......
January 28 (10 years ago)
Gen Kitty
Forum Champion
It's just like attacking one target, but you include more @target statements. Here's a generic example.

/me utters sharp syllables of power and then fires red-hot energy at his foes.
Spell: Scorching Ray (Evocation, Ranged, Standard action)
Ray 1: vs @{target|Ray 1|token_name}
Result: AC [[1d20+5]] for [[1d8+2]] damage
Ray 2: vs @{target|Ray 2|token_name}
Result: AC [[1d20+5]] for [[1d8+2]] damage
Ray 3: vs @{target|Ray 3|token_name}
Result: AC [[1d20+5]] for [[1d8+2]] damage

This works great when you have multiple targeted foes. But Area of Effect spells are a bit trickier. You could be hitting one, two, or twenty-five or more targets depending on the shape and size of your spell-effect, and the number changes from casting to casting because there's no way to predict how many will be in the AoE. If you don't have to roll a separate to-hit for each target, life is simple, but in other systems you're not so lucky. Here's a few non-API ways of dealing with the issue when you need to roll variable multi-hits, done very generically.

The Grid: Burning Hands (Cone)(This GM has decided the cone affects 7 squares) & Fireball (circle) (In a system where fireball makes you roll to-hits for everything, like say, 4e. Though, a 4e fireball is square, but just work with me here?)

/me casts burning hands at her foes. (Evocation, 15' cone, 1-7 targets)
*** [[0+0]] [[1d20+5]] [[1d20+5]] 
 ME [[1d20+5]] [[1d20+5]] [[1d20+5]] 
*** [[0+0]] [[1d20+5]] [[1d20+5]] 
--- Damage: [[3d4]] ---

/me casts fireball at his foes. (Evocation, 20' circle 1-12 targets)
[[0+0]] [[1d20+5]] [[1d20+5]] [[0+0]]
[[1d20+5]] [[1d20+5]] [[1d20+5]] [[1d20+5]]
[[1d20+5]] [[1d20+5]] [[1d20+5]] [[1d20+5]]
[[0+0]] [[1d20+5]] [[1d20+5]] [[0+0]]
--- Damage: [[6d6]] ---

Benefits: Pretty output, very tightly-compacted
Cons: The GM has to visually match up each target in the AoE to the grid square in your display

The List: Burning Hands

/me casts burning hands at his enemies. (Evocation, 15' cone, 1-7 targets)
Target 1: [[1d20+5]] Target 2: [[1d20+5]]
Target 3: [[1d20+5]] Target 4: [[1d20+5]]
Target 5: [[1d20+5]] Target 6: [[1d20+5]]
Target 7: [[1d20+5]]
Damage: [[3d4]] Fire
Benefits: The GM just matches first to last against the list until you've run out of targets, still reasonably compact
Cons: You're still seeing rolls for hits you're not allowed to take, plus unused crits taunt you. Do you like being taunted?

The Tailored List: Fireball

/me casts fireball at his enemies, targeting ?{Number of targets?|1} of them.
Target 01: [[1d20+5]] vs @{target|Target1|token_name}
?{target2|!} Target 02: [[1d20+5]] vs @{target|Target2|token_name}
?{target3|!} Target 03: [[1d20+5]] vs @{target|Target3|token_name}
?{target4|!} Target 04: [[1d20+5]] vs @{target|Target4|token_name}
?{target5|!} Target 05: [[1d20+5]] vs @{target|Target5|token_name}
?{target6|!} Target 06: [[1d20+5]] vs @{target|Target6|token_name}
?{target7|!} Target 07: [[1d20+5]] vs @{target|Target7|token_name}
?{target8|!} Target 08: [[1d20+5]] vs @{target|Target8|token_name}
?{target9|!} Target 09: [[1d20+5]] vs @{target|Target9|token_name}
?{target10|!} Target 10: [[1d20+5]] vs @{target|Target10|token_name}
?{target11|!} Target 11: [[1d20+5]] vs @{target|Target11|token_name}
?{target12|!} Target 12: [[1d20+5]] vs @{target|Target12|token_name}
Damage: [[6d6]] Fire
Benefit: Custom-tailored list of targets that only lists as many targets as you wish to attack
Cons: Not space-efficient, not simple, requires getting used to

This is a bit of a hack and takes advantage of the system-parser interpreting any line starting with ! as a call to an installed API script, and if it can't find a script that makes it happy it silently discards the line.

This macro will ask you to select 12 targets, as that is the maximum number of targets this macro handles. It will then ask you how many targets, for the benefit of the emote. And then it will bring up a series of prompts for Target2 through Target 12. To include those targets in the final output remove the ! and leave the box blank. If you do not wish to actually include them, leave the ! in the box. And you must be asking, "But what if there's only 3 targets in the area of effect? What do I do?!?" and my answer is, "Click on your own token to pad out the list."

Try it out a few times and you'll quickly get the hang of it.

If you have specific spells or abilities from a specific system, I'm happy to write less-generic macro examples. I'm experienced in writing macros for Pathfinder, 4e, 5e, and generic d20 systems, but I can turn my hand to World of Darkness and GURPS/3d6 systems at need :>
January 28 (10 years ago)
Thank you so much. I am playing a pathfinder witch in the reign of winter campaign. was struggling with macro "coding". It just kept eluding me how to set up spell macros, as for some reason the built-in spell macro buttons on the character sheet do not do what they are supposed to do. I am one of 2 casters in the party (witch + warpriest) and also happen to be the most experienced d20-system gamer in the group. I hate not being able to answer questions when others bring them to me, ad dislike feeling stumped by something involving a game I am so familiar with. Thank you
January 28 (10 years ago)
Gen Kitty
Forum Champion
Working with and around character sheets is tricky sometimes. Sadly, when I played a witch it wasn't on Roll20 so I have no useful macros to offer.
January 29 (10 years ago)
Ok, so... I am trying to rolls this macro:

/em activates her power attack against @{target|token_name}.
Greatsword attack roll against AC: [[1d20+5<BAB+(STR*1.5)>]]
(Needs at least [[(0d0+19<crit-target>)+5<BAB+(STR*1.5)>]] to crit.)
Potential Damage Result: [[2<damage-dice-num>d6<damage-die>+5<BAB+STR*1.5>+3<2*1.5>]]
Crit: 19<crit-target>/x2<crit-multiplier>
Potential Crit Damage: +[[(2<damage-dice-num>(2<crit-multiplier>-1))d6<damage-die>+(5<BAB+STR*1.5>+3<2*1.5>(2<crit-multiplier>-1))]]


and I keep getting this error:
SyntaxError: Expected ")", ".", "[", "d", "e", "t", [ |\t], [+|\-|*|\/|%] or [0-9] but "(" found.
January 29 (10 years ago)
Then I get this error:
SyntaxError: Expected ")", "[", [ |\t] or [+|\-|*|\/|%] but "(" found.

when I roll this macro:
Greatsword attack roll against AC: [[1d20+5<BAB+(STR*1.5)>]]
(Needs at least [[(0d0+19<crit-target>)+5<BAB+(STR*1.5)>]] to crit.)
Potential Damage Result: [[2<damage-dice-num>d6<damage-die>+5<BAB+STR*1.5>]]
Crit: 19<crit-target>/x2<crit-multiplier>
Potential Crit Damage: +[[(2<damage-dice-num>(2<crit-multiplier>-1))d6<damage-die>+(5<BAB+STR*1.5>(2<crit-multiplier>-1))]]
January 29 (10 years ago)
OMG I GOT IT! I was missing the asterisks in the Potential Crit Damage lines!