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

Finding same token on 'ribbon page' as turn order Token.

1432797984
DXWarlock
Sheet Author
API Scripter
By accident, We put 2 and 2 together one day, and realized we could use the turn order as a hidden turn order. By having players roll turns on one page (which is now my roll imitative page), then moving the ribbon to the combat page. As GM I can see and advance the turn order, and players cannot see it. The only issue I'm having is I use a turn marker to highlight whos turn it is. Doing the above its moving the turn order token to where the token is that's in the order, on the page we are looking at. Its getting the X/Y of the token on one page and placing it in that spot on the other page. (which is correct technically as the token in question in the turn order is from the other page). My problem is I cannot find a way to make my token highlight script look at turn order, find the same token on the 'player ribbon page' and highlight it. There must be a way, but the token ID, and all that are totally different, looking at the logged tokens I cant find anything that's similar to use as a link to identify it. I can get it to find the page the ribbon is on no problem, and return whos turn it is from turn order no problem, I just cannot get it to find that tokens 'doppelganger' on the ribbon page.
If the tokens represent a character, that would probably be the best. Otherwise, I'd use a combination of name and image (because either one alone may not be unique). It wouldn't hurt to just always use all three, like: var tokens = findObjs({ _type: "graphic", _pageid: Campaign().get('playerpageid'), represents: token_from_turn_order_page.represents, imgsrc: token_from_turn_order_page.imgsrc, name: token_from_turn_order_page.name }); If your specifications are sufficiently unique, tokens should have exactly one element, which will be the same as you'd get doing "var tokens=[getObj("graphic", token_id)]".
1432802217
DXWarlock
Sheet Author
API Scripter
I didn't think about that, token image url match. Thats a great idea! between that, and names (so the goon mobs are separate) that should do it. I'll give that a try.