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

Macro to show list of NPC actions

I am using a nested macro I found to show the list of actions that a NPC has when it's token is selected: /w gm&{template:npcaction} {{rname=@{selected|npc_name}}} {{name=Actions}} {{normal=1}} {{description=1:[@{selected|repeating_npcaction_$0_name}](~selected|repeating_npcaction_$0_npc_action) 2:[@{selected|repeating_npcaction_$1_name}](~selected|repeating_npcaction_$1_npc_action) 3:[@{selected|repeating_npcaction_$2_name}](~selected|repeating_npcaction_$2_npc_action) 4:[@{selected|repeating_npcaction_$3_name}](~selected|repeating_npcaction_$3_npc_action) }} My problem is that if there are less than 4 actions on the NPC character sheet, the output gets very ugly: Is there any way to only show as many actions as there actually are, or would that require a far more complicated API script instead of a macro? Bonus question: I want the list of actions to be whispered to GM, but the output of the attack to be visible to the players. Is that possible? Right now I don't really use the buttons the macro produces, but made individual token actions like Attack-1 that does %{selected|repeating_npcaction_$0_npc_action}
1587216425
GiGs
Pro
Sheet Author
API Scripter
That would require an API script unfortunately. For your onus question - arent the buttons already being whispered to you? The /w gm at the start and the yellow background on the chat output suggests they are. Only you see those.
Yes, the list is whispered to me. My problem is that I can either have the list whispered and then the attacks are also whispered, or I can have both being public. What I would love is the list to be whispered and the attacks be public.
1587221477
GiGs
Pro
Sheet Author
API Scripter
That macro doesnt set the attacks to be whispered, something else is doing that. I'm not familiar with the sheet you are using, but is there a setting on your sheet that says "whisper all rolls" ? If so, uncheck that and then use the above macro as a separate ability button: /w gm&{template:npcaction} {{rname=@{selected|npc_name}}} {{name=Actions}} {{normal=1}} {{description=1:[@{selected|repeating_npcaction_$0_name}](~selected|repeating_npcaction_$0_npc_action) 2:[@{selected|repeating_npcaction_$1_name}](~selected|repeating_npcaction_$1_npc_action) 3:[@{selected|repeating_npcaction_$2_name}](~selected|repeating_npcaction_$2_npc_action) 4:[@{selected|repeating_npcaction_$3_name}](~selected|repeating_npcaction_$3_npc_action) }} That way this macro will be whispered to you, and the buttons wont whisper.
1587221718
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The action/attack whispers are due to the sheet setting, the visibility of the initial macro is controlled by its syntax. Try this macro, it also has instructions on how to prettify the output and reduce the occurrence of error messages. NPC Statblock Chat Menu for D&D 5e sheet — No API required!
keithcurtis said: The action/attack whispers are due to the sheet setting, the visibility of the initial macro is controlled by its syntax. Try this macro, it also has instructions on how to prettify the output and reduce the occurrence of error messages. NPC Statblock Chat Menu for D&D 5e sheet — No API required! Thank you so much for this, Keith! This statblock macro was exactly what I needed! I managed to get Stylus installed and then also copied several other macros of yours from that post. The added map row one is also very useful for my campaign (bought module, lots of pages), although I am still struggling with ordering the pages on the multi-row version.
1587229202
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Yeah, it can be really persnickety. Sometimes, I'll just temporarily toggle off all styles when I need to do a lot of re-ordering. I've tried building a vertical menu version, but I suspect it's beyond my current skill level.