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

Selectable Legendary Actions Macro - minor error - any ideas?

I've altered a common Legendary Actions macro to become selectable. Everything works fine except I get 3 error messages before it outputs exactly what I want: No attribute was found for @{Adult Blue Dragon|selected} Also, on a side note, what does @{selected|charname_output} do at the end of the Legendary Macro? Ive tried removing it and nothing changes. Here is my macro: (PS also had version with @{selected|charname_output} at the end, it made no difference) @{selected|wtype}&{template:npcaction} {{name=@{selected|npc_name}}} {{rname=Legendary Actions}} {{description=The @{selected|npc_name} can take @{selected|npc_legendary_actions} legendary actions, choosing from the options below. [@{selected|repeating_npcaction-l_$0_name}](~@{selected}|repeating_npcaction-l_$0_npc_action) [@{selected|repeating_npcaction-l_$1_name}](~@{selected}|repeating_npcaction_$3_npc_action) [@{selected|repeating_npcaction-l_$2_name}](~@{selected}|repeating_npcaction-l_$2_npc_action) Only one legendary option can be used at a time and only at the end of another creature's turn. The @{selected|npc_name} regains spent legendary actions at the start of its turn.}} Further clarification: I use (~@{selected}|repeating_npcaction_$3_npc_action) for legendary action 2 because it performs the actual move instead of just textually saying it does. (Dragon Tail Attack) And yes this was when i used it with the adult blue dragon - message changes to whichever creature the legendary actions is for. Show less REPLY
Also is there a way to do 2 actions on one button? Would love to have buttons output descriptions and attacks.
1619366211

