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

Mimic Token Movement on another map?

Hey all, I had an idea that I wanted to try out in a campaign but I haven't been able to find anyone else talking about. I've been having a little read of the API docs and it feels like something that should be possible, but I thought I'd throw a question out to see if anyone else has done anything similar. I want to have two maps for the same area, but one of them is covered in illusions for any party members who fail a con save upon entering. So I know I can set this up as two separate maps for each of the options, but I'd ideally like to hide the fact that the party has been split over two maps and so what I'd like to somehow accomplish is for any movement of the player tokens on one map to be automatically mimicked on the other map, so all of the players think they're on the same map but are/aren't seeing the illusions as per their rolls. It feels like I might be able to make use of the listeners detailed on this page of the documentation: <a href="https://help.roll20.net/hc/en-us/articles/360037772773-API-Advanced-Use-Guide#the-script-editor-0-0" rel="nofollow">https://help.roll20.net/hc/en-us/articles/360037772773-API-Advanced-Use-Guide#the-script-editor-0-0</a> But I've never really tinkered with the API before, has anyone ever tried to accomplish this or have any advice for how I can achieve my desired result with or without the API? Many thanks.
So this should totally be doable with the help of the API if you are in a game created by a Pro subscriber. In fact, it is broadly similar to&nbsp; a different token movement example &nbsp;I helped with. In that example, all the tokens were on the same page and the token linkage was only 1 way (aka hunter and hunted) but many of the same ideas apply. That example is one using&nbsp; the ScriptCards Mod/API Script &nbsp;and specifically&nbsp; ScriptCards Triggers &nbsp;on the change:graphic &nbsp;event. Granted in that example I linked, the hunter token moved closer to the prey by 1 square which you don't want. That example however doesn't account for walls or barriers. It just mirrors the movement regardless which may not be what you want. If you need to account for and adjust for barriers and objects, then you might need a dedicated Mod/API Script for that but if you are only wanting to link two tokens on two pages and mirror any movement they make, that example I pasted should be modifiable to do that. Let me know if that's the route you want to explore. If you are looking for an actual API Script, then there are way more qualified people than me to help with that.&nbsp;&nbsp;
1706455148
The Aaron
Roll20 Production Team
API Scripter
I wrote a script that does this about 8 years ago:&nbsp; <a href="https://app.roll20.net/forum/post/1631638/script-request-linking-tokens-on-seperate-maps/?pageforid=1634979#post-1634979" rel="nofollow">https://app.roll20.net/forum/post/1631638/script-request-linking-tokens-on-seperate-maps/?pageforid=1634979#post-1634979</a> Documentation is a bit light, but if you call it with&nbsp; !twins ID1 ID2 It will keep those two tokens in sync across pages.&nbsp; It's a little simplistic but very serviceable.&nbsp; There are some things your players might notice as suspicious when you split them: Some of them can see pings from the others, but some can't Some can see measurements, some can't Someone draws on the page but the others can't see it. You'll probably need to be ready to play those things off as bugs... =D
Amazing, thank you very much both for the detailed answers. Looking forward to trying them out.