Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Long distance teleport

Lisbeth Cohen
Registered User
Join date: 4 Jul 2004
Posts: 53
09-20-2006 22:19
This is something I cooked together from other free scripts found at this forum. Just put it into a prim and sit on it to teleport - pretty standard. If you move the prim you'll have to reset the script so it will remember its new home position.

Thanks to original authors for their great work and permitting me to publish this!


CODE
// Long distance teleport version 1.1
// ----------------------------------
// This script is based on other public domain free scripts, so I don't
// take credit for any of the work here.
// Bits and pieces combined by Lisbeth Cohen - plus added show/hide.
//
// The basics of the script is based on Till Sterling's simple teleport
// script, with cross sim transportation routine developed by
// Keknehv Psaltery, modified by Strife Onizuka, Talarus Luan and
// Keknehv Psaltery.
// The transportation functionality is based upon Nepenthes Ixchel's
// 1000m Menu-driven Intra-Sim Teleporter
//
// Thank you to authors who have given me permission to publish this script.
// A special thank you to Keknehv Psaltery for suggesting small improvements!
//
// You are NOT allowed to sell it without the
// permissions of all the authors I've credited above (except those who
// may have left sl at the time)!
// Feel free to use it in freebies and to give it to your friends :-)
//
// Please do not take credit for the work of all those great authors
// mentioned above!
// If you edit the script, please do not change the lines above - thanks!
// ------------------------------------------------------------------------


//The target location .. change this to where you want to end up (x, y, z)
vector gTargetPos = <246, 181, 415>;
// Text for the "pie menu"
string gSitText="Teleport";
// Define channel number to listen to user commands from
integer myChannel = 123;


// No need to edit the global variables below

// Return position for tp object - no need to edit
vector gStartPos=<0,0,0>;
// Key for avatar sitting on object, if any
key gAvatarID=NULL_KEY;
// If you don't enable this the teleport object will be left at the destination.
integer gReturnToStartPos=TRUE;


// This routine do the actual transport
warpPos( vector destpos)
{ //R&D by Keknehv Psaltery, 05/25/2006
//with a little pokeing by Strife, and a bit more
//some more munging by Talarus Luan
//Final cleanup by Keknehv Psaltery
// Compute the number of jumps necessary
integer jumps = (integer)(llVecDist(destpos, llGetPos()) / 10.0) + 1;
// Try and avoid stack/heap collisions
if (jumps > 100 )
jumps = 100; // 1km should be plenty
list rules = [ PRIM_POSITION, destpos ]; //The start for the rules list
integer count = 1;
while ( ( count = count << 1 ) < jumps)
rules = (rules=[]) + rules + rules; //should tighten memory use.
llSetPrimitiveParams( rules + llList2List( rules, (count - jumps) << 1, count) );
}

default
{
state_entry()
{
// Put the teleport text in place of the Sit in the pie menu
llSetSitText(gSitText);
// Read the objects position so it can return to it after teleporting
gStartPos = llGetPos();
// Sit the avatar on the object
llSitTarget(<0,0,1>,ZERO_ROTATION);
// Define commands to listen for
llListen(myChannel,"","","");
}

on_rez(integer startup_param)
{
llResetScript();
}

listen(integer chan, string name, key id, string cmd)
{
if (cmd == "show")
{
llSetAlpha( 1, ALL_SIDES );
}
else if (cmd == "hide")
{
llSetAlpha( 0, ALL_SIDES );
}
else if (cmd == "reset")
{
llResetScript();
}
else if (cmd == "help")
{
llSay(0, "Usage:");
llSay(0, "");
llSay(0, "show Make teleporter visible");
llSay(0, "hide Make teleporter invisible");
llSay(0, "reset Resets teleporter script");
llSay(0, "help This text");
}
}

changed(integer change){
if(change & CHANGED_LINK)
{
// Find id for avatar sitting on the object
gAvatarID = llAvatarOnSitTarget();
// If someone sits on it...
if(gAvatarID != NULL_KEY)
{
// Move avatar to destination
warpPos(gTargetPos);
// Pause for 1 second
llSleep(1);
// Unsit avatar
llUnSit(gAvatarID);
// Wait 1 second more
llSleep(1);
// If teleporter should return to original position....
if (gReturnToStartPos)
{
// ... send object to its start position
warpPos(gStartPos);
}
}
}
}

}
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
09-21-2006 22:34
/15/07/138805/1.html
_____________________
i've got nothing. ;)
Sebastian Glitterbuck
Registered User
Join date: 14 Feb 2005
Posts: 23
12-17-2006 17:06
From: Lisbeth Cohen
This is something I cooked together from other free scripts found at this forum. Just put it into a prim and sit on it to teleport - pretty standard. If you move the prim you'll have to reset the script so it will remember its new home position.

