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

[sheetworkers] on("change:character_name", fn(updateCharName) ); refuses to fire

1489445538
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
It seems that  on("change") functions will not fire for the value "character_name" like it will for any normal attribute.  I know that character_name is a special value that both exists in all sheets and does extra stuff, for example changing it renames the character object name field, etc.  Is there any way to get this to fire, or to wait on a similar event so that a sheetworker will fire when the character name is changed?
1490036181
Gid
Roll20 Team
The attribute "character_name" is actually a pseudo attribute tied to the name of the character object. It behaves more as an alias than a real attribute which is why the change event isn't working for it. I created a bug ticket for this so we can do some more looking under the hood in regards to what you can (or should) be able to do with this attribute.
1490041832
Lithl
Pro
Sheet Author
API Scripter
Out of curiosity, Chris, what's your use-case for wanting this?
1490102590
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
Brian said: Out of curiosity, Chris, what's your use-case for wanting this? Nothing earthshattering or mandatory. I put separate "short name" and "long name" fields on my character sheet so that players who like to have super-long names for their characters, can also have a shorter name field that is used for most things, I wanted them setup to default to be identical.