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

Custom Macro

So I am trying to build a macro to make it display text from an ability put into a character sheet but I also need it to pop up and give me an option for the dice type I want to roll.  For instance, when executed, it would display the title and description of the ability and also execute a popup where I get to type the dice to roll as 1D6, 1D8, etc.  How can I make that popup happen?  I know it is possible from another game I played awhile ago but I don't have code of the macro.
Assumptions:   Attributes defined on Character Journal "Attributes & Abilities Page". Title1 :   "Title for Ability 1" Text1:  "Text for Ability 1" Macro: (Display Title 1, then Text 1, then provide a drop-down of which die to roll) @{CharacterName|Title1}  @{CharacterName|Text1}  [[?{Prompt for dice| 1d4 |1d6 |1d8 |1d10 | 1d12 |1d20}]] Alternate: (Same as above, but prompt with a text-box the user can fill in, rather than drop-downs) @{CharacterName|Title1} @{CharacterName|Text1} [[ ?{Prompt for dice|1d6} ]] Alternate 2: (Formatted slightly more visually) /me uses @{CharacterName|Title1} Roll: [[ ?{Prompt for dice| 1d4 |1d6 |1d8 |1d10 | 1d12 | 1d20} ]] @{CharacterName|Text1} EDIT:  Forgot my brackets :)
So this is what I got so far. &{template:5eDefault} {{title=Feinting Attack}}{{subheader=Battlemaster Maneuver}}{{freetext=You can expend one superiority dice and use a bonus action on your turn to feint, choosing one creature within 5 feet of you as your target. You have advantage on your next attack roll against that creature. If that attack hits, add the superiority die to the attack's damage roll.}} {{rollname=roll}} ?{Prompt for dice| 1d6,1d8,1d10,1d12,1d20} While it prompts, it doesn't do the actual roll.  How would I make it grab what was prompted for and take my input and do the roll?
{{rollname=roll}} {{roll=[[?{Prompt for dice|1d6|1d8|1d10|1d12|1d20}]]}}
You guys are awesome!  Thank you so much.
Now, how do I add a static modifier to that roll in the macro?  Like say I wanted to add an attribute from the sheet and on the sheet the attribute is dexterity_bonus ?
You could place @{dexterity_bonus} in the [[inline roll]], i.e. after the ?{Prompt for dice}.
So close.  I'm missing something. &{template:5eDefault} {{title=Parry}}{{subheader=Battlemaster Maneuver}}{{freetext=When another creature damages you with a melee attack, you can use your reaction and expend one superiority die to reduce the damage by the number you roll on your superiority die + your Dexterity modifier.}} {{rollname=Roll}} {{roll=[[?{Prompt for dice|1d6|1d8|1d10|1d12}]]@{Character Name|dexterity_mod}}} So what it does is show the roll and the modifier side by side in the chat box which is good.  But how to do make it so that output is added together as the result so it would look like 4+4=8?
Add it in, like so {{roll=[[?{Prompt for dice|1d6|1d8|1d10|1d12}+@{Character Name|dexterity_mod}]]}}
1445884333

Edited 1445884393
Todd
Plus
Thanks! I must have screwed something up before.  I did have the + in there when I was experimenting but it was displaying it on the screen as the dice roll + 4 with the 4 being the value of dexterity_mod ( example: Roll 4 + 4 ).