Thanks to original authors for their great work and permitting me to publish this!



I'm noticing when I use this and other warppos based scripts I'm getting stopped by ban lines between me and the destination.. and I get messages from SL that objects can't be created in parcels blah blah.. is there something missing?

- Seb
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
12-17-2006 18:33
From: Sebastian Glitterbuck
I'm noticing when I use this and other warppos based scripts I'm getting stopped by ban lines between me and the destination.. and I get messages from SL that objects can't be created in parcels blah blah.. is there something missing?

- Seb



nope, warppos creates the illusion of instant movement when it's really being moved in increments.the only way to warp past a ban line is with the llSitTarget teleporter.
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Sebastian Glitterbuck
Registered User
Join date: 14 Feb 2005
Posts: 23
12-17-2006 19:46
From: Senuka Harbinger
nope, warppos creates the illusion of instant movement when it's really being moved in increments.the only way to warp past a ban line is with the llSitTarget teleporter.


dagh.

back to the drawing board.. thanks!
grumble Loudon
A Little bit a lion
Join date: 30 Nov 2005
Posts: 612
12-19-2006 00:25
or warppos above or around the ban lines by manuly creating path waypoints.
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
12-19-2006 00:35
From: grumble Loudon
or warppos above or around the ban lines by manuly creating path waypoints.


unfortunately ban lines don't have a height limit last time I checked, and there's no way to detect wether or not you're banned on a particular parcel via script (list llGetBanList(vector pos) which would return a list of keys?), so your manual manuvering around is the only solution
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Geeky Wunderle
What a GEEK!
Join date: 1 Dec 2006
Posts: 122
12-19-2006 00:37
Just a heads up....

You can't make something public domain and then restrict what people can do with it, something in the public domain has no ownership claim on it, people can freely do with it as they please.
Sebastian Glitterbuck
Registered User
Join date: 14 Feb 2005
Posts: 23
12-19-2006 03:15
From: Senuka Harbinger
unfortunately ban lines don't have a height limit last time I checked, and there's no way to detect wether or not you're banned on a particular parcel via script (list llGetBanList(vector pos) which would return a list of keys?), so your manual manuvering around is the only solution


Ban lines do have a height. You can fly over a banned parcel if you go high enough, I forget what that height is but for simplicity I'll have to go with the other kind of script..

