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

[Bug] obj.set('status_dead')

1386984293
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator
When I use set to put the dead status on a token using the syntax: obj.set('status_dead') the result is an empty status box. However, when I do the same command with this syntax: obj.set('status_dead', true) the result is as expected.
Just to make sure we're on the same page, the bug is that obj.set("status_dead") (without a second argument) should throw an error, right?
1386988397
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator
No error. Without the second argument it creates a small blank(invisible) status icon. I can tell it's there because it pushes over other status icons placed on the same token. It's also checked if you manually look at the drop down list of status icons to place on the token. With the second argument it creates the large red X over the whole token as expected.
Well what you're seeing is just an unintended consequence of the fact that you shouldn't be able to call set() with a null value. So really it just shouldn't let you do that. Calling obj.set("status_dead", true) (or false) is correct, calling obj.set("status_dead") is not supposed to be a valid thing to do.
1387047866
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator
That's interesting because I've seen it done that way in examples, though probably not official examples. It works for every other status icon I've used. Thank you for the response.