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 .
×
May your rolls be chill this holiday season!
Create a free account

Creating Macro Option Macro

1581840109

Edited 1581840135
I need help creating a macro that lets a player choose from multiple macros. This is to help reduce the amount of "screen space" taken up by macros, or remembering all the names of different macros The macros I am trying to combine are all of the options available to a DnD 5e Paladin for their "Lay on Hands" class feature: &{template:default} {{name=Lay On Hands}} {{@{target|character_name} recovers=[[?{How Many Hit Points?|1}]] Hit Points}} Displays as "[Character name] recovers [input] Hit Points" &{template:default} {{name=Lay on Hands}} {{Paladin spends =[[5*?{How many poisons?|1}]] Points to end [[?{Confirm number of poisons?|1}]] poisons on @{target|character_name}}} Displays as "Paladin spends [5*input_1] points to end [input_2] poisons on [character name]" &{template:default} {{name=Lay on Hands}} {{Paladin spends =[[5*?{How many diseases?|1}]] Points to end [[?{Confirm number of poisons?|1}]] diseases on @{target|character_name}}} Displays as "Paladin spends [5*input_1] points to end [input_2] diseases on [character name]" What I am trying to accomplish is a master macro that prompts the user to choose an option, and then the master macro executes the chosen macro without executing the other ones. I'm also unsure how to recall a previous input without recalling the output (i.e. if input_1 rolls 5*3, I want to recall the "3" without recalling the 5*), guidance on how to accomplish this would be greatly appreciated.
1581840909
GiGs
Pro
Sheet Author
API Scripter
To create nested macros of this nature, you need to master  advanced queries . There's no elegant way to make such macros, and also keep the original macros: you need to make a single giant macro that incorporates all the functions you need, and it's a royal pain. But there is a better way - and most of us who have tried to use advanced queries have given up on them in preference for this approach:  Chat Menus . You keep your original macros, and the chat menu gets printed into chat with buttons for each macro (you can whisper the menu so it doesnt clutter chat for everyone).  I'm also unsure how to recall a previous input without recalling the output (i.e. if input_1 rolls 5*3, I want to recall the "3" without recalling the 5*), guidance on how to accomplish this would be greatly appreciated. I'm not entirely sure what you're asking here. Roll20 macros cannot 'remember' rolls or previous results. If you have an input in the form of a query (eg ?{How Many Poisons?|0}) you can reuse that number later in the same macro just by using the exact name of the query again. Imagine you created a single macro with this text in it: Paladin wants to heal ?{How Many Poisons?|0} Poisons. Paladin heals ?{How Many Poisons?} Poisons. When the play runs it, they will receive a single prompt. Let's say they enter 3. The output in chat will be Paladin wants to heal 3 Poisons. Paladin heals 3 Poisons. If you repeat the same query multiple times in a macro, the user will only be prompted once and they'll all use the same value.
Thanks for the advice on the reusing inputs. I figured it out. As for nesting all of the macros, I found out a way to do it using Abilities on the character Sheet. I used this: &{template:default} {{name=Lay On Hands}}{{Options= [Heal](!
%{paladin|Heal})[Cure Poison](!
%{paladin|Cure-Poison})[Cure Disease](!
%{paladin|Cure-Disease})}}
1581881035
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Unless you are referencing Collections macros, or doing some extremely complex query nesting, you should not need to use html substitutions on abilities. The chat menu link GiGs supplied has examples of syntax for different use cases. If it works, that's great, but you could make editing easier on yourself that way.