Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Simple Teleport script with adjustment of rotation

Till Stirling
Crazy Inventor
Join date: 31 Jul 2004
Posts: 124
02-27-2005 11:54
The following script is a simple teleport script which egalises the rotation of the teleporter prim. Please note that I am releasing the script without a guarantee for support or future patches!

CODE
//replace the three numbers in following line with the targetcoordinates
vector target=<59.31, 163.05, 37.62>;

vector offset;

default
{
on_rez(integer params)
{
offset = (target- llGetPos()) * (ZERO_ROTATION / llGetRot());
llSitTarget(offset, ZERO_ROTATION);
}

state_entry()
{
offset = (target- llGetPos()) * (ZERO_ROTATION / llGetRot());
llSetSitText("Teleport");
llSitTarget(offset, ZERO_ROTATION);
}

changed(integer change)
{ // something changed
if (change & CHANGED_LINK)
{ // and it was a link change
llSleep(0.5); // llUnSit works better with this delay
if (llAvatarOnSitTarget() != NULL_KEY) { // somebody is sitting on me
llUnSit(llAvatarOnSitTarget()); // unsit him
}
}
}

touch_start(integer i)
{
llSay(0, "Please right-click and select Teleport");
}
}


Till Stirling
_____________________
Lefty Belvedere
Lefty Belvedere
Join date: 11 Oct 2004
Posts: 276
Post Jack: Original Thread
03-16-2005 15:48
/15/d8/37156/1.html

and now back to your regularly scheduled post
-----------------------------------------------------------



just throws my avi in general direction

This script just seems to throw my avi in the general direction of the target. The range seems to be limited by 20m or so.

am i missing something? anyone else try this script?
Spuds Milk
Registered User
Join date: 28 Sep 2004
Posts: 94
03-18-2005 18:09
From: Lefty Belvedere
This script just seems to throw my avi in the general direction of the target. The range seems to be limited by 20m or so.

am i missing something? anyone else try this script?


I haven't tried this specfic script, but sit-teleporting has the following limitations
1. Max teleport distance is aprox 300 meters
2. Cannot teleport over a sim border (to another sim)
Till Stirling
Crazy Inventor
Join date: 31 Jul 2004
Posts: 124
03-19-2005 00:25
I am not sure what you mean! I am using this script in dozens of teleporters with no problems...

Till Stirling
_____________________
Lefty Belvedere
Lefty Belvedere
Join date: 11 Oct 2004
Posts: 276
teleporting issues for me
03-28-2005 08:02
This teleport has a limited range for me. I'm not sure why! I cannot seem to pass through space more than 20m or so. After 20m my avi just succumbs to gravity and lands. My avi is always shot in the right direction, but never makes it more than 20m or so. any ideas?

~Lefty
Numair Panther
Registered User
Join date: 20 Apr 2005
Posts: 1
04-26-2005 13:46
It all has to do with the sleep timer.

For instance, an llSleep(0.5); will only get you about 20m, as you've been saying. Fiddle with extending or decreasing the value, until you find something you like.
MeLight Korvin
Im on da Use
Join date: 4 Jun 2005
Posts: 99
thanx
06-19-2005 12:01
Working as magic for me :) thanx for the script dude
Frog Bakalava
Registered User
Join date: 30 Sep 2005
Posts: 4
10-02-2005 15:17
What method do you use to figure out your target vector?.. so you can enter it?
Travis Lambert
White dog, red collar
Join date: 3 Jun 2004
Posts: 2,819
10-06-2005 13:48
Best way to figure out the target vector (from my experience):

Rez a plywood cube at your destination. Raise that cube up to about head-height. Edit that cube, and jot down the X, Y & Z position values. Then delete the cube.

Now you have your vector :)
_____________________
------------------
The Shelter

The Shelter is a non-profit recreation center for new residents, and supporters of new residents. Our goal is to provide a positive & supportive social environment for those looking for one in our overwhelming world.
Sabrina Doolittle
Registered User
Join date: 15 Nov 2005
Posts: 214
Warning: Dumb Question
12-02-2005 16:37
Could the fact that someone suggested I rez a cube on the floor to obtain target coordinates explain why I keep arriving at my destination sideways though the floor?


Really, it is so disconcerting every time it happens. Not to mention less than graceful!
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
12-02-2005 20:24
There is now a discussion thread, found here
_____________________
i've got nothing. ;)