Edited 1619366293
The error is because that attribute call is 2 different first halves of an attribute instead of an actual attribute.&nbsp;&nbsp; @{selected|npc_ac} vs @{Adult Blue Dragon|npc_ac} as example.&nbsp;&nbsp; I think you would benefit immensely from&nbsp; <a href="https://wiki.roll20.net/5e_OGL_Roll_Templates" rel="nofollow">https://wiki.roll20.net/5e_OGL_Roll_Templates</a> IF you are using the 5e by roll20 sheet that is...otherwise find the wiki for your sheet templates.&nbsp;&nbsp; Charnameoutput will do nothing if your sessions master sheet settings has hidenames to yes or if your individual npc sheets have hide names turned on.&nbsp;&nbsp; Can't really go into depth on your macro cause its a gigantic mess of incomplete information from what I can tell.&nbsp; The default sheets are pretty simple buttons, if you are trying to make npc token actions just click the button on the sheet then go to chat and use the shift+up button combo to pull the last chat command and paste it into a token action for the monster.&nbsp; keep in mind that if your macros are going to use the repeating row syntax then whenever you move anything on the sheet thats moveable, it will misallign them all on you.&nbsp;&nbsp; Also make your macros in notepad++ and paste them over, so that you can more easily copy stuff you've already done for future projects or have a backup of your work if you accidentally delete something.&nbsp;&nbsp;
@{selected|wtype} &amp;{noerror} &amp;{template:npcaction} {{name=@{selected|npc_name}}} {{rname=Legendary Actions}} {{description=The @{selected|npc_name} can take @{selected|npc_legendary_actions} legendary actions, choosing from the options below. [@{selected|repeating_npcaction-l_$0_name}](~selected|repeating_npcaction-l_$0_npc_action) [@{selected|repeating_npcaction-l_$1_name}](~selected|repeating_npcaction_$3_npc_action) [@{selected|repeating_npcaction-l_$2_name}](~selected|repeating_npcaction-l_$2_npc_action) Only one legendary option can be used at a time and only at the end of another creature's turn. The @{selected|npc_name} regains spent legendary actions at the start of its turn.}} 1. You want to add &amp;{noerror} to suppress error messages.&nbsp; FYI there's a bug if you call using a macro, that you'll need to call that &nbsp;macro with a separate call that includes &amp;{noerror} to work. If you cut and paste the above and put it directly into chat it'll work, but if you have it in a collection macro the &amp;{noerror} will not work.&nbsp; To fix that, if the above was in a collection macro called 'Legendary-Actions', you'd need a separate macro that has this to correctly use the &amp;{noerror}: #Legendary-Actions &amp;{noerror} 2. Your ability calls are not written correctly: (~@{selected}|repeating_npcaction-l_$0_npc_action) Should be: (~selected|repeating_npcaction-l_$0_npc_action) 3. Or if you want some more advanced code ( taken from here ), this will show all available Legendary Actions without displaying anything if there are no Legendary actions available: /w gm &amp;{template:npcaction} {{rname=@{selected|token_name}}} {{name=Abilities}} {{description=[-- Legendary Actions --](" style="color: #7e2d40; font-weight: bold; text-decoration: none; background: none; background-color: transparent; border: none; padding: 0px; white-space: pre; display:none; display: block@{selected|repeating_npcaction-l_$0_name|max};)[@{selected|repeating_npcaction-l_$0_name}&amp;nbsp;](~@{selected|character_name}|repeating_npcaction-l_$0_npc_action" style="background: none; background-color: transparent; border: none; padding: 0px; color: orange; text-decoration: none; display:none; display: block@{selected|repeating_npcaction-l_$0_name|max};)[@{selected|repeating_npcaction-l_$1_name}&amp;nbsp;](~@{selected|character_name}|repeating_npcaction-l_$1_npc_action" style="background: none; background-color: transparent; border: none; padding: 0px; color: orange; text-decoration: none; display:none; display: block@{selected|repeating_npcaction-l_$1_name|max};)[@{selected|repeating_npcaction-l_$2_name}&amp;nbsp;](~@{selected|character_name}|repeating_npcaction-l_$2_npc_action" style="background: none; background-color: transparent; border: none; padding: 0px; color: orange; text-decoration: none; display:none; display: block@{selected|repeating_npcaction-l_$2_name|max};)[@{selected|repeating_npcaction-l_$3_name}&amp;nbsp;](~@{selected|character_name}|repeating_npcaction-l_$3_npc_action" style="background: none; background-color: transparent; border: none; padding: 0px; color: orange; text-decoration: none; display:none; display: block@{selected|repeating_npcaction-l_$3_name|max};)[@{selected|repeating_npcaction-l_$4_name}&amp;nbsp;](~@{selected|character_name}|repeating_npcaction-l_$4_npc_action" style="background: none; background-color: transparent; border: none; padding: 0px; color: orange; text-decoration: none; display:none; display: block@{selected|repeating_npcaction-l_$4_name|max};)[@{selected|repeating_npcaction-l_$5_name}&amp;nbsp;](~@{selected|character_name}|repeating_npcaction-l_$5_npc_action" style="background: none; background-color: transparent; border: none; padding: 0px; color: orange; text-decoration: none; display:none; display: block@{selected|repeating_npcaction-l_$5_name|max};)[@{selected|repeating_npcaction-l_$6_name}&amp;nbsp;](~@{selected|character_name}|repeating_npcaction-l_$6_npc_action" style="background: none; background-color: transparent; border: none; padding: 0px; color: orange; text-decoration: none; display:none; display: block@{selected|repeating_npcaction-l_$6_name|max};)[@{selected|repeating_npcaction-l_$7_name}&amp;nbsp;](~@{selected|character_name}|repeating_npcaction-l_$7_npc_action" style="background: none; background-color: transparent; border: none; padding: 0px; color: orange; text-decoration: none; display:none; display: block@{selected|repeating_npcaction-l_$7_name|max};)[@{selected|repeating_npcaction-l_$8_name}&amp;nbsp;](~@{selected|character_name}|repeating_npcaction-l_$8_npc_action" style="background: none; background-color: transparent; border: none; padding: 0px; color: orange; text-decoration: none; display:none; display: block@{selected|repeating_npcaction-l_$8_name|max};)[@{selected|repeating_npcaction-l_$9_name}&amp;nbsp;](~@{selected|character_name}|repeating_npcaction-l_$9_npc_action" style="background: none; background-color: transparent; border: none; padding: 0px; color: orange; text-decoration: none; display:none; display: block@{selected|repeating_npcaction-l_$9_name|max};)}}&amp;{noerror}
Thanks Jarren! Will change tonight.