Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Teleport Long_distance_teleport_version_1  

Long_distance_teleport_version_1

Long distance teleport version 1.lsl

Category: Teleport
By : Lisbeth Cohen
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Long_distance_teleport_version_1
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Long_distance_teleport_version_1_1.lsl
1
2 //********************************************************
3 //This Script was pulled out for you by YadNi Monde from the SL FORUMS at http://forums.secondlife.com/forumdisplay.php?f=15, it is intended to stay FREE by it s author(s) and all the comments here in ORANGE must NOT be deleted. They include notes on how to use it and no help will be provided either by YadNi Monde or it s Author(s). IF YOU DO NOT AGREE WITH THIS JUST DONT USE!!!
4 //********************************************************
5
6
7
8
9
10
11
12 // Long distance teleport version 1.1 by Lisbeth Cohen
13 // ----------------------------------
14 //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.
15 //Thanks to original authors for their great work and permitting me to publish this!
16 // This script is based on other public domain free scripts, so I don't
17 // take credit for any of the work here.
18 // Bits and pieces combined by Lisbeth Cohen - plus added show/hide.
19 //
20 // The basics of the script is based on Till Sterling's simple teleport
21 // script, with cross sim transportation routine developed by
22 // Keknehv Psaltery, modified by Strife Onizuka, Talarus Luan and
23 // Keknehv Psaltery.
24 // The transportation functionality is based upon Nepenthes Ixchel's
25 // 1000m Menu-driven Intra-Sim Teleporter
26 //
27 // Thank you to authors who have given me permission to publish this script.
28 // A special thank you to Keknehv Psaltery for suggesting small improvements!
29 //
30 // Realeased as public domain - you are NOT allowed to sell it without the
31 // permissions of all the authors I've credited above (except those who
32 // may have left sl at the time)!
33 // Feel free to use it in freebies and to give it to your friends :-)
34 //
35 // Please do not take credit for the work of all those great authors
36 // mentioned above!
37 // If you edit the script, please do not change the lines above - thanks!
38 // ------------------------------------------------------------------------
39
40
41 //The target location .. change this to where you want to end up (x, y, z)
42 vector gTargetPos = <246, 181, 415>;
43 // Text for the "pie menu"
44 string gSitText="Teleport";
45 // Define channel number to listen to user commands from
46 integer myChannel = 123;
47
48
49 // No need to edit the global variables below
50
51 // Return position for tp object - no need to edit
52 vector gStartPos=<0,0,0>;
53 // Key for avatar sitting on object, if any
54 key gAvatarID=NULL_KEY;
55 // If you don't enable this the teleport object will be left at the destination.
56 integer gReturnToStartPos=TRUE;
57
58
59 // This routine do the actual transport
60 warpPos( vector destpos)
61 { //R&D by Keknehv Psaltery, 05/25/2006
62 //with a little pokeing by Strife, and a bit more
63 //some more munging by Talarus Luan
64 //Final cleanup by Keknehv Psaltery
65 // Compute the number of jumps necessary
66 integer jumps = (integer)(llVecDist(destpos, llGetPos()) / 10.0) + 1;
67 // Try and avoid stack/heap collisions
68 if(jumps > 100 )
69 jumps = 100; // 1km should be plenty
70 list rules = [ PRIM_POSITION, destpos ]; //The start for the rules list
71 integer count = 1;
72 while( ( count = count << 1 ) < jumps)
73 rules = (rules=[]) + rules + rules; //should tighten memory use.
74 llSetPrimitiveParams( rules + llList2List( rules, (count - jumps) << 1, count) );
75 }
76
77 default
78 {
80 {
81 // Put the teleport text in place of the Sit in the pie menu
82 llSetSitText(gSitText);
83 // Read the objects position so it can return to it after teleporting
84 gStartPos = llGetPos();
85 // Sit the avatar on the object
87 // Define commands to listen for
88 llListen(myChannel,"","","");
89 }
90
91 on_rez(integer startup_param)
92 {
94 }
95
96 listen(integer chan, string name, key id, string cmd)
97 {
98 if(cmd == "show")
99 {
101 }
102 else if(cmd == "hide")
103 {
105 }
106 else if(cmd == "reset")
107 {
109 }
110 else if(cmd == "help")
111 {
112 llSay(0, "Usage:");
113 llSay(0, "");
114 llSay(0, "show Make teleporter visible");
115 llSay(0, "hide Make teleporter invisible");
116 llSay(0, "reset Resets teleporter script");
117 llSay(0, "help This text");
118 }
119 }
120
121 changed(integer change){
122 if(change & CHANGED_LINK)
123 {
124 // Find id for avatar sitting on the object
125 gAvatarID = llAvatarOnSitTarget();
126 // If someone sits on it...
127 if(gAvatarID != NULL_KEY)
128 {
129 // Move avatar to destination
130 warpPos(gTargetPos);
131 // Pause for 1 second
132 llSleep(1);
133 // Unsit avatar
134 llUnSit(gAvatarID);
135 // Wait 1 second more
136 llSleep(1);
137 // If teleporter should return to original position....
138 if(gReturnToStartPos)
139 {
140 // ... send object to its start position
141 warpPos(gStartPos);
142 }
143 }
144 }
145 }
146
147 } // END //

Back to the Best Free Tools in Second Life and OpenSim.