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

Macro with Damage Button

February 19 (4 years ago)

Hey Guys!

I'm facing some problems building a macro for a custom character sheet.

The macro so far is:

&{template:default}

{{name=Langschwert}}

{{Action=*@{character_name} greift mit seinem **Langschwert** an.*}}

{{To Hit=Er würfelt eine [[(1d20+@{str}+@{skill_combat_heavy}) ]] und braucht eine [[ ?{Target AC|0}]]}}

{{Damage=Er verursacht [[(1d10+@{skill_combat_heavy})]] Schaden}}

This works fine but instead of rolling the damage at once I want to click on DAMAGE and then make the roll, like it is in the standard Character Sheets. Anyone here, who knows how to do that?



February 19 (4 years ago)

1. What game are you playing?

2. What character sheet are you using?

February 19 (4 years ago)

{{Damage Roll=[Damage](!
#damage-macro)}}

February 19 (4 years ago)

thx peacekeeper, that works. Took me a while to find out that I have to add the damage makro to the collection and not to the character sheet. Can you explain what !
 stands for?

I think the roll 20 macros are much to complicated, they should add a more comfortable editor.

February 19 (4 years ago)

I'm not a computer guy, all I know is that !
# is needed to make the button work.

February 19 (4 years ago)

Marcel K. said:

thx peacekeeper, that works. Took me a while to find out that I have to add the damage makro to the collection and not to the character sheet. Can you explain what !
 stands for?

I think the roll 20 macros are much to complicated, they should add a more comfortable editor.

! is the start of an API command -- how the game recognizes that you're calling a script (or in this case calling a button)


 is the html entity for a carriage return -- the same as pressing the 'return' key on your keyboard.

So putting the whole thing together:

    Whatever is inside [ ] is the text that appears in chat

    Whatever is inside ( ) is the chat command that is entered when you click on the text created by the [ ] 

    ! Tells the game to call a command, which doesn't do anything if there are no letters immediately after

    
 adds a carriage return

    #damage-macro is the name of the macro you want to call

February 20 (4 years ago)

This uses chat menus to accomplish it in the Roll20 sheet. These are entered as Ability macros on the PC character sheet for "Rodi". The first macro is called Attack_Javelin and has:

&{template:default} {{name=Attack with Javelin}} {{Roll=[[1d20+@{strength_mod}[STR]+@{pb}[PROF]]]}} {{Roll damage:=[1d6](~Rodi|Javelin_Damage)}} {{[Javelin](https://i.imgur.com/cn9dmxZ.jpg)}}


You have the option to click the damage and roll it from the chat window and put that second entry in the window by calling the 'Javelin_Damage' macro in the same character sheet:

&{template:default} {{name=Javelin damage}} {{Piercing=[[1d6+@{strength_mod}[STR]]]}}

It works pretty well, and is clear to read in the chat window.

I hope that might help,


M

February 20 (4 years ago)

Thank you guys I think I got it. I wonder if it is possible to roll directly from the () without calling a second macro. Why doesn't just

{{Roll damage:=[1d6](/roll1d6)}}

work?

February 20 (4 years ago)

Marcel K. said:

Thank you guys I think I got it. I wonder if it is possible to roll directly from the () without calling a second macro. Why doesn't just

{{Roll damage:=[1d6](/roll1d6)}}

work?

Try this:

{{Roll damage:=[1d6](!
/roll 1d6)}}

The '
' adds a carriage return to the button before the /roll 1d6 command to put it on a new line. The ! is also necessary for the game to parse it correctly, otherwise it attempts to open it in the same page or something.



February 20 (4 years ago)

Do you mean like this?

&{template:default} {{name=Attack with Javelin}} {{Roll=[[1d20+@{strength_mod}[STR]+@{pb}[PROF]]]}} {{Piercing damage=[[1d6+@{strength_mod}[STR]]]}}

You'd see the attack roll and the damage all at once that way.

February 21 (4 years ago)


Markie said:

Do you mean like this?

&{template:default} {{name=Attack with Javelin}} {{Roll=[[1d20+@{strength_mod}[STR]+@{pb}[PROF]]]}} {{Piercing damage=[[1d6+@{strength_mod}[STR]]]}}

You'd see the attack roll and the damage all at once that way.


No. He wanted the damage roll to be done separately. Which I underst, I do it pretty much the same way but using powercards. This way damage is only rolled if you hit instead of missing and seeing you did maximum damage.