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

An API to have the camera follow a token

Greetings, I currently record all of my campaigns using a secondary browser on a second monitor and a different Roll20 account to hide all the unnecessary or confidential GM stuff. This obviously means I need to quite often pan over to the other monitor to move the camera around to the relevant location on the current map. What I'm looking for is an API that would preferably do two things: Follow a specific party token on the world map by centering the camera on it when it moves, and also center the camera on it when switching pages to a map with the token on it. Center the camera on whichever token is currently up on the turn order. I would obviously want the API to only do these things for the roll20 user that I record with, not all of my players. I was googling around and found a script by Nick Olivo which accomplishes one of these things (center the camera when switching maps), but not all of them. Perhaps this can be expanded on?: on("change:campaign:playerpageid",function(){ var tokens = findObjs({ _name:"Party 1 Token", _type:"graphic", _pageid:Campaign().get("playerpageid") }); var playerStartToken = tokens[0]; if (playerStartToken===undefined){ return; } setTimeout(function(){ sendPing(playerStartToken.get("left"),playerStartToken.get("top"),playerStartToken.get("pageid"),"",true); },2000); });
1651674147
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Don't know if there's a pre-built script for the first requirement, but Combat Master (and maybe some of the other Tracker scripts), can do that top of the list ping pulling.
You should look at the Marching Order script. I use a clear token and have it follow the party. <a href="https://app.roll20.net/forum/post/8339585/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/8339585/slug%7D</a>
1651680527
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Depending on what you need this for (streaming?), you might want to look into the Observer script in One-click. It centers on the active token, and changes sight to match theirs on the fly.
But observer script is bugged for months now, because the UDL doesn't update the vision unless you open the token and close it again.. devs are supposed to work on that for&nbsp; months now. I know The Aaron is regularly checking on the advance on that bug. It's probably the same bug taht doesn't update the angle of lights etc....
1651697998
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Lionel V. said: But observer script is bugged for months now, because the UDL doesn't update the vision unless you open the token and close it again.. devs are supposed to work on that for&nbsp; months now. I know The Aaron is regularly checking on the advance on that bug. It's probably the same bug taht doesn't update the angle of lights etc.... Ah, thanks. I don't record anymore and did not realize. I thought only field of vision did not update properly through API without a manual kick. If I turn on or off vision on a token, it updates automatically for me.
I appreciate the suggestions, but it doesn't seem any of them really accomplish what I'm looking for.
Guess the reason for that is your requirement I would obviously want the API to only do these things for the roll20 user that I record with, not all of my players. With such a specific requirement the only thing you can do is to take a script that is close and then adapt that script.