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

ChatSetAttr for Front Page Editing, like Proficiencies and Traits

1708807226
Essen
Pro
Marketplace Creator
Howdy. In light of Nick Olivo's new Darkness mod, I'm looking into how to enable or disable Devils Sight on the fly. Is there a way to change the text of a trait or proficiency with something like ChatSetAttr? Or some other element on the front page of the sheet?
1708814974
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Essen! Short answer: yes. Long answer: what attribute are you specifically trying to change and what value(s) are you wanting to put there?
You can just create a custom attribute and add “Devil’s Sight” into it, or remove it. You don’t have to use an existing attribute. 
1708823424
Oosh
Sheet Author
API Scripter
To clarify what Jarren said, the regular expression in Nick's script will match any attribute value which contains the strings 'devil' and 'sight' in that order, case insensitive. These should all match: deVILSight devil's sight 2983759238762tdevillllllllllll2049786309476wdkjhggjksdhgksdhgkjsd9834769834uys_____SIGHT  09328750wugj my_custom_DEvil_SIGHt_value <full text of Hamlet> devilsight!!!! Ok, that last one is dependent on Hamlet being smaller than Firebase's max document size.... and would be an incredibly inefficient regex search...
1708827156
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hamlet, Act 3, Sc 4: ... What devil was't That thus hath cozen'd you at hoodman-blind? Eyes without feeling, feeling without sight , Ears without hands or eyes, smelling sans all, Or but a sickly part of one true sense Could not so mope.
1708882132

Edited 1708882714
Essen
Pro
Marketplace Creator
That's something I wasn't 100% tracking, I didn't know if it only checked the "paper" parts of the character sheet.  If it is checking in attributes, that makes things a lot easier. One more thing.  I use 2.5 ft squares, so it spawns half size. I tried tweaking a scale value in the script, but when I got it to load at the right size, it loaded weird in the console. Top is a fresh copy/paste, bottom is when I tweak the scale. How do I properly make this twice the size? I don't know how changing a 1 to a 2 messed up the console text, but who knows what else it impacted.