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 Question calling traits

Hey all, newbie to macros here and recently moved online as many have.  LOVE Roll20 and am ADDICTED.  That said, my only skill with macros is to cut and paste.  I watched some videos and got the following token macros to work really well *sometimes*. Here is the trait macro I am trying to use: /w gm &{template:npcaction} {{name=@{selected|npc_name}}} {{rname=@{selected|repeating_npctrait_$0_name}}} {{description=@{selected|repeating_npctrait_$0_desc}}} When I assigned it to a fire elemental from the Compendium it worked like a charm showing the following: However, when I assigned it to a magma mephit, (also from compendium) I get the following error: As I said, I'm no programmer, so I might be out of my league here but if anyone can help me figure out what I'm doing wrong, I'd appreciate it! TIA. Furey
1585144567
Kraynic
Pro
Sheet Author
There have been several posts with this issue.&nbsp; Looks like sheet code change from "desc" to "description".&nbsp; One of the current threads where this came up: <a href="https://app.roll20.net/forum/post/8302425/unruly-cats" rel="nofollow">https://app.roll20.net/forum/post/8302425/unruly-cats</a>
Thanks for the quick response, I did a forum search for "traits" and looked at the first two pages of topics but like I said, I'm not even really sure what to look for at this point. To help me in the future save everyone's time, how do I examine the sheet code to see if it is labelled as "desc" vice "description"? Cheers,&nbsp; DF
1585147490
Kraynic
Pro
Sheet Author
There are several methods depending on what you are doing (and which sheet you use).&nbsp; If the sheet has a built in roll to display traits, you can click that, put your cursor in the chat entry pain, hit the up arrow, and that should display the code of the last command sent to chat.&nbsp; That is fairly reliable.&nbsp; You could right click on whatever input you want info on and select "inspect element" and your browser will show you the html code for that area.&nbsp; Or, if it is a sheet with publicly available code (at least some of the "by Roll20" sheets are now hidden or only showing an older version), you could look up the Roll20 character sheet repository on github. In the html, all attributes will be shown as "name=attr_(attribute name here)".
/w gm &amp;{template:npcaction} {{name=@{selected|npc_name}}} {{rname=@{selected|repeating_npctrait_$0_name}}} {{description=@{selected|repeating_npctrait_$0_desc}}} On the character sheet for my monsters, changing the $0_ to $1_ for the 2nd trait and $2_ for the 3rd trait and so on, it works for me but it does spam chat with all their traits all at once.
1585147852
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You would never find it with a forum search. It was a one-line item in a list of changes with the most recent sheet update. It was announced, but most users likely wouldn't see or immediately get the implications. The reason one worked and one didn't in your testing is that one was likely created before the sheet change (desc and description will both work) and one was created after (only description will work). "description" should work on anything.
keithcurtis said: You would never find it with a forum search. It was a one-line item in a list of changes with the most recent sheet update. It was announced, but most users likely wouldn't see or immediately get the implications. The reason one worked and one didn't in your testing is that one was likely created before the sheet change (desc and description will both work) and one was created after (only description will work). "description" should work on anything. Yeah this was the case!&nbsp; To reiterate for others, what I did was change desc to description at the end of the old code of&nbsp;/w gm &amp;{template:npcaction} {{name=@{selected|npc_name}}} {{rname=@{selected|repeating_npctrait_$2_name}}} {{description=@{selected|repeating_npctrait_$2_desc}}}