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

Making menu-based macros show the entire roll by default?

April 26 (7 years ago)

Edited April 28 (7 years ago)
Problem fixed! Thank you for the help.
Note for searches: This thread has macros for including advantage/disadvantage and other modifiers into a single attack roll without hiding the roll itself, as well as a macro for rolling any single dice and adding a bonus

Battle Axe Attack
/roll ?{Attack|
Standard, [Attack] 1d20+7|
Advantage, [Attack w. Advantage] 2d20kh1 +7|
Disadvantage, [Attack w. Disadvantage] 2d20kl1 +7|
Standard+Bless, [Attack w. Bless] 1d20+1d4+7|
Advantage+Bless, [Attack w. Advantage+Bless] 2d20kh1 +2d4kh1 +7|
Disadvantage+Bless, [Attack w. Disadvantage+Bless] 2d20kl1 +2d4kl1 +7}

Rolling dice
/roll ?{Dice|d4|d6|d8|d10|d12|d20|d100} + ( ?{Modifier|0} )

How do I make a menu-based macro show the entire roll by default, so that you dont have to hover over the result, to see the entire roll? As per the image, when I use a macro, get the menu and click to roll, I only get the result but I really just want it to include the entire series of roll and whatever I clicked in the menu (so it would be Battle Axe Disadvantage, followed by the roll macro for instance) without having to hover over the result. I just want the line in chat, shown by the red color, to look like the line just below it if possible.

A thing to note: We are running 5e DnD and use a home-brew sheet in GoogleSheets which auto updates everything, so we cant link up to sheets native to roll20. Turning over to a native sheet on roll20 is not an option.

Ideally I would want to link up the scripts in roll20 to Google Sheets so I never have to change the macro, but that doesnt seem to be possible - or am I wrong?

TL;DR
1) How do I automatically show the rolls for menu-based macros?
2) Can I use macros to call to specific values from GoogleSheets? If yes; how?

April 27 (7 years ago)
So, without knowing your macro, it is hard to really give you an answer, but I am going to go out on a limb, and say you ill need to define a macro for each possible attack roll combination, and have those macros just be a /roll line, then have your choice macro call those macros, rather than having inline rolls.  Post your macro to this thread, and maybe you can get some more tailored advice.
April 27 (7 years ago)

Edited April 27 (7 years ago)
To precurser this: I am pretty new in the roll20 scripting logic, but Im pretty well versed in Excel, AutoHotkeys and other basic scripting platforms, so excuse me if I sound dumb.

That said, does that mean I could make a macro which just calls other macros and then that would be it?

Also, the macro I used looks like this:

(Name of macro: Battleaxe)
Battle Axe Attack
[[ ?{Attack|
Standard, 1d20+7|
Advantage, 2d20kh1 +7|
Disadvantage, 2d20kl1 +7|
Standard+Bless, 1d20+1d4+7|
Advantage+Bless, 2d20kh1 +2d4kh1 +7|
Disadvantage+Bless, 2d20kl1 +2d4kl1 +7} ]]

this is the macro, which just results in the single yellow number, as noted on the image.


Edit: to avoid confusion, I just realised that I am showing the damage-part of the script in the image, but the code is conceptually identical. We are a pretty diverse party so we have a lot of different buffs which I want to have in the scripts since they are very often used.

Is this what you're looking for?

Battle Axe Attack
/roll ?{Attack|
Standard, 1d20+7|
Advantage, 2d20kh1 +7|
Disadvantage, 2d20kl1 +7|
Standard+Bless, 1d20+1d4+7|
Advantage+Bless, 2d20kh1 +2d4kh1 +7|
Disadvantage+Bless, 2d20kl1 +2d4kl1 +7}
Or do you mean you want to show the choice made as well as the roll? Use labels:

Battle Axe Attack
/roll ?{Attack|
Standard, [Standard] 1d20+7|
Advantage, [Advantage] 2d20kh1 +7|
Disadvantage, [Disadvantage] 2d20kl1 +7|
Standard+Bless, [Standard+Bless] 1d20+1d4+7|
Advantage+Bless, [Advantage+Bless] 2d20kh1 +2d4kh1 +7|
Disadvantage+Bless, [Disadvantage+Bless] 2d20kl1 +2d4kl1 +7}
April 28 (7 years ago)
yah those square brackets are making your roll an inline roll.  In david's option, he is using a /roll command, but the argument that /roll is getting, is dependent on the query.  You can also add text after the roll part for further explainitory output.
April 28 (7 years ago)

