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

[D&D5e Character Sheet] Need help, re: Using Query Macros to select and display NPC attacks / actions -- halfway successful

Hello! I'm attempting a macro to list all 10 of the NPC attacks (D&D 5e Unshaped Character Sheet), and then depending on what is chosen, it calls the attack / action macro and displays in chat. The reason I'm attempting this is, rather than create specific token macros for *each* character, I'm hoping to have one global macros that does lists the 10 attacks, the DM/GM picks one, then the attack/action macro is displayed in chat. So far the macro I've created is (this only lists Actions 2 and Actions 2 -- once I figure this out, I'll expand it to list 3 - 10 as well): ?{Which attack?|@{selected|npc_action_name1}, #NPCAction1 |@{selected|npc_action_name2}, #NPCAction2  } The problem I'm having seems to be in the bold  portion.  I've attempted various calls here, and nothing works.  Here's the results I get for the above: Upon hitting Test Macro, the Input Value window pops up as expected, and the first 2 Actions are listed in the drop down, as expected.  So far so good! Upon choosing Action1 I get "#NPCAction1" in the chat window (without the quotes); upon choosing Action2 I get "#NPCAction2" in the chat window (without the quotes) What I want to see is the results of the %{selected|NPCAction1} or %{selected|NPCAction2} macro (i.e., the various NPC Action macros) Anyone see what's missing in the second parts of the above macro, or another way to accomplish the above?  Thanks!
Because of the order of operations a macro call cannot be nested inside of a query. 
Ed S. said: Because of the order of operations a macro call cannot be nested inside of a query.  Thanks Ed!  I was worried about that :< . Any way to accomplish the same another way?  I'd rather not have to create macros for each of the 10 actions / attacks if I can avoid it.  Thanks!
How many creatures use all 10? The beholder is the only creature I can think that has that many actions, most only have one or two. Regardless, there a number of ways around the issue. One is to make token actions for each of the NPC actions, then when you select the token all the options are available at the top. Use that character sheet with the list of NPC token actions as a template for your monsters and copy it each time you want to add a new creature.  The one I use only has the first two coded up as that covers most thing.  Trying to make a drop down that calls an attribute or a macro or a roll will not work. Check out the advanced usage section in the wiki for more info  here .
Thanks again Ed. I did check the Wiki, but will look again. I recognize most don't use all 10.  Most of mine have 1 or 2, but I do have some with 3 - 4. I think what you suggest below is the best option.  The other I've played with is: a) have a macro to list all 10 actions (I've completed this macro); then b) manually type the %{selected|NPCActionX} in the chat area. Thanks again! Ed S. said: One is to make token actions for each of the NPC actions, then when you select the token all the options are available at the top. Use that character sheet with the list of NPC token actions as a template for your monsters and copy it each time you want to add a new creature.  The one I use only has the first two coded up as that covers most thing. 
1452974074

Edited 1452977608
For situations like this, my general recommendation is to create a "menu" Ability macro using API Command Buttons (using them in this way does not require access to the API). Try this out: /w gm &{template:5eDefault} {{outputall=1}} {{title=Actions}} {{ [@{selected|npc_action_name1} ](!
%{selected|NPCAction1}) }} {{ [@{selected|npc_action_name2} ](!
%{selected|NPCAction2}) }} {{ [@{selected|npc_action_name3} ](!
%{selected|NPCAction3}) }} {{ [@{selected|npc_action_name4} ](!
%{selected|NPCAction4}) }} {{ [@{selected|npc_action_name5} ](!
%{selected|NPCAction5}) }} {{ [@{selected|npc_action_name6} ](!
%{selected|NPCAction6}) }}
Just tested it and works amazing!  It lists the various actions, and by clicking on them I can then 'activate' that actions.  My thanks Silvyre, and everyone for their input!
FYI -- if people want to see the output of  Silvyre 's awesome macro, it's pasted below.  Each item is 'clickable', so it rolls that attack:
Annnd, let me just update that macro with the new  Ability Command Button syntax... :) /w gm &{template:5eDefault} {{outputall=1}} {{title=Actions}} {{ [@{selected|npc_action_name1} ](~selected|NPCAction1) }} {{ [@{selected|npc_action_name2} ](~selected|NPCAction2) }} {{ [@{selected|npc_action_name3} ](~selected|NPCAction3) }} {{ [@{selected|npc_action_name4} ](~selected|NPCAction4) }} {{ [@{selected|npc_action_name5} ](~selected|NPCAction5) }} {{ [@{selected|npc_action_name6} ](~selected|NPCAction6) }} Now, you can it as a macro under the My Settings tab of the Sidebar, if you'd like!
Silvyre said: Annnd, let me just update that macro with the new  Ability Command Button syntax... :) /w gm &{template:5eDefault} {{outputall=1}} {{title=Actions}} {{ [@{selected|npc_action_name1} ](~selected|NPCAction1) }} {{ [@{selected|npc_action_name2} ](~selected|NPCAction2) }} {{ [@{selected|npc_action_name3} ](~selected|NPCAction3) }} {{ [@{selected|npc_action_name4} ](~selected|NPCAction4) }} {{ [@{selected|npc_action_name5} ](~selected|NPCAction5) }} {{ [@{selected|npc_action_name6} ](~selected|NPCAction6) }} Now, you can it as a macro under the My Settings tab of the Sidebar, if you'd like! You're just a big bag of awesomeness :) !!