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

Teleport API - Question / Help

Hello awesome coders, Back with another question: I was playing with the Pat's [Teleport] API (love it, thank you!,) but while testing it with my player, I noticed it doesn't follow/ping the token when it moves/teleports to the new location? (EG If I make a 3-story house and the token moves from one end of the map to the other, if the player is zoomed in / close on the map, they llost sight of their token until I pinged/centered the camera for them.) Is there a way to add this feature to Teleport API (like using [Ping Buddy] (also love that, thank you Keith)), so after a token moves it will auto-ping/center back on the token for the Player?  (I'm thinking along the lines of Combat Tracker when it shifts/centers on the current player/token's turn...) Hope this question makes sense! Thank you all for your time & support!
Teleport should be able to ping players when their tokens are moved.&nbsp; It's possible that you have the setting turned off to autoping. <a href="https://app.roll20.net/forum/post/9436375/script-teleport-from-scratch-teleport-token/?pageforid=9476480#post-9476480" rel="nofollow">https://app.roll20.net/forum/post/9436375/script-teleport-from-scratch-teleport-token/?pageforid=9476480#post-9476480</a>
1671775028

Edited 1671775968
Pat
Pro
API Scripter
Yeah, the thing is - it kind of pauses for a moment because the delay is different for different folks, so what it *tries* to do is: Store the player color Change the player (teleporting player) color to transparent Move the token to the GM layer Move the token to the new location (given by the teleport target) Move the token to the Token layer (if it didn't do this, you'd see the the token animate point to point on the token layer, kind of ruins the effect) Pings the player. The player that gets pinged is the one that controls the token. So we've seen hiccups when tokens are controlled by more than one player, or where more than one token is moved (for instance, if a player has a player token and a mook/other token, them being moved to the new page means somebody gets left behind - that's a future add to "bring all associated tokens" - when, you know, I have the time...)&nbsp; This ping should re-center the player view on the new token location. The player's color is reset to the original color.&nbsp; If there is a bug, hiccup or dropped script you can see:&nbsp; Player's color is not reset and is left transparent Player does not move with ping (this can happen if there is a substantial delay or other abort condition)&nbsp; Player is left on the GM layer I'm not sure if it's the timeout, or another bug - the teleporter I tried to make as bulletproof as I could.&nbsp; And by "bulletproof," I mean I made it to swallow all of its own errors, and not crash the sandbox. I don't like when that happens myself, so I figured my buggy code would be better off failing silently than crashing the sandbox mid-session. I apologize I didn't make it easier to debug problems.&nbsp; =============== Edited to Add ============= It looks like a few scripts that ping have all started having problems as of the Dec 21 update which included: Miscellaneous optimizations of VTT performance So I wonder if one of those miscellaneous performance improvements, or the "smoother dragging through doors" might have affected the way we use Ping.&nbsp;
Sorry for the late reply! Yes, I had to uncheck and re-check the Autoping and it worked! (I was also dumb and didn't for some reason look at the config button options &gt;_&lt;) (I had a similar issue (albeit unrelated to this) with Combat Tracker after an update and had to readjust settings.) So, I apologise for my lack of thought, but appreciate everyone's responses - it works as intended/wanted! (thanks again for the awesome Script!)