Difference between revisions of "Chat Menus"
From Roll20 Wiki
Andreas J. (Talk | contribs) (New example) |
Andreas J. (Talk | contribs) m |
||
Line 1: | Line 1: | ||
+ | {{main|Complete Guide to Macros & Rolls}} | ||
+ | |||
[[File:Chat-menus-game-utils.png|right|thumbnail|200px|Example of a '''Chat Menus''' and it's buttons]]''(Credit for the guide goes to [[keith|KeithCurtis']] original {{forum|permalink/5927072/ forum post}})'' | [[File:Chat-menus-game-utils.png|right|thumbnail|200px|Example of a '''Chat Menus''' and it's buttons]]''(Credit for the guide goes to [[keith|KeithCurtis']] original {{forum|permalink/5927072/ forum post}})'' | ||
Line 9: | Line 11: | ||
If you have a bunch of commonly used macros, rather than clutter up your map area with buttons, make a button that calls a menu of buttons into the chat area. This way you can call up a huge array of options with only a single extra click. I have several of these, categorized by use. Some examples are posted below. | If you have a bunch of commonly used macros, rather than clutter up your map area with buttons, make a button that calls a menu of buttons into the chat area. This way you can call up a huge array of options with only a single extra click. I have several of these, categorized by use. Some examples are posted below. | ||
− | To make a Chat Menu, use a [[Roll Template]]. Because the formatting of Roll Templates, the appearance of a Chat Menu can vary widely from game to game. In general, though, the code is remarkably similar: | + | To make a Chat Menu, it's smart to use a [[Roll Template]] to structure the Chat Menu. Because the formatting of Roll Templates, the appearance of a Chat Menu can vary widely from game to game. In general, though, the code is remarkably similar: |
{{NavMacroDocs}} | {{NavMacroDocs}} | ||
<pre style="overflow:auto;" data-language="javascript"> | <pre style="overflow:auto;" data-language="javascript"> | ||
− | [command name]( | + | [command name](~macro-name) |
</pre> | </pre> | ||
Default button syntax to reference a [[Macro]] in the {{collections}}-tab —You probably don't need to use this for a Chat Menu. Use one of the versions below. | Default button syntax to reference a [[Macro]] in the {{collections}}-tab —You probably don't need to use this for a Chat Menu. Use one of the versions below. | ||
− | If you use the | + | ==Roll Button/Character Ability== |
+ | Normally. Roll Buttons & character abilities are referenced with <code>%{character-name|ability-name}</code>. | ||
+ | |||
+ | If you use the {{forum|permalink/7605679/ macro character sheet tip}} and save the Chat menus macro on the character sheet, the format as you can skip the part about referencing the character name or use <code>selected</code>/<code>target</code>: | ||
<pre style="overflow:auto;"> | <pre style="overflow:auto;"> | ||
− | [command name](~ | + | [command name](~ability-name) |
</pre> | </pre> | ||
− | + | By keeping your macros on a sheet along with the Chat Menu macro itself, you not only gain the advantage of transportability to new campaigns, you also ensure that nothing breaks once you transport it. The macro it's calling comes right along with it. | |
− | + | ||
− | If you want to reference a macro that is on a character sheet (an "Ability"), but you are not writing the macro on the same sheet, you can reference the ability with this format (Assuming that your referenced sheet | + | If you want to reference a macro that is on a character sheet (an "Ability"), but you are not writing the macro on the same sheet, you can reference the ability with this format (Assuming that your referenced a sheet named "Alice"). normally it would be referenced with <code>%{Alice|ability-name}</code>: |
<pre style="overflow:auto;"> | <pre style="overflow:auto;"> | ||
− | [command name](~ | + | [command name](~Alice|ability-name) |
</pre> | </pre> | ||
− | Button syntax to reference an Ability on another character sheet, such as a | + | Button syntax to reference an Ability on another character sheet, such as a {{forum|permalink/7605679/ Macro Character Sheet}}. |
− | If your macro is a loose, global | + | ==Global Macro== |
+ | If your macro is a loose, global [[Macro]] saved in the {{collections}}-tab , the code is a little more arcane, since you need to use [[Complete_Guide_to_Macros_%26_Rolls#HTML_replacement|HTML replacements]]. Normally calling the macro would be <code>#macro-name</code>, but this is the button: | ||
<pre style="overflow:auto;"> | <pre style="overflow:auto;"> | ||
− | [command name](!&#13;#macro | + | [command name](!&#13;#macro-name) |
</pre> | </pre> | ||
Button syntax to reference a Macro in the collections tab. Try to use only in Abilities, not Macros, since Macros will revert the [[Complete_Guide_to_Macros_%26_Rolls#HTML_replacement|HTML replacement]] if you need to edit. | Button syntax to reference a Macro in the collections tab. Try to use only in Abilities, not Macros, since Macros will revert the [[Complete_Guide_to_Macros_%26_Rolls#HTML_replacement|HTML replacement]] if you need to edit. | ||
+ | |||
+ | |||
+ | ==Repeating Sections== | ||
+ | {{forum|permalink/8867823/ This post}} shows how to make buttons work for repeating sections. | ||
+ | |||
+ | ==Other== | ||
+ | the following code supposedly works in some places | ||
+ | <pre style="overflow:auto;"> | ||
+ | [command name](#mightwork) | ||
+ | </pre> | ||
Note also, that you can embed a Roll Command(i.e <code>/r 3d6+5</code>) into the API button instead of a macro, if you simply have a bit of code you use over and over, but a better practice (at least I have found) is to keep as much code in macros as possible, so that if you use the same command in different places, you only have to edit the original if you later decide to change how something works. If it's just an API call (a script call, beginning with "!"), it's pretty safe to pop in as-is. | Note also, that you can embed a Roll Command(i.e <code>/r 3d6+5</code>) into the API button instead of a macro, if you simply have a bit of code you use over and over, but a better practice (at least I have found) is to keep as much code in macros as possible, so that if you use the same command in different places, you only have to edit the original if you later decide to change how something works. If it's just an API call (a script call, beginning with "!"), it's pretty safe to pop in as-is. | ||
Here are some Screenshots. These use the [[Shaped]] Sheet, which formats buttons as in-line text links. If you prefer that to the default "Big Pink Buttons" used by most other sheets on Roll20, use [https://app.roll20.net/forum/permalink/7455586/ this tip] to style them for the [[D&D 5E by Roll20]] template, or [https://app.roll20.net/forum/post/7129900/css-makeover-for-default-template this tip] to style them for the [[Roll_Templates#Default|default template]]: | Here are some Screenshots. These use the [[Shaped]] Sheet, which formats buttons as in-line text links. If you prefer that to the default "Big Pink Buttons" used by most other sheets on Roll20, use [https://app.roll20.net/forum/permalink/7455586/ this tip] to style them for the [[D&D 5E by Roll20]] template, or [https://app.roll20.net/forum/post/7129900/css-makeover-for-default-template this tip] to style them for the [[Roll_Templates#Default|default template]]: | ||
− | [[File:Chat-menus-game-utils.png|left|thumbnail|400px|]] | + | [[File:Chat-menus-game-utils.png|left|thumbnail|400px| the macro for this is down the page]] |
[[File:Chat-menus-game-utils-2.png|right|thumbnail|400px|]] | [[File:Chat-menus-game-utils-2.png|right|thumbnail|400px|]] | ||
<br><br><br><br><!-- extra linebreaks to place codeblock after the two images --> | <br><br><br><br><!-- extra linebreaks to place codeblock after the two images --> | ||
Line 55: | Line 70: | ||
<br><br><br><br> | <br><br><br><br> | ||
− | = | + | =Examples= |
− | + | Examples of Chat Menus. Please share yours here | |
− | == | + | ===Global Macro menu=== |
− | + | A menu showing the GM buttons for various global macros they have saved on the {{collections}}-tab. Skipping the Chat menu could could roll <code>#pcstat</code> & <code>#pcpp</code> directly in the {{Text Chat}}. | |
+ | |||
+ | <pre style="overflow:auto;"> | ||
+ | /w gm &{template:default} {{name=Macro Chat Menu }} {{[PC overview](!&#13;#pcstat)= [Passive Pers.](!&#13;#pcpp) }} {{ [Wild Magic](!&#13;#wildmagictable)= [Passive Inv.](!&#13;#investigation)}} | ||
+ | </pre> | ||
===PF2E Character Roll Menu=== | ===PF2E Character Roll Menu=== | ||
Line 80: | Line 99: | ||
===5E API Menu=== | ===5E API Menu=== | ||
+ | '''Sample code for the Utility Macro:''' | ||
<pre style="overflow:auto;"> | <pre style="overflow:auto;"> | ||
/w gm &{template:5e-shaped} {{title=Utility Menu}} {{text_big=[Configure Shaped Options](!shaped-config) | /w gm &{template:5e-shaped} {{title=Utility Menu}} {{text_big=[Configure Shaped Options](!shaped-config) |
Revision as of 20:31, 21 March 2021
Main Page: Complete Guide to Macros & Rolls
Chat Menus is a Clever trick for any Roll20 users, to create a Menu for yourself, where you have shortcuts to all the macros, API commands, and dice rolls you want, accessible from a single macro.
Contents |
Creating Chat Menus
Although implied by the wiki, and used by many API scripts, Chat Menus are very easy to make using API buttons (which do not actually use the API—anyone can make and use them).
If you have a bunch of commonly used macros, rather than clutter up your map area with buttons, make a button that calls a menu of buttons into the chat area. This way you can call up a huge array of options with only a single extra click. I have several of these, categorized by use. Some examples are posted below.
To make a Chat Menu, it's smart to use a Roll Template to structure the Chat Menu. Because the formatting of Roll Templates, the appearance of a Chat Menu can vary widely from game to game. In general, though, the code is remarkably similar:
Macro Creation
- Complete Guide to Macros & Rolls
- q Text Chat
- Dice Reference
- Order of Operations
- Macros
- Token Reference
- Character Reference
- Roll Templates
- Roll Table
Advanced
- Formatting
- HTML Replacement
- Chat Menus
- Hidden Rolls
- Advanced Macro Tips
- API Commands
- Char Sheet Creation
- External tools
Misc.
[command name](~macro-name)
Default button syntax to reference a Macro in the l Collections-tab —You probably don't need to use this for a Chat Menu. Use one of the versions below.
Roll Button/Character Ability
Normally. Roll Buttons & character abilities are referenced with %{character-name|ability-name}
.
If you use the macro character sheet tip(Forum) and save the Chat menus macro on the character sheet, the format as you can skip the part about referencing the character name or use selected
/target
:
[command name](~ability-name)
By keeping your macros on a sheet along with the Chat Menu macro itself, you not only gain the advantage of transportability to new campaigns, you also ensure that nothing breaks once you transport it. The macro it's calling comes right along with it.
If you want to reference a macro that is on a character sheet (an "Ability"), but you are not writing the macro on the same sheet, you can reference the ability with this format (Assuming that your referenced a sheet named "Alice"). normally it would be referenced with %{Alice|ability-name}
:
[command name](~Alice|ability-name)
Button syntax to reference an Ability on another character sheet, such as a Macro Character Sheet(Forum).
Global Macro
If your macro is a loose, global Macro saved in the l Collections-tab , the code is a little more arcane, since you need to use HTML replacements. Normally calling the macro would be #macro-name
, but this is the button:
[command name](! #macro-name)
Button syntax to reference a Macro in the collections tab. Try to use only in Abilities, not Macros, since Macros will revert the HTML replacement if you need to edit.
Repeating Sections
This post(Forum) shows how to make buttons work for repeating sections.
Other
the following code supposedly works in some places
[command name](#mightwork)
Note also, that you can embed a Roll Command(i.e /r 3d6+5
) into the API button instead of a macro, if you simply have a bit of code you use over and over, but a better practice (at least I have found) is to keep as much code in macros as possible, so that if you use the same command in different places, you only have to edit the original if you later decide to change how something works. If it's just an API call (a script call, beginning with "!"), it's pretty safe to pop in as-is.
Here are some Screenshots. These use the Shaped Sheet, which formats buttons as in-line text links. If you prefer that to the default "Big Pink Buttons" used by most other sheets on Roll20, use this tip to style them for the D&D 5E by Roll20 template, or this tip to style them for the default template:
Examples
Examples of Chat Menus. Please share yours here
A menu showing the GM buttons for various global macros they have saved on the l Collections-tab. Skipping the Chat menu could could roll #pcstat
& #pcpp
directly in the q Text Chat.
/w gm &{template:default} {{name=Macro Chat Menu }} {{[PC overview](! #pcstat)= [Passive Pers.](! #pcpp) }} {{ [Wild Magic](! #wildmagictable)= [Passive Inv.](! #investigation)}}
PF2E Character Roll Menu
A Chat menu that shows the attributes of a character, along with buttons to roll each, + initiative. Also shows the name of the character in the title. Must select a token connected to a sheet to work. Otherwise replace selected
-mentions with the character's name.
&{template:default} {{name=Chat Menu: @{selected|character_name} }} {{Rolls=[Initiative](~selected|INITIATIVE) }} {{[STR](~selected|STR) @{selected|strength}= }} {{[DEX](~selected|DEX) @{selected|dexterity}= [Reflex](~selected|REF) }} {{[CON](~selected|CON) @{selected|constitution}= [Fortitude](~selected|FORT) }} {{[INT](~selected|INT) @{selected|intelligence}= }} {{[WIS](~selected|WIS) @{selected|wisdom}= [Will](~selected|WILL) }} {{[CHA](~selected|CHA) @{selected|charisma}= }}
Same macro, but in a readable form( remove linebreaks to make it work again):
&{template:default} {{name=Chat Menu: @{selected|character_name} }} {{Rolls=[Initiative](~selected|INITIATIVE) }} {{[STR](~selected|STR) @{selected|strength}= }} {{[DEX](~selected|DEX) @{selected|dexterity}= [Reflex](~selected|REF) }} {{[CON](~selected|CON) @{selected|constitution}= [Fortitude](~selected|FORT) }} {{[INT](~selected|INT) @{selected|intelligence}= }} {{[WIS](~selected|WIS) @{selected|wisdom}= [Will](~selected|WILL) }} {{[CHA](~selected|CHA) @{selected|charisma}= }}
5E API Menu
Sample code for the Utility Macro:
/w gm &{template:5e-shaped} {{title=Utility Menu}} {{text_big=[Configure Shaped Options](!shaped-config) **Import Spells** [Spells](!shaped-spells) | [Remove All Spells](!shaped-remove-spell --all) [Expand Spells](!shaped-expand-spells) **Import Monsters** [Monster](!shaped-monsters) | [Replace and Overwrite Monster](!shaped-monsters --replace) [From Statblock](!shaped-import-statblock) | [From Token Name](!shaped-import-by-token) **Character Creation** [Character Builder](~Character-Builder) **Create Token Macro Buttons** [Attacks](!shaped-abilities --attacks) | [Actions](!shaped-abilities --actions) | [Reactions](!shaped-abilities --reactions) [Traits](!shaped-abilities --traits) | [Racial Traits](!shaped-abilities --racialTraits) [Class Features](!shaped-abilities --classFeatures) | [Feats](!shaped-abilities --feats) [Legendary Actions](!shaped-abilities --legendaryA) | [Lair Actions](!shaped-abilities --lairA) **Setup** [Set Token to Defaults](!shaped-apply-defaults) [Set Default Token](!token-mod --set defaulttoken) [Update to Current Sheet](!shaped-update-character) [Update All-Caution](!shaped-update-character --all) **Rests and Resets** [Short Rest](!shaped-rest --short) | [Long Rest](!shaped-rest --long) **Utility** [Health Aura On](!setattr --sel --USECOLOR|YES !aura update) | [Health Aura Off](!setattr --sel --USECOLOR|NO !aura update) [Door Commands](! #{Macros|Doors}) [Ready Roofs](!RoofReady) [Summon Duplicates](~Summon) }}
Repeating Section
Link to a repeating section roll button, of a character we are referencing by character ID.
[menutext](~-MUlgDDvkwuV3fp3DH2C|repeatingability-mwgsob0-zzdesbyljzy_roll)
Related Pages
See Also
- Menu Maker(Forum) by Scott C. - API to generate Chat Menus
- Universal Chat Menus(Forum) by GiGs - another API to generate Chat Menus