Teleport script
|
Sydney Jacobs
Registered User
Join date: 31 May 2004
Posts: 756
|
12-30-2004 16:26
Hey all,
I am looking for a teleportation script that will allow me to tp from one particuler place on my land to another spot on my land. Nothing fancy with admitt lists or anything, just a basic port to port script I can use for my land. Any ideas where to look, or who to talk too???
Thanks all
P.s to those that got in today Ya for you!!! enjoy it =) *pouts as she is stuck whatching all the fun from the outside** =(
|
Siobhan Taylor
Nemesis
Join date: 13 Aug 2003
Posts: 5,476
|
12-30-2004 17:38
From: Sydney Jacobs Hey all,
I am looking for a teleportation script that will allow me to tp from one particuler place on my land to another spot on my land. Nothing fancy with admitt lists or anything, just a basic port to port script I can use for my land. Any ideas where to look, or who to talk too???
Thanks all
P.s to those that got in today Ya for you!!! enjoy it =) *pouts as she is stuck whatching all the fun from the outside** =( There are loads out there... Give me a shout in world, if it ever comes back up, and I'll send you one.
_____________________
http://siobhantaylor.wordpress.com/
|
Sydney Jacobs
Registered User
Join date: 31 May 2004
Posts: 756
|
12-30-2004 17:47
thanks hon!!! 
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
12-30-2004 18:02
Here's a simple one: integer TELEPORTER_CHANNEL = 192843; string POSITION_REQUEST = "POS_REQ";
vector prevPos; integer listenHandle; string prevName; default { state_entry() { // Request position of partner. llShout(TELEPORTER_CHANNEL, POSITION_REQUEST); // Listen for partner's requests and responces. listenHandle = llListen(TELEPORTER_CHANNEL, llGetObjectName(), NULL_KEY, ""); prevName = llGetObjectName(); prevPos = llGetPos(); // Create a timer to monitor position of object. llSetTimerEvent(10); } listen(integer channel, string name, key id, string message) { if (message == POSITION_REQUEST) { // Partner wants my position. llShout(TELEPORTER_CHANNEL, (string) llGetPos()); } else { // Partner is telling me its position. vector destPos = (vector) message; llSitTarget(destPos - llGetPos(), ZERO_ROTATION); } } timer() { // Make sure partner knows my position if it changed. vector curPos = llGetPos(); if (curPos != prevPos) { llShout(TELEPORTER_CHANNEL, (string) curPos); prevPos = curPos; } // Make sure the listen handle is listening to objects with the same name. string curName = llGetObjectName(); if (curName != prevName) { llListenRemove(listenHandle); listenHandle = llListenRemove(TELEPORTER_CHANNEL, curName, NULL_KEY, ""); prevName = curName; } } }
Just put that in two objects with the same name and you will be able to teleport between the two. ==Chris
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
12-30-2004 18:02
Blah, too late 
|
Moriash Moreau
Registered User
Join date: 1 Jan 2005
Posts: 39
|
01-10-2005 19:43
Christopher- I'm trying out your script (which looks very handy, BTW- thanks!), but I'm having a little trouble. When it compiles, I get the following errors on the following line: listenHandle = llListenRemove(TELEPORTER_CHANNEL, curName, NULL_KEY , ""  ; (40, 75): ERROR : Function call mismatches type or number of arguments (40, 75): ERROR : Function call mismatches type or number of arguments (twice!) (40, 76): ERROR : Type mismatch Columns 75 and 76 are on the NULL_KEY statement. The script is direct copied-and-pasted from above, no changes. Any ideas? It's probably something simple that I'm overlooking, but I'd appreciate any help you could give. Thanks! -Moriash Moreau
|
Jason Keegan
Registered User
Join date: 20 Apr 2004
Posts: 26
|
01-11-2005 00:30
Heya to make it compile you should do the following. change:
listenHandle = llListenRemove(TELEPORTER_CHANNEL, curName, NULL_KEY, "");
to
//Changed the llListenRemove() to llListen()
listenHandle = llListen(TELEPORTER_CHANNEL, curName, NULL_KEY, "");
Hope that helps. - Jason
|
Moriash Moreau
Registered User
Join date: 1 Jan 2005
Posts: 39
|
01-11-2005 07:00
Oh! Okay. I think I see that now. Thanks, Jason! Hopefully, I'll get past the script-kiddy phase soon... In a year or so.
|
FireDancer Steptoe
Registered User
Join date: 14 Dec 2004
Posts: 11
|
Taleportation script
01-11-2005 08:18
Here's a nice one a friend gave me. Just set the target vectors to where you wanna go. Make sure if you use a sphere you set the rotation to zero on the object tab Enjoy!
vector targetPos = <0, 0, 0>; //The target location
reset() { vector target; target = (targetPos- llGetPos()) * (ZERO_ROTATION / llGetRot()); llSitTarget(target, ZERO_ROTATION); llSetSitText(llGetObjectName()); } default { state_entry() { reset(); } on_rez(integer startup_param) { reset(); } changed(integer change) { llUnSit(llAvatarOnSitTarget()); reset(); } }
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
01-11-2005 12:45
Christopher Omega, I was wondering, you said place this script in two spots on your land. Does this script have the 300m distance limitation? And is this script really usable in one direction, but for convenience the other prim is for returning? If someone wants to add a little hover text to the prim so they can let someone know the object is a teleporter add this to your script... llSetText("^\n^\n^\n^\nTeleport up\n^\n^\n", <1,0,0>, 1.0); This snippit will make it look like there is an arrow in the air above the object you will use as a teleporter. So if you want, you can put this in a fireplace or something.
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|