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

Rollable Table Graphic Not Updating via API

1391662784

Edited 1391664268
Matt
Pro
I'm trying to change the side of a token using the API. Not sure if it's possible, and haven't found an answer via searches. I am able to change the side with the following command: obj.set("currentSide", 1); When I log() the object, I see the value changing to whatever value I've passed. When I right-click the token and choose Multi-Sided > Choose Side , the selection bar is set to the value I've passed, and the preview image shows the image i was trying to display. The problem I'm having is that the token on the objects layer does not update to reflect the correct side after being changed via API. Is it possible to update the token side via API? If so, what am I missing? Thanks.
1391677392

Edited 1392192802
Matt
Pro
Found my solution after searching a while. Here's how I did it, in case anyone else is curious. obj.set({ currentSide: 0, imgsrc: decodeURIComponent(obj.get("sides").split("|")[0]).replace(/med\.png/g, "thumb.png"), }); Although, it would still be nice (and much easier) if setting the currentSide attribute would automatically do this. :) Game on!