Tuesday, June 30, 2009

Full-Perm Long-Distance Teleport Script

Written 17 June, 2009

Full-Perm Long-Distance Teleport Script

I’ve known about the Warp Pos script for a long time, but I was never able to make it work.

And besides, it didn’t work beyond about 1000 meters, which is insufficient to reach today’s building ceiling of 4096 meters.

For a long time I’ve been using a Warp Pos teleport script Peter Stindberg was kind enough to give me, but I’d been needing a script that would extend to 4096, and I preferred one with full perms. So last night I thought I would look one last time in the Forums for a long-distance (4km) teleport script—and I found one!

I jumped to a sandbox (didn’t want to lose the prim holding the script somewhere on Whimsy) and pasted in the script I had copied from the forum post.

OMG! It compiled!

The script works gets its information from the Description field. It took a few tries to get the destination vector and other parameters formatted correctly, but I eventually prevailed.

Then I sat on the prim.

Woo hoo!


No woo hoo.

I was told I wasn’t allowed to teleport.

After digging around in the script a bit I found a conditional that for some reason was disallowing me to teleport and disabled it. I sat on the script and was promptly whisked 4000 meters into the sky.

Woo hoo!

When you sit on a teleport object, it travels with you. When I arrived at my destination, I saw the prim clearly before it returned to its origin position.

So I flew back down (well, I let myself fall), put in statements to turn the prim alpha after I saw on it and visible again after it returned home, and I soon had a working teleport script.

I’m still not quite satisfied (do I want to remove the one second pauses after sitting and after teleport is complete?), so I’ll continue to tweak. Meanwhile, you can find the script here on Whimsy, or IM me and I’ll send you an object with my latest mod of the script inside it, full perm. Please do not remove the original creator's language, which is embedded in the code.

To test the script, travel to the entry area of Whimsy and touch one of the small brown destination signs. You can grab your copy at my Flights of Fancy store.


HomerTheBrave said...

The old WarpPos had a built-in 1000m limit because otherwise it might risk running out of memory. With Mono, this is not an issue (well, it's an issue, but not a practical one). There's a vastly-improved version of WarpPos here: http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryWarpPos It's the very last one.

I couldn't find a good freebie tp script, so I made one that I hand out to people. You rez a prim, name it with the text you want in the hover text, put the destination vector in the prim description, drop in the script, and it works. IM me if you want a copy.

--Cinco Pizzicato

Peter Stindberg said...

There are two types of long-distance TP scripts around right now:

1) Warppos
It calculates a line-of-sight to the destination, and the required number of steps to move an object from start to end. The good thing is that it uses perfectly legit LSL calls, and will always work. The bad side is it fails if banlines are between start and end. Warppos nowadays can go to 4000m - I should send you an updated one.

2) <0,0,0> Exploit
This script is incredibly fast since it only needs a single hop. It is based on a glitch in SL which allows an object at the <0,0,0> position in a sim to reach ANY spot in the sim within one hop. The good thing is that banlines etc. can not prevent this script from working. The bad thing is that is relies on a bug in SL that eventually might get fixed, thus rendering this teleport nonfunctional. However we all know the speed with which LL fixes things...

Paulorp said...

I am trying use your script but I cant get to the destiny. I created one skybox, got the position and put on the script (gTargetPos) but I cant reach the skybox, I go to a totally different position. What am I doing wrong??

Cheyenne Palisades said...

Paulorp, the coordinates go in the description line. There's no need to change the script.

IM me with your Second Life name and I'll send you the script in a prim so you can see how it works-- or go to my store (SLURL follows) and pick up a box which inludes a prim)


Masha Eilde said...

Thank you for the script! The good news was that at first, it worked beautifully. And still does, from 2000 meters down to 30. BUT, when I try to TP back up, or TP a short distance, I'm missing the target AND the prim doesn't return to the original spot. I tried playing with starting location, size of prim, nothing seems to matter.

Are there some limitations that folks might know about that I can keep in mind when making the TP?

Thanks in advance!

Cheyenne Palisades said...

Masha, I had one instance in which the script didn't work. The prim wouldn't return to its original location. I used a new prim and a new copy of the script, same thing. But every one one worked just fine.

I think the highest I've teleported from the ground is about 1800 meters. It works fine, up and down.

I also use the script to teleport about five meters between the floors of my house. Same thing, it has always worked fine.

You might just try with a new prim. In any case, good luck!