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

Macros from the dropdown?

Hi all. I have searched a lot in the different posts but nothing is clear to me. Excuse me if I repeat a topic already discussed. I'm not sure if it is possible what I want. I'd like that a macro could be launched from the query dropdown. Is that possible? I have created three macros where some effects are described and I would like those macros to appear in the chat after selecting them in the dropdown. This doesn't work: ?{Wood-elf Magic|Stinging Arrow, #Stinging-arrow|Elf-lights, #Elf-lights|Enchanted Sleep, #Enchanted-sleep} Here is an example of a macro that I would like to see in the chat after clicking on it in the dropdown: &{template:default} {{name=Stinging Arrow}} {{Effect=You can make an arrow flicker as if with a magical fire, making it fly true. Spend a point of Hope when you let loose an arrow and it will fly up to twice its normal range, OR spend a point of Hope after a successful ranged attack using a bow or great bow to produce an automatic Piercing blow.}} I would like to click on an option...  ...and have the macro appear in the chat like this: Regards
You can, but the command compiler processes the entire command at the time it's called, so you have to include HTML replacements in the macro you're calling as well as the drop-down query itself.  Otherwise the macro you're calling with break the drop-down syntax
1595545092
Kraynic
Pro
Sheet Author
If you check out the Stupid Roll20 Tricks thread that is pinned at the top of this forum (the first post is an index), you should look at the chat menu entry.  It is a lot easier to put together and maintain than queries when you are dealing with multiple macros.
1595559676

Edited 1595560569
Oosh
Sheet Author
API Scripter
^^ What these guys said, a chat menu is a superior way of achieving what you want. If, for whatever reason, you really want the Query pop-up version you will need to do this: Save your menu macro as an Ability macro on the character sheet, called bob in this example: ?{Wood-elf Magic|Stinging Arrow, %{bob|StingingArrow}| Elf-lights, %{bob|ElfLights}| Enchanted Sleep, %{bob|EnchantedLights}} You will then need to create the three macros StingingArrow, ElfLights and EnchantedLights on the same sheet as Ability macros. These need to have all { , and | characters replaced with HTML entities (unless those characters are part of an Attribute or Ability call). This will mean these Ability macros only function when called from a Query, they will not work standalone. StingingArrow would look like this: &{template:default} {{name=Stinging Arrow}} {{Effect=You can make an arrow flicker as if with a magical fire, making it fly true. Spend a point of Hope when you let loose an arrow and it will fly up to twice its normal range, OR spend a point of Hope after a successful ranged attack using a bow or great bow to produce an automatic Piercing blow.}} Repeat the process with the other 2 Abilities. Don't forget the commas in the description text! Again, I would recommend the chat menu option, it's much more modular and you can link straight to Abilties which work standalone and don't require HTML entities.
MarkOfTheDragon said: You can, but the command compiler processes the entire command at the time it's called, so you have to include HTML replacements in the macro you're calling as well as the drop-down query itself.  Otherwise the macro you're calling with break the drop-down syntax Kraynic said: If you check out the Stupid Roll20 Tricks thread that is pinned at the top of this forum (the first post is an index), you should look at the chat menu entry.  It is a lot easier to put together and maintain than queries when you are dealing with multiple macros. Oosh said: ^^ What these guys said, a chat menu is a superior way of achieving what you want. If, for whatever reason, you really want the Query pop-up version you will need to do this: Save your menu macro as an Ability macro on the character sheet, called bob in this example: ?{Wood-elf Magic|Stinging Arrow, %{bob|StingingArrow}| Elf-lights, %{bob|ElfLights}| Enchanted Sleep, %{bob|EnchantedLights}} You will then need to create the three macros StingingArrow, ElfLights and EnchantedLights on the same sheet as Ability macros. These need to have all { , and | characters replaced with HTML entities (unless those characters are part of an Attribute or Ability call). This will mean these Ability macros only function when called from a Query, they will not work standalone. StingingArrow would look like this: &{template:default} {{name=Stinging Arrow}} {{Effect=You can make an arrow flicker as if with a magical fire, making it fly true. Spend a point of Hope when you let loose an arrow and it will fly up to twice its normal range, OR spend a point of Hope after a successful ranged attack using a bow or great bow to produce an automatic Piercing blow.}} Repeat the process with the other 2 Abilities. Don't forget the commas in the description text! Again, I would recommend the chat menu option, it's much more modular and you can link straight to Abilties which work standalone and don't require HTML entities. I do think that a chat menu is the best option almost always, but this time I wanted to "call" macros from a dropdown so that (1) the character using the dropdown doesn't reveal all his/her powers showing a list of them and (2) to "save" a message in the chat. I thank all three of you for your quick answers. Oohs, it works just as I wanted, thank you very much for your work. You all are great.
1595603253
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
To keep others from seeing the chat menu, even the GM, begin it with: /w "@{selected|character_name}"  Naturally, this will only work with their token selected, so it works best put into a token action button. The quotes around the name attribute call ensure that it catches names with spaces in them. Remember the space between this and the rest of the macro.
keithcurtis said: To keep others from seeing the chat menu, even the GM, begin it with: /w "@{selected|character_name}"  Naturally, this will only work with their token selected, so it works best put into a token action button. The quotes around the name attribute call ensure that it catches names with spaces in them. Remember the space between this and the rest of the macro. Wow! That's a very good solution! Simple and useful. Thank you very much.