And Geeky - no one is limiting what people do with this script.. SLs limitations prevent certain uses - like TP through a banned parcel :-(
Ged Larsen
thwarted by quaternions
Join date: 4 Dec 2006
Posts: 294
12-19-2006 03:51
From: Sebastian Glitterbuck
And Geeky - no one is limiting what people do with this script.. SLs limitations prevent certain uses - like TP through a banned parcel :-(


I think they were referring to this part, in the pre-amble of the script:

From: someone
// Realeased as public domain - you are NOT allowed to sell it without the
// permissions of all the authors I've credited above (except those who
// may have left sl at the time)!
// Feel free to use it in freebies and to give it to your friends :-)
Kalel Venkman
Citizen
Join date: 10 Mar 2006
Posts: 587
12-19-2006 06:54
From: Ged Larsen
I think they were referring to this part, in the pre-amble of the script:


Sounds like what he meant was to make it Gnu Public License, not public domain. The damage could be minimized by redacting the original source code listing to include mention of the Gnu Public License, but alas, the primary damage is done.
Kalel Venkman
Citizen
Join date: 10 Mar 2006
Posts: 587
12-21-2006 06:52
From: Senuka Harbinger
unfortunately ban lines don't have a height limit last time I checked, and there's no way to detect wether or not you're banned on a particular parcel via script (list llGetBanList(vector pos) which would return a list of keys?), so your manual manuvering around is the only solution


Oh - I had an idea, though. Have the script remember your last position each time it attempts to move you - if it's unsuccessful, then something about the parcel in your path prevented a successful motion. We don't care particularly what that something was, since we're not in a position to do anything about it, but we can back up, turn forty-five degrees either left or right and try again. Probably remembering the effectiveness of movement attempts for three or four tries would help it figure out which way to turn.

Since it's possible that one such barrier could be a parcel with scripts turned off, you'd have to send out probes that ping the main transporter back - if a probe is sent out and is supposed to report when it hits the ground but doesn't, something awful happened to it and the main transporter device would know not to try to go that way.

Eventually the teleporter would get where it was going, unless the target area itself is inside a parcel where it couldn't possibly go, and I'm not sure how you'd detect that condition..

But if you could solve that, the teleporter could "feel its way" along hostile barriers and avoid impassable areas, in the same manner as a child's toy - except that it would always know where the intended destination is, and would always strive to return to a course that would take it to that destination.
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
01-03-2007 17:53
Hey, I will re-post this here because the conversation relates.

I've been quietly working on this for a while. Still a couple of things to work out but its 99% complete and will be available for sale soon.

This video isn't highly produced, no voice overs, etc. However, it demonstrates what the CamTP does.

My closest friends who I've given preview copies to have commented favorably.

Be warned, the file is about 54mb.

Comments and critiques are of course welcome. Thanks.

http://services.commoncache.com/camtp_demo.mov

Geuis
Partington Gould
Registered User
Join date: 15 Sep 2005
Posts: 94
01-09-2007 19:33
I like this teleporter and made a nice signpost style teleporter, left-click is set to sit, so clicking on one of the signs takes you to that location.

However, one of the locations is an office, I was wondering if there's a line or 2 that can be inserted into the script so it will only respond to either to 5 or 6 named people or to a group (whichever is easier to add). I don't need any notecard lookup or anything fancy, it wont be a constantly changing list of people, so something straight in the script would be OK.

I'm a builder, and my scripting knowledge consists of making random changes and seeing what happens, so a layman's explanation would be much appreciated.


Thanks
_____________________
PG - Permanently Confused and prone to Wandering
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
01-10-2007 00:24
My "Superporter" solves this problem by letting you define a series of waypoints, and performing WarpPos or physical movement (for teleports over 768 meters) for each waypoint. So you can WarpPos above the ban limit and back again.

The physical movement is pretty fast, too, in a good sim I've gotten from 20m to 4000m in about a second, which gives you an average velocity over Mach 12 and a peak velocity that's probably faster than the space shuttle during re-entry.

I've set up a teleport network in LostFurest dAlliez that includes a node at 4000m, and one in Noonkkot that does up-and-over loops to avoid ban lines.
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
01-10-2007 06:42
Who needs a teleporting network, when you have personal instant teleport?

CamTP(Camera Teleport)
http://www.youtube.com/watch?v=Yes-EZerUr4

Yep, it avoids ban lines and doesn't need way points. You show it where you want to go, it goes. Simple.

Will be selling it soon, just setting up the vendor.

Geuis
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
01-10-2007 12:04
Different application, and a clever idea. Now I've seen that it'd a pretty straightforward hack to implement. And I guess you're generating the loop over the ban lines internally, rather than depending on waypoints. That's easy enough to automate for low altitudes, and I think I'll do that in the next version.

You still need waypoints for teleports over 768 meters, because there's no general mechanism to automate hopping up and over a build with physical movement. And a teleport network for people visiting your shop or whatever is still desirable.
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
01-11-2007 02:57
From: Sebastian Glitterbuck
Ban lines do have a height. You can fly over a banned parcel if you go high enough, I forget what that height is but for simplicity I'll have to go with the other kind of script..


I think the limit is 200m. Someone near me has very stupidly built a skybox over his land, which is empty at ground level, and put up ban lines. He must think they protect his skybox - which they don't!
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
02-08-2007 11:56
Script now allows users to set destination without changing the code, by editing the object description.

Format: <vector>Description;color
Example: <43,122,55>Teleport to my shop;R
<vector> must be three numbers surrounded by angle brackets
Description: may be any text. The text will float above the object containing the teleport script
color : sets the color for description
any combination of the letters R,G,B,A
R=Red, G=Green, B=Blue, A=Alpha (turns invisible)
multiple values are allowed, for example: RG

Activating command mode:
Left click and hold for two seconds over the teleport object
Instructions will be displayed and you may give voice commands for a two minute interval
If the teleporting object's description has changed, activating command mode will automatically register the new location and description.

CODE

// Long distance teleport version 1.2
// ----------------------------------
// Revision History
// 1.1 Lisbeth Hohen
// 1.2 Soen Eber
// (new) Reads from Description
// (mod) less laggy command interface
// (new) floating text
//
// This script is based on other public domain free scripts, so I don't
// take credit for any of the work here.
// Bits and pieces combined by Lisbeth Cohen - plus added show/hide.
//
// The basics of the script is based on Till Sterling's simple teleport
// script, with cross sim transportation routine developed by
// Keknehv Psaltery, modified by Strife Onizuka, Talarus Luan and
// Keknehv Psaltery.
// The transportation functionality is based upon Nepenthes Ixchel's
// 1000m Menu-driven Intra-Sim Teleporter
//
// Thank you to authors who have given me permission to publish this script.
// A special thank you to Keknehv Psaltery for suggesting small improvements!
//
// Realeased as public domain - you are NOT allowed to sell it without the
// permissions of all the authors I've credited above (except those who
// may have left sl at the time)!
// Feel free to use it in freebies and to give it to your friends :-)
//
// Please do not take credit for the work of all those great authors
// mentioned above!
// If you edit the script, please do not change the lines above - thanks!
// ------------------------------------------------------------------------


// Text for the "pie menu"
string gSitText="Teleport";
// Define channel number to listen to user commands from
integer myChannel = 123;

// No need to edit the global variables below

//The target location .. this is set by reading the description
vector gTargetPos = <0.0, 0.0, 0.0>;
// Return position for tp object - no need to edit
vector gStartPos;
// Key for avatar sitting on object, if any
key gAvatarID=NULL_KEY;
// If you don't enable this the teleport object will be left at the destination.
integer gReturnToStartPos=TRUE;
// used for triggering command entry
float elapsed = 0.0;
integer announced;
integer listenHandle;
// remember previous description so script will know to reset
string currentDescription = "";

vector SetDestAndText()
{
string desc;
string arg1 = "";
string arg2 = "";
string arg3 = "";
integer i;
integer j;
float alpha = 0.0;
vector dest;
vector color = <0.0, 0.0, 0.0>;

// Parse Description Text
desc = llGetObjectDesc();
i = llSubStringIndex(desc, ">");
j = llSubStringIndex(desc, ";");
arg1 = llGetSubString(desc, 0, i);
if (j == -1) {
arg2 = llGetSubString(desc, i + 1, llStringLength(desc));
}
else {
arg2 = llGetSubString(desc, i + 1, j - 1);
arg3 = llToUpper(llGetSubString(desc, j + 1, llStringLength(desc)));
}

// Convert to vector and text and text color
dest = (vector)arg1;
if (llSubStringIndex(arg3, "R") == -1) color.x = 0.0;
else color.x = 1.0;
if (llSubStringIndex(arg3, "G") == -1) color.y = 0.0;
else color.y = 1.0;
if (llSubStringIndex(arg3, "B") == -1) color.z = 0.0;
else color.z = 1.0;
if (llSubStringIndex(arg3, "A") == -1) alpha = 1.0;
else alpha = 0.0;

llSetText(arg2, color, alpha);
return(dest);
}
sayHelp()
{
llOwnerSay("Commend Entry: Usage is:");
llOwnerSay("/123 show Make teleporter visible");
llOwnerSay("/123 hide Make teleporter invisible");
llOwnerSay("/123 reset Resets teleporter script");
llOwnerSay("/123 help This text");
llOwnerSay("You have 120 seconds to enter commands before having to touch and hold to re-engage");
announced = TRUE;
}

// This routine do the actual transport
warpPos( vector destpos)
{ //R&D by Keknehv Psaltery, 05/25/2006
//with a little pokeing by Strife, and a bit more
//some more munging by Talarus Luan
//Final cleanup by Keknehv Psaltery
// Compute the number of jumps necessary
integer jumps = (integer)(llVecDist(destpos, llGetPos()) / 10.0) + 1;
// Try and avoid stack/heap collisions
if (jumps > 100 )
jumps = 100; // 1km should be plenty
list rules = [ PRIM_POSITION, destpos ]; //The start for the rules list
integer count = 1;
while ( ( count = count << 1 ) < jumps)
rules = (rules=[]) + rules + rules; //should tighten memory use.
llSetPrimitiveParams( rules + llList2List( rules, (count - jumps) << 1, count) );
}

default
{
state_entry()
{
// Put the teleport text in place of the Sit in the pie menu
llSetSitText(gSitText);
// Read the objects position so it can return to it after teleporting
gStartPos = llGetPos();
// Sit the avatar on the object
llSitTarget(<0,0,1>,ZERO_ROTATION);
// Read teleport destination and signage from description
gTargetPos = SetDestAndText();
// Set Listener Control
listenHandle = llListen(myChannel,"","","");
// Get current description
currentDescription = llGetObjectDesc();
}

on_rez(integer startup_param)
{
llResetScript();
}

touch_start(integer num_detected)
{
if (llDetectedKey(0) == llGetOwner()) {
elapsed = llGetAndResetTime();
announced = FALSE;
}
else {
llSay(0, "Not owner");
}
}
touch(integer num_detected)
{
if ((llDetectedKey(0) == llGetOwner()) && (announced == FALSE)) {
elapsed = llGetTime();
if (elapsed > 2.0) {
if (currentDescription == llGetObjectDesc()) {
llListenControl(listenHandle, TRUE); // ...enable listen
llSetTimerEvent(120);
sayHelp();
}
else {
llOwnerSay("Description has changed - resetting script");
llOwnerSay("You will need to press and hold again to trigger command entry after the script resets");
llResetScript();
}
}
}
}
touch_end(integer num_detected)
{
if (llDetectedKey(0) == llGetOwner()) {
announced = FALSE;
}
}
timer()
{
llOwnerSay("Command timeout");
llSetTimerEvent(0.0);
llListenControl(listenHandle, FALSE); // ...disable listen
}
listen(integer chan, string name, key id, string cmd)
{
if (cmd == "show")
{
llSetAlpha( 1, ALL_SIDES );
}
else if (cmd == "hide")
{
llSetAlpha( 0, ALL_SIDES );
}
else if (cmd == "reset")
{
llResetScript();
}
else if (cmd == "help")
{
sayHelp();
}
}

changed(integer change){
if(change & CHANGED_LINK)
{
// Find id for avatar sitting on the object
gAvatarID = llAvatarOnSitTarget();
// If someone sits on it...
if(gAvatarID != NULL_KEY)
{
// Move avatar to destination
warpPos(gTargetPos);
// Pause for 1 second
llSleep(1);
// Unsit avatar
llUnSit(gAvatarID);
// Wait 1 second more
llSleep(1);
// If teleporter should return to original position....
if (gReturnToStartPos)
{
// ... send object to its start position
warpPos(gStartPos);
}
}
}
}
}
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
02-09-2007 07:59
Now if only we could have a long range teleport that could be used at intercontinental distances as well ...
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
02-10-2007 07:23
Possible as discussed in the WIKI, if I can find some time I'll work it
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
02-12-2007 08:19
That would be wonderful - my problem at the moment is needing frequently to visit a location in an island sim. TPing to the sim arrives at a telehub that lags horribly, and it takes an age to rez the teleport that gets me to my destination (which is high up and lag-free). What I would love is a way to TP directly to the destination from outside the sim, while avoiding the telehub.

Yes I know that parcel control would fix this, but that isn't an option in this case.
Gaius Goodliffe
Dreamsmith
Join date: 15 Jan 2006
Posts: 116
02-12-2007 14:32
From: Daisy Rimbaud
Yes I know that parcel control would fix this, but that isn't an option in this case.

Or just remove the telehub, since the purpose of a telehub is to prevent people from arriving anywhere other than the controlled entry point in a sim. If a telehub exists, it's a good thing you can't TP in anywhere else; if you could, there'd be no point to having telehub support in the code at all, might as well just remove that code from the system. :p
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
02-12-2007 15:59
From: Gaius Goodliffe
Or just remove the telehub, since the purpose of a telehub is to prevent people from arriving anywhere other than the controlled entry point in a sim. If a telehub exists, it's a good thing you can't TP in anywhere else; if you could, there'd be no point to having telehub support in the code at all, might as well just remove that code from the system. :p


Sure, but that's outside my control.
Lisbeth Cohen
Registered User
Join date: 4 Jul 2004
Posts: 53
03-18-2007 00:43
Thanks for improving the script Soen :) Great work!

As for me calling it, and putting limits upon public domain, I apology for how I phrased it!
If anyone want to rephrase it so it will be correct, please feel free to do so (please send me a notecard since I'm hardly at the forums). I'll be happy to change the header in the original source. For now, I have just removed the 'public domain' words.

The ban lines problem was not on my mind at all, since what I needed at the time was a tp script that could get higher than the classic tp scripts on my own land. If anyone have a solution for this, feel free to change and expand the script :)
1 2