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

Script that changes a multi-sided token across multiple pages

Ok, so an unusual request, and don't know if it's possible, but is there a script that will change a rollable token's side across multiple pages?  The Sprawl RPG uses several "countdown clocks" to show progress in the game.  I've got the countdown clock images, and what I want to do is have those clocks on multiple pages so that, if I change one's face, it changes them all.  Another hitch to this is that different clocks might actually use the same token (the Mission clock and the Legwork clock, for example).  Does anyone see a way to make this work?
1496414237

Edited 1496414299
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Should be possible. You'd need to store the tokens as characters (so you'd have Mission clock and a Legwork clock character). Set the tokens to represent those characters. Then you use setDefaultTokenForCharacter to update the default token of the character when it's clock changes and then propagate that change to all other tokens representing the character. I'm actually doing this in the Pathfinder Companion that I am writing (almost ready to release v1.0) to update PC and unique NPC tokens across the whole game, so I know it's definitely doable. I might be able to whip up a proof of concept this weekend, it'll depend on how long prep for my monthly game takes.
1496414914
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
JamesW has a script called  TokenSync that might do the trick. I don't recall if it handles token faces, but it syncs everything else across pages.
1496415936
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
well, that is pretty much what I was going to do. Only improvement I'd make would be that you can also sync up the default token so that dragging that character back out will also create a sync'd token.
Hm...I'm not sure how to make it work.  I need to add a property, I guess imsrc?  But then it needs to not just sync the image source, but what side the token is showing - or maybe I'm not understanding how this should work.