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

API code path for "NPC NAME IN ROLLS" attribute?

I want to write a simple script to change the setting for the "NPC NAME IN ROLLS" attribute on selected NPCs in a function. I know how to do it all, but for the life of me I have no idea what the name of the actual variable is so I can get/set it. Does anyone know the name of this attribute and the correct path to access it?  EX var current_NPC_name_in_rolls_state = findObjs({ type: 'attribute', characterid: character_reference, name: 'npc_name_in_rolls' })[0];
1660027381
The Aaron
Roll20 Production Team
API Scripter
If you right click and inspect it, you should be able to find the attribute name. It will start with attr_ which you strip off before using the name in code. 
Holy crap! I never knew you could do that! Mind blown! This makes my life so much easier, thank you! For posterity, the attribute was named  attr_npc_name_flag
1660052822
The Aaron
Roll20 Production Team
API Scripter
No problem!  It's definitely not obvious, so if you've not worked in web development with forms, you wouldn't know to look there.