Edited April 28 (7 years ago)

David T. said:

Or do you mean you want to show the choice made as well as the roll? Use labels:

Battle Axe Attack
/roll ?{Attack|
Standard, [Standard] 1d20+7|
Advantage, [Advantage] 2d20kh1 +7|
Disadvantage, [Disadvantage] 2d20kl1 +7|
Standard+Bless, [Standard+Bless] 1d20+1d4+7|
Advantage+Bless, [Advantage+Bless] 2d20kh1 +2d4kh1 +7|
Disadvantage+Bless, [Disadvantage+Bless] 2d20kl1 +2d4kl1 +7}

That is amazing! Just what I was looking for. Thanks!

On the same vein of question, I have another problem with my script for just rolling any dice along with a modifier. My macro looks like this currently (after being fixed by your post), but as it stands, I obviously cant imput modifiers. To fix this, I tried adding a "+ ?{Modifier|0}" part after each line (making it look like this: "d4, 1d4 + ?{Modifier|0} |" but curiously, the only modifier I can choose when doing that, is from the rest of the list (so only d6-d100 and not just +1). How can I fix this?

Edit: This is more of an aesthetic thing so less important, but when I roll the macro, I also get an option in the very buttom of the list which is empty and just makes an error message. Why does this happen and how can I get rid of it?

Script for refrence:

Rolling dice
/roll ?{Dice|
d4, 1d4 |
d6, 1d6 |
d8, 1d8 |
d10, 1d10 |
d12, 1d12 |
d20, 1d20 |
d100, 1d100 |}

April 28 (7 years ago)
GiGs
Pro
Sheet Author
API Scripter
On your last question, remove the final | so it becomes
Rolling dice
/roll ?{Dice|
d4, 1d4 |
d6, 1d6 |
d8, 1d8 |
d10, 1d10 |
d12, 1d12 |
d20, 1d20 |
d100, 1d100}
April 28 (7 years ago)

Edited April 28 (7 years ago)
GiGs
Pro
Sheet Author
API Scripter
For your first question, just replace the +7 with the attribute name, like so:

Battle Axe Attack
/roll ?{Attack|
Standard, [Standard] 1d20+@{Attribute}|
Advantage, [Advantage] 2d20kh1 +@{Attribute}|
Disadvantage, [Disadvantage] 2d20kl1 +@{Attribute}|
Standard+Bless, [Standard+Bless] 1d20+1d4+@{Attribute}|
Advantage+Bless, [Advantage+Bless] 2d20kh1 +2d4kh1 +@{Attribute}|
Disadvantage+Bless, [Disadvantage+Bless] 2d20kl1 +2d4kl1 +@{Attribute}}

If the macro is an Ability on the character sheet, the above should work perfectly.
If it's a universal macro, you need to replace @{Attribute} with @{CharacterName|Attribute} or @{selected|Attribute}

Edit: Oh, I misread the question.

If you want to input a different modifier each time, you have two options:

First, enter the world of html replacements as described here, so for ?{Modifier} you'd need to replace the }  with & #125; (remove the space). Then, when you save the macro, never reopen it, or the html entity will become a normal "}" again and you'll need to edit in the html entity again.
Edit 2: of course html replacement messed up my post, i have corrected the text.

Secondly, save your macro as an Ability on a character sheet, and you dont need to worry about html entities being erased when you reopen the macro.

Assuming you create a character sheet called Macros to store these, you can call the macro with %{Macros|MacroName}

G G said:

On your last question, remove the final | so it becomes
Rolling dice
/roll ?{Dice|
d4, 1d4 |
d6, 1d6 |
d8, 1d8 |
d10, 1d10 |
d12, 1d12 |
d20, 1d20 |
d100, 1d100}


You can simplify this to:

Rolling dice
/roll ?{Dice|d4|d6|d8|d10|d12|d20|d100}
April 28 (7 years ago)
GiGs
Pro
Sheet Author
API Scripter
Oh yes, of course, I should have spotted that, haha.

G G said:

For your first question, just replace the +7 with the attribute name, like so
and
Secondly, save your macro as an Ability on a character sheet, and you dont need to worry about html entities.
Thanks for ideas, but unfortunately I cant call an attribute name, since we dont use native character sheets, since we have en extremely well functioning and self-updating sheet in Google Sheets

G G said:
Edit: Oh, I misread the question.

If you want to input a different modifier each time, you have two options:

First, enter the world of html replacements as described here, so for ?{Modifier} you'd need to replace the } with } (only in the Modifier, not the character names above). Then, when you save the macro, never reopen it, or the html entity will become a normal "}" again and you'll need to edit in the html entity again.
I tried doing this a few times in different ways, but I cant seem to get i working. When I change the end bracket with the html code, it seems like the script just doesnt read it  and I end up with what I see in the image

David T. said:

G G said:

On your last question, remove the final | so it becomes
Rolling dice
/roll ?{Dice|
d4, 1d4 |
d6, 1d6 |
d8, 1d8 |
d10, 1d10 |
d12, 1d12 |
d20, 1d20 |
d100, 1d100}


You can simplify this to:

Rolling dice
/roll ?{Dice|d4|d6|d8|d10|d12|d20|d100}

Thanks! How does that affect whatever Im going to do to solve the modifier problem? Just add the extra code before the | ? 

Mads Rønne said:

David T. said:

G G said:

On your last question, remove the final | so it becomes
Rolling dice
/roll ?{Dice|
d4, 1d4 |
d6, 1d6 |
d8, 1d8 |
d10, 1d10 |
d12, 1d12 |
d20, 1d20 |
d100, 1d100}


You can simplify this to:

Rolling dice
/roll ?{Dice|d4|d6|d8|d10|d12|d20|d100}

Thanks! How does that affect whatever Im going to do to solve the modifier problem? Just add the extra code before the | ? 


I must admit I don't fully understand your modifier problem, unless it is just the ol' nested roll queries problem. I'm not sure I can answer your question.

My post was simply addressing that when you have options in a roll query, you don't have to include both the text presented to the player and a return value. If you only have one value for each option, and no comma, then the text presented IS the return value.
April 28 (7 years ago)

Edited April 28 (7 years ago)

David T. said:

I must admit I don't fully understand your modifier problem, unless it is just the ol' nested roll queries problem. I'm not sure I can answer your question.

My post was simply addressing that when you have options in a roll query, you don't have to include both the text presented to the player and a return value. If you only have one value for each option, and no comma, then the text presented IS the return value.

My problem is that I want to be able to choose a dice and add a modifier to that roll (so, for instance choose a d20 and add 8 to it) - just because its faster than writing /roll 1d100+8 for me (because Im a slow writer and dont have a numpad).

When I have my macro as is, I cant add a modifier to the roll, because the script apparantly stops at the first bracket it meets. I tried using the HTML code for the end bracket instead, but the code didnt seem to parse as per the image above.

Edit: I have a macro for just d20 which looks like this: /roll 1d20 + ?{Modifier|0} - but I want to include all the other dice in that script as well, if possible.
April 28 (7 years ago)

Edited April 28 (7 years ago)
GiGs
Pro
Sheet Author
API Scripter

Mads Rønne said:

I tried doing this a few times in different ways, but I cant seem to get i working. When I change the end bracket with the html code, it seems like the script just doesnt read it  and I end up with what I see in the image

html entities are a real pain, but are the primary way to solve your issue:

Follow these instructions:

  1. Create a new character sheet, call it Macros. (You wont be storing any attributes on it).
  2. Go to the Attributes and Abilities tab, and add an ability, call it Roll.
  3. Enter the following text, but (only in the {Modifier}, replace the end } with & #125; (remove the spaace).
  4. here's a screenshot of what that should look like:


You can then add this to your macro bar (see bottom of screenshot), so you can launch it with the click of a button. Or you can type %{Macros|Roll} in chat to call it.

Try this out.

If you make sure the character is editable by all players, everyone can use the macro.

As an alternative, you can paste the macro text to the normal Macros and make it available for players. But if you do it this way, whenever you open it to edit, all those & #125; entities will be replaced by } and you'll have to rewrite the whole thing. So the character sheet is the more robust way to go.
If I understand you rightly, you can do this:

Battle Axe Attack
/roll ?{Attack|
Standard, [Standard] 1d20 + 0*|
Advantage, [Advantage] 2d20kh1 +|
Disadvantage, [Disadvantage] 2d20kl1 +|
Standard+Bless, [Standard+Bless] 1d20+1d4 +|
Advantage+Bless, [Advantage+Bless] 2d20kh1 +2d4kh1 +|
Disadvantage+Bless, [Disadvantage+Bless] 2d20kl1 +2d4kl1} ( ?{Modifier|0} )

Even if you choose Standard, it'll ask for a Modifier, but if you do choose Standard it'll multiply that Modifier by 0, so it doesn't get added. I put the modifier in parentheses because the dice-roller sometimes gets confused when encountering things like "++2," but it can handle "+(+2)" just fine.
Going back over it, I don't think I did understand rightly. Maybe this is what you want:

Battle Axe Attack
/roll ?{Attack|
Standard, [Standard] 1d20|
Advantage, [Advantage] 2d20kh1|
Disadvantage, [Disadvantage] 2d20kl1|
Standard+Bless, [Standard+Bless] 1d20+1d4|
Advantage+Bless, [Advantage+Bless] 2d20kh1 +2d4kh1|
Disadvantage+Bless, [Disadvantage+Bless] 2d20kl1 +2d4kl1} + ( ?{Modifier|0} )

Now the Modifier will apply to every roll.
April 28 (7 years ago)

Edited April 28 (7 years ago)

David T. said:

Going back over it, I don't think I did understand rightly. Maybe this is what you want:

Battle Axe Attack
/roll ?{Attack|
Standard, [Standard] 1d20|
Advantage, [Advantage] 2d20kh1|
Disadvantage, [Disadvantage] 2d20kl1|
Standard+Bless, [Standard+Bless] 1d20+1d4|
Advantage+Bless, [Advantage+Bless] 2d20kh1 +2d4kh1|
Disadvantage+Bless, [Disadvantage+Bless] 2d20kl1 +2d4kl1} + ( ?{Modifier|0} )

Now the Modifier will apply to every roll.
Thats brilliant and not even for the reason you made it! You just made by evening.

I actually got the attack script working really well further up the thread, but I was still struggling with a different script where I wanted to just keep all the dice in a single script while still being able to add modifiers to the rolls. The last part (adding to the rolls) was a huge obsticle and we tried with brackets and HTML inserts, but you just fixed it by just adding a modifier in the end. Thanks! :)

