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

Having trouble with calling NPC Traits in a macro.

On the git hub page for the character sheet it shows a macro to call traits: /w gm @{selected|wtype}&{template:npcaction} {{name=@{selected|npc_name}}} {{rname=@{selected|repeating_npctrait_$0_name}}} {{description=@{selected|repeating_npctrait_$0_desc}}} It shows the name of the trait but not the description as it should: Any help would be mosst appreciated... (To GM): Spider Climb Ettercap selected|repeating_npctrait_$0_desc
I believe the D&D 5e character sheet was updated a while back so 'desc' has been changed to 'description'. Try this: /w gm @{selected|wtype}&{template:npcaction} {{name=@{selected|npc_name}}} {{rname=@{selected|repeating_npctrait_$0_name}}} {{description=@{selected|repeating_npctrait_$0_description}}}
1600916119
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Can you post a link to the page where you got the macro? If it can be changed, it should, to keep other folks from being misled.
1600916636

Edited 1600916680
keithcurtis &nbsp;said: Can you post a link to the page where you got the macro? If it can be changed, it should, to keep other folks from being misled. <a href="https://gist.github.com/Erreinion/df870538022c501e8a9862c11558e0a6" rel="nofollow">https://gist.github.com/Erreinion/df870538022c501e8a9862c11558e0a6</a> Thanks for the help
This is the Macro I am working on to make a clickable link macro that shows all the traits: Still having description issues. What am I missing? @{selected|wtype}&amp;{template:npcatk} {{name=@{selected|token_name}}} {{rname=Traits:}} {{description=1:[@{selected|repeating_npctrait_$0_name}](~selected|repeating_npctrait_$0_description) 2:[@{selected|repeating_npctrait_$1_name}](~selected|repeating_npctrait_$1_description) 3:[@{selected|repeating_npctrait_$2_name}](~selected|repeating_npctrait_$2_description) }} Ettercap 1 1:&nbsp; Spider Climb 2:&nbsp; Web Sense &nbsp;3:&nbsp; Web Walker I like the look of the npcatk Template better than the npcaction but they both&nbsp; suffer the same description error. The npcatk template also has a name issue it seems. Also getting the three to line up in a column would be nice but I'll take function over for. Any more help would be most appreciated
1600928356
Oosh
Sheet Author
API Scripter
When you use those Command Buttons, [Button](~Command), the command part is looking for an Ability stored on a sheet. You can get some limited chat functionality by using (!&amp;#13; .... ) in the parentheses, so you could do this: [@{selected|repeating_npctrait_$0_name}](!&amp;#13;@{selected|repeating_npctrait_$0_description}) Which would send the description straight to chat. You'd want to save this on a Macro Character, as the HTML substitution won't persist in a Collections macro. I don't think there's any way of getting a template to work by trying to ram the code inside a button. The other option would be to have a bunch of macros set up on a sheet which turn the trait into something nicer. For example, the first one would be: &amp;{template:npcaction}{{rname=@{selected|repeating_npctrait_$0_name}}}{{description=@{selected|repeating_npctrait_$0_description}}} Save this as the Ability NPCtrait0 on a sheet called Macros. Then your button on your original macro becomes: [@{selected|repeating_npctrait_$0_name}](~Macros|NPCtrait0) It does involve creating a bunch of extra macros, depends on what you want it to look like, really.
Thanks for the input @Oosh I will experiment more and try your ideas. It's frustrating because I have the macro working the way I want for actions &nbsp;@{selected|wtype}&amp;{template:npcatk} {{name=@{selected|token_name}}} {{rname=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)}} (To GM): Grick 1: Multiattack 2: Tentacles 3: Beak It works exactly like on want. A small box in the chat with only one macro and three buttons. Trying to get this to work the sane with traits is frustrating. The is a page specific macro, not a collections macro as well. Thanks again, I will go try your suggestions and get back.
1600962043
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Upon seeing what you are actually trying to do, I think you are trying to re-invent the wheel. The action you are looking for already exists, and was added about the same time the attribute name was changed. Try this: &nbsp;@{selected|wtype}&amp;{template:npcatk} {{name=@{selected|token_name}}} {{rname=Traits}} {{normal=1}} {{description=1:[@{selected|repeating_npctrait_$0_name}](~selected|repeating_npctrait_$0_-npc_roll_output) 2:[@{selected|repeating_npctrait_$1_name}](~selected|repeating_npctrait_$1_-npc_roll_output) 3:[@{selected|repeating_npctrait_$2_name}](~selected|repeating_npctrait_$2_-npc_roll_output)}}
Oosh said: When you use those Command Buttons, [Button](~Command), the command part is looking for an Ability stored on a sheet. You can get some limited chat functionality by using (!&amp;#13; .... ) in the parentheses, so you could do this: [@{selected|repeating_npctrait_$0_name}](!&amp;#13;@{selected|repeating_npctrait_$0_description}) Which would send the description straight to chat. You'd want to save this on a Macro Character, as the HTML substitution won't persist in a Collections macro. I don't think there's any way of getting a template to work by trying to ram the code inside a button. The other option would be to have a bunch of macros set up on a sheet which turn the trait into something nicer. For example, the first one would be: &amp;{template:npcaction}{{rname=@{selected|repeating_npctrait_$0_name}}}{{description=@{selected|repeating_npctrait_$0_description}}} Save this as the Ability NPCtrait0 on a sheet called Macros. Then your button on your original macro becomes: [@{selected|repeating_npctrait_$0_name}](~Macros|NPCtrait0) It does involve creating a bunch of extra macros, depends on what you want it to look like, really. The first suggestion did not work. I am seeing descriptions stored in the sheet with (comments) in brackets or parentheses breaks the macro. That's no fault of the macro, that's on whoever wrote the description. The second macro you suggested ( in bold) Works fine on the npcaction template but not the npcatk template (which I prefer visually) but again that's not on the macro that's an error in the template. The second half of that suggestion failed though (for me anyways) but I am working with the second macro alone and that works for me. Thanks...
keithcurtis said: Upon seeing what you are actually trying to do, I think you are trying to re-invent the wheel. The action you are looking for already exists, and was added about the same time the attribute name was changed. Try this: &nbsp;@{selected|wtype}&amp;{template:npcatk} {{name=@{selected|token_name}}} {{rname=Traits}} {{normal=1}} {{description=1:[@{selected|repeating_npctrait_$0_name}](~selected|repeating_npctrait_$0_-npc_roll_output) 2:[@{selected|repeating_npctrait_$1_name}](~selected|repeating_npctrait_$1_-npc_roll_output) 3:[@{selected|repeating_npctrait_$2_name}](~selected|repeating_npctrait_$2_-npc_roll_output)}} Thanks Curtis. Thats what I get for working from youTube videos from years gone by. Thanks again.