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

NPC Adding a New Trait Macro

Hey Everyone,


I'm having trouble with a macro to call NPC traits. This is the one I'm using


/w gm &{template:default} {{name=@{selected|token_name}}}{{T1=**[@{selected|repeating_npctrait_$0_name}]**

@{selected|repeating_npctrait_$0_desc}}}{{T2=**[@{selected|repeating_npctrait_$1_name}]**

@{selected|repeating_npctrait_$1_desc}}}


It works for the Ghast (and other creatures). But on Gary (the second one and a Players Ranger's beast companion). I added "Pounce" as another trait for him to have. It shows the name, but not the description. I'm still pretty new to macros and I'm not sure what I'm doing wrong. I also get the error message "No attribute was found for @{selected|repeating_npctrait_-M3OgvLNtbuHG5tTGq8Q_desc}" when I try to do this. Any help is appreciated. 





May 14 (5 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

"desc" was deprecated in the repeating trait description. Try this:


/w gm &{template:default} {{name=@{selected|token_name}}}{{T1=**[@{selected|repeating_npctrait_$0_name}]**

@{selected|repeating_npctrait_$0_description}}}{{T2=**[@{selected|repeating_npctrait_$1_name}]**

@{selected|repeating_npctrait_$1_description}}}

Thanks! It fixed the problem with the new trait, but now for other NPC's it will only load the name and not the description. If it helps, I'm running the Tomb of Annihilation module from the Roll20 Marketplace. Thanks for your time. 


May 14 (5 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Odd. The change should have triggered sheet workers to update the attributes. (i.e. old creations should respond to desc or description, but new ones description only.)

Try opening and closing any problematic sheets. It shouldn't be necessary, but it's worth a test. Also, check to make sure your game is up to date on patches. Again, shouldn't be necessary, since it's a sheet change, but it's worth a try.

Thanks. Once I opened and closed the character sheets for the old NPCs the new description macro worked, I had to click on the "edit sheet directly" button because I never opened it before. I appreciate the help! 

May 14 (5 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Thanks for checking it out and reporting. Good to know.