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

Implementing click weapon name to roll damage into Macro?

I was not quite sure how to title this since I don't know exactly how to describe it but I am using the SRD5 Character Sheets for my game. This allows players to click their weapon/attack on the character sheet and have it make the attack roll. The area I am focusing on is that when you roll, in the main chat it comes up in a box and allows you to click the name of the weapon/attack in order to roll damage. Is there some way to introduce that functionality within a macro? Right now what I have is rolling two attacks, /roll 1d20 + @{selected|npcd_str_mod} /roll 1d20 + @{selected|npcd_str_mod} And what I want to have is those both appear and me be able to click the name/attack in order to roll the damage. If I could also code what that damage roll would be that would amazing! Is this something I need to subscribe and edit the API for? Overall, what I want my macro to look like is: /em strikes out with both shortswords! /roll 1d20 + @{selected|npcd_str_mod} (here is the damage roll that I could select if the hit landed) /roll 1d6 + @{selected|npcd_str_mod} /roll 1d20 + @{selected|npcd_str_mod} (here is the damage roll that I could select if the hit landed) /roll 1d6 Thank you for all help and input!
1454626351

Edited 1454626526
Hey, Ben G. Are there any particular reasons you're opting against using the Attacks & Spellcasting section of the OGL by Roll20 Character Sheet to handle these attacks? As you said, they can do what you're aiming to do quite easily. I might input something like 1d6 + ?{Add strength mod?|Yes, @{selected|npcd_str_mod}|No, 0} into a DAMAGE field to handle this attack using one repeating section. Is there some way to introduce that functionality within a macro? [...] Is this something I need to subscribe and edit the API for? To answer your questions; yes and no, respectively! You can use API Command Buttons (in a special way that does not require access to the API) to accomplish this: /em strikes out with both shortswords! First attack: [[ 1d20 + @{selected|npcd_str_mod} ]] [Roll damage](!
[[ 1d6 + @{selected|npcd_str_mod} ]]) Second attack: [[ 1d20 + @{selected|npcd_str_mod} ]] [Roll Damage](!
[[ 1d6 ]]) Note: Since the above macro uses HTML entities, it risks becoming broken when not saved as an Ability.
Thank you for the example! I was thinking of using an attribute macro instead of the character sheet attack in order to allow my players to not need their sheets open throughout the game, instead simply selecting the attack macros as token macros on screen. The sheet required two clicks (one for each attack) of two different attacks (since they are first level and will have different damage rolls for the bonus off hand attack) and I was simply trying to make it one click.  Alas, I will see what my players find most enjoyable to use - but you have helped very much in my understanding of the macro roll20 language and allowed me to expand on my use of them!
1454631663

Edited 1454631763
vÍnce
Pro
Sheet Author
Why not just drag/drop the sheet rolls to the quick bar?  You can even create a macro that includes multiple attacks by including their attack button names. e.g #2-Dagger-Attack: %{Oephaobar Klirkaigru|repeating_attack_-K93kj8S-2sT0FVTEc6Y_attack_pick} %{Oephaobar Klirkaigru|repeating_attack_-K93kj8S-2sT0FVTEc6Y_attack_pick}