Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: 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!
Till Stirling
Crazy Inventor
Join date: 31 Jul 2004
Posts: 124
12-03-2005 02:05
Yes that could be the reason. I usually add 1.5 to the z-coordinate of the actual destination coordinate.

Till Stirling
_____________________
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
12-03-2005 09:03
you avatar is an object inside 3d space. The vector of your avatar is the exact center of your avatar. The vector for the wooden box is it's exact center. Sense the box is smaller. It's center is located closer to the ground. If you made a wodden box and it was as tall as you, it's center would be about the same as your avatar.
Sigurd Tzedek
Registered User
Join date: 18 Oct 2006
Posts: 2
Dead on about the height...
02-01-2007 14:58
From: Numair Panther
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.


...sorry for the forum necromancy, but for any scripting NBs like me, this bit about the sleep setting is dead on. My skybox is over 90 feet above the teleport prim, and I had to set sleep to about 2.1 seconds (not .5) before this worked correctly.

It's better to put too much time in than too little; with too much time the worst that can happen is your avatar will be obviously sitting near the destination for a few seconds after the teleport is over.
Blaidd Tae
Freelance Consultant
Join date: 3 Jan 2007
Posts: 116
max tp range is 321m
02-09-2007 21:09
I've tried this script and set the llSleep to 2.5. It doesn't want to tp me to 405m. It always stops me at 321m. Anyway to break this barrier or should I look for another script? Thanks for any help that can be given.
Lizz Silverstar
Living in the Moment
Join date: 12 Nov 2006
Posts: 192
08-31-2008 13:18
It seems that something in Mono has broken this script.. It was working fine for a long time, but now that my sim has the new upgrade to Mono it has quit working for anything much over 40 meters.. The delay does not matter.. I set it for 5 seconds, but all that does is move me about 40 meters toward the target then stop, after the 5 seconds is up I fall to the ground... Way to go LL.....