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

Attack + Damage Macro

Is it possible to make a fairly simple Macro that rolls an attack for your character and then let's you click the roll result to then roll damage?  NPC attacks from an NPC sheet acts this way, but I want a Macro to do it for characters as well.  Thanks in advance!
1601398257
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Which sheet are you using? The D&D 5th Edition by Roll20 Sheet can be set to run this way under the character's settings tab.
We are using the standard 5e sheet. I should have specified that.  By character settings tab, do you mean the Cog on the Character sheet? While that's useful, I'd like to make a macro that you can just click on the token and then click the macro, choose advantage, disadvantage, or normal and then it rolls the result. If that's possible. 
You can go to that Cog page and set your Advantage to Query, so it will ask you before any rolls. Then, drag the command you want you to set up as a token action to the Macro bar at the bottom, go to the Attributes and Abilities tab at the top of the sheet, create a new ability and give set its macro as %{<full character name>|repeating_<action type>_<string of numbers/letters>_<action type>} All of the information you need will show up in that macro button that was dragged to your bar, so copy it from there, making the slight adjustments (%{, and | instead of :) as showin the formula above.
1601405560
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You might also find some utility in this macro (there are better API solutions): NPC Statblock Chat Menu for D&D 5e sheet — No API required!
I'll test these things out and try to get something working. Thank you guys!
Dakota H. said: You can go to that Cog page and set your Advantage to Query, so it will ask you before any rolls. Then, drag the command you want you to set up as a token action to the Macro bar at the bottom, go to the Attributes and Abilities tab at the top of the sheet, create a new ability and give set its macro as %{<full character name>|repeating_<action type>_<string of numbers/letters>_<action type>} All of the information you need will show up in that macro button that was dragged to your bar, so copy it from there, making the slight adjustments (%{, and | instead of :) as showin the formula above. I guess I don't understand where you're telling me to drag to. When you say macro bar, do you mean the bar that pops up when I click on a token? Because I tried that and nothing happens...
No, the Macro bar is permanently on your screen regardless of any token being clicked on or not. The default location is the bottom of your screen under the players' names/avatars. If there is extra space there at the bottom your bar is enabled. If there is no space there, go to the Collections tab and toggle the box to enable it.
Oh, I forgot all about that! I think I have it disabled! I'll try this again with it enabled. Thank you!
Alright, this is what I came up with following the above directions: %{Thomas|repeating_attack_-M6ojF8IpuptgN-Vhfxv_attack} Unfortunately, when I click the macro it doesn't ask for the roll type (normal, advantage, or disadvantage) and it outputs  |repeating_attack_-M6ojF8IpuptgN-Vhfxv_attack So I'm not sure what I'm doing wrong...
1601612292
Oosh
Sheet Author
API Scripter
Although the sheet uses those long ids for the repeating sections, it will accept the much-easier-on-the-eye "$0" numbering. So the first attack for a character sheet named Thomas would be: %{thomas|repeating_attack_$0_attack}  (not case sensitive, you can use capitals for readability if you like though) The second would be $1, and so on. You're much less likely to get a typo using row numbers instead of the unique id strings. If that also doesn't work, it either means the sheet name is incorrect, or there's something wrong with the ability in the first Attacks & Spellcasting slot.
lower case Ls and capital i s look the same in the font used by Roll20. Try to switch that once character for the other and see if it works. Also if Thomas is not the full name as it appears on the character sheet, it will not work.
Alright, I got it to work using %{thomas|repeating_attack_$0_attack}. But now I want to modify it. As it stands now, the macro outputs an attack roll and damage roll.  I would like it to output just the attack roll, and then be able to click the weapon to roll damage if the attack hits. This is what it looks like: This is what I want it to do when I click the macro: And then when you click Attack it outputs the damage roll:
1601859425

Edited 1601859447
Oosh
Sheet Author
API Scripter
In the sheet's Settings tab (cog icon) there's an option in the top right frame for Auto Roll Damage & Crit. Switch that one off.
Perfect! Thank you!