Edit: First post updated with result and notes for eventual searches for others with similar problems
April 28 (7 years ago)
Andrew C
Marketplace Creator

Mads Rønne said:

G G said:

For your first question, just replace the +7 with the attribute name, like so
and
Secondly, save your macro as an Ability on a character sheet, and you dont need to worry about html entities.
Thanks for ideas, but unfortunately I cant call an attribute name, since we dont use native character sheets, since we have en extremely well functioning and self-updating sheet in Google Sheets
You can create your own abilities on the back tab of the Character Windows, same place you add in Character-Specific Macros
April 28 (7 years ago)
So - uhh - facetious answer inbound - but - if you want a macro to roll a select-able dice with a select-able modifier, you might as well just type the /roll into the chat.  If it has to be a query inside of a larger more complex macro, you could just do a query that lets the user type in any dice roll and modifier, rather than having the list to choose from.

Aranador said:

So - uhh - facetious answer inbound - but - if you want a macro to roll a select-able dice with a select-able modifier, you might as well just type the /roll into the chat.  If it has to be a query inside of a larger more complex macro, you could just do a query that lets the user type in any dice roll and modifier, rather than having the list to choose from.
A fair question. Im slow at writing and combined with not having a numpad while also keeping a tab on 4-6 tabs I sometimes get really slow at writing the /roll macro. So the answer is 2-part; 
1) Its faster for me
2) Its also about learning the logic behind the roll20 syntax, so I can do more efficient macros in the future.

April 29 (7 years ago)

Edited April 29 (7 years ago)

Andrew C said:

You can create your own abilities on the back tab of the Character Windows, same place you add in Character-Specific Macros

Thank you for the suggestion - a solution was found to the problem :) Also, we dont use the roll20 character sheet, because for all other intents and purposes than this specific macro, our own home-made GoogleSheets character sheet is just more efficient since it;
1) automatically calculates everything
2) auto corrects all scores whenever you level up
3) exports certain specific data to a DM sheet for fast and easy overview of specific data our DM uses
4) automatically counts up whenever you spend spell slots or preparation slots, how many open potion slots you have left etc etc etc
5) automatically calculates all DCs and can also handle specific DCs which uses another stat than the rest of your spells/abilities
6) automatically tracks advantage/disadvantage based on your armor, tools and proficiencies
7) probably a lot more which I cant currently recall. Anyway, we like out Google Sheet, so if the choice is between that and macros, Im pretty sure the rest of the group will scrap the macros, however much I like them.