Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Teleport Script Issue

MoxZ Mokeev
Invisible Alpha Texture
Join date: 10 Jan 2008
Posts: 870
06-25-2008 10:46
I'm trying to set up a teleport prim in my land house to tp to my workshop which is set at (Z) 733 high. I'm using this script that was posted at the Library. Problem is that it won't teleport me above (Z)332 high. What am I doing wrong? Is this too high to tp? Am I using the wrong script? Please pardon my newbness to scripting...ok less than newbness even, I basically just drop what I find in the content tab, but this should be really simple, right?

//replace the three numbers in following line with the targetcoordinates
vector target=<112.31, 133.05, 733.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";);
}
}
_____________________
:p
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
06-25-2008 11:18
At a guess I'd suggest that you are unable to teleport more than 300m from your starting point...



"Teleport Hack
The maximum distance llSitTarget can offset is up to 300m on any axis. This means it can be used to instantly teleport avatars around by having them sit on an object that immediately unsits them again (now at their new position). To activate the "teleporter", the user simply selects "Sit Here" from the object's pie menu. llSetSitText allows selecting a more apt label to replace "Sit Here"."
MoxZ Mokeev
Invisible Alpha Texture
Join date: 10 Jan 2008
Posts: 870
06-25-2008 11:52
o.O nuuuuu!
_____________________
:p
Cryas Tokhes
Great Googley Moogley...
Join date: 8 Feb 2006
Posts: 124
06-25-2008 14:16
look up WarpPos in the lsl wiki. there is already a script that takes steps across the vector's magnitude. You can go to any position within a sim. even ones that are 300m+. I currently use mine to travel 700m+
Wildefire Walcott
Heartbreaking
Join date: 8 Nov 2005
Posts: 2,156
06-25-2008 14:42
WarpPos FTW.
_____________________
Desperation Isle Estates: Great prices, great neighbors, great service!
http://desperationisle.blogspot.com/

New Desperation Isle: The prettiest BDSM Playground and Fetish Mall in SL!
http://desperationisle.com/

Desperation Isle Productions: Skyboxes for lots (and budgets) of all sizes!
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
06-25-2008 19:45
There is the other one prim method that works for now (fingers crossed)...
[ ETA 20080730: finger crossing didn't help, post-nerf version a few posts down... ]

CODE

// replace the three numbers in following line with the target coordinates
//vector target=<112.31, 133.05, 733.62>;
vector target = <39, 209, 651>;

Setup() {
// This is just an ordinary sit target, it's not used for teleporting.
llSitTarget(<0., 0., 0.5>, ZERO_ROTATION);
llSetSitText("Teleport");
}

default {
on_rez(integer params) {
Setup();
}

state_entry() {
Setup();
}

changed(integer change) {
if (change & CHANGED_LINK) {
key sitter = llAvatarOnSitTarget();
if (sitter != NULL_KEY) { // somebody is sitting on me

// we figure this at sit time so that the teleporter can be
// moved and rotated without restarting the script.
vector offset = (target - llGetPos()) /llGetRot();

llSetLinkPrimitiveParams(llGetNumberOfPrims(),[PRIM_POSITION, offset] );
llSleep(0.5);
llUnSit(sitter);
}
}
}

touch_start(integer i) {
llSay(0, "Please right-click and select Teleport");
}
}
_____________________
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
06-25-2008 20:45
From: Viktoria Dovgal
There is the other one prim method that works for now (fingers crossed)...

Yeah. I love that one because it can be done with a single prim, no rezzing or moving objects, etc. I think it might be constrained to 300m like a sit target though. We might need to do some testing on that.
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
06-25-2008 20:53
From: Hewee Zetkin
Yeah. I love that one because it can be done with a single prim, no rezzing or moving objects, etc. I think it might be constrained to 300m like a sit target though. We might need to do some testing on that.

Right now there is no limit at all really, some have been playing with it as a sit orbiter (I'm using it as a warppos replacement while it lasts). The behavior changes if it's not a single prim though.
_____________________
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
07-30-2008 16:39
LL nerfed llSetLinkPrimitiveParams in 1.23, but left just enough range to leave it useful for teleporting. Unfortunately it's all borked if the prim isn't at zero rotation, here is a modified bare bones one-prim TP to deal with that. Same as before, 1 prim means 1 prim, don't expect sane results in a link set.

CODE

// replace the three numbers in following line with the target coordinates
vector target = <39, 209, 651>;

Setup() {
// This is just an ordinary sit target, it's not used for teleporting.
llSitTarget(<0., 0., 0.5>, ZERO_ROTATION);
llSetSitText("Teleport");
}

default {
on_rez(integer params) {
Setup();
}

state_entry() {
Setup();
}

changed(integer change) {
if (change & CHANGED_LINK) {
key sitter = llAvatarOnSitTarget();
if (sitter != NULL_KEY) { // somebody is sitting on me

// Starting with SL server 1.23, llSetLinkPrimitiveParams
// has constraints that let an avatar reach the sim's
// buildable area, but it only works if the root prim is at
// ZERO_ROTATION. Since teleporters often have an expected "front"
// side, we'll zero out the rotation when needed then put it back.
rotation old_rotation = llGetRot();
llSetRot(ZERO_ROTATION);
vector offset = (target - llGetPos());

// Send the avatar on its way
llSetLinkPrimitiveParams(llGetNumberOfPrims(),[PRIM_POSITION, offset] );

// A short sleep helps to reduce the unsit bouncies
llSleep(0.5);
llUnSit(sitter);

// Put the prim back the way we found it
llSetRot(old_rotation);
}
}
}

touch_start(integer i) {
llSay(0, "Please right-click and select Teleport");
}
}
_____________________
Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
07-31-2008 08:20
Thanks Victoria, for sharing and keeping this updated to 'cope' with LL latest 'joke' :/
Honestly, why fix it when it wasent broken :(
fingers crossed.. mm.. more like legs crossed -and still we are p'd on :)
oh well..
_____________________
BR ab
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
07-31-2008 09:00
Actually, SLPP operation on avatars for setpos purposes has been in a state of flux since it was introduced. Right after SLPP was released, I tried extended one of my teleporters to use this trick, but it wouldn't allow the avatar to be moved beyond the child link distance limit, even with multiple PRIM_POSITION calls, or multiple SLPP calls, the same behavior as for child prims. The fact that the behavior later changed, and has changed again, I think no one should expect this particular use of SLPP to be consistent.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
07-31-2008 12:05
See http://jira.secondlife.com/browse/SVC-1433

Is there another JIRA issue that describes the buggy behavior for non-zero prim rotation? I'll vote!
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
07-31-2008 17:06
From: Hewee Zetkin
Is there another JIRA issue that describes the buggy behavior for non-zero prim rotation? I'll vote!

That would be http://jira.secondlife.com/browse/SVC-2543

Yes this is sort of "nonstandard" behavior, but so was warppos (and LL borked that one for a while too).
_____________________
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
08-28-2008 17:02
Server 1.24.3: It's dead, Jim. 54 meters for avatars, restrained to prim rules.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
08-28-2008 17:59
Yep. No surprise here. :-/

Well, we still have WarpPos... I hope.
Lizz Silverstar
Living in the Moment
Join date: 12 Nov 2006
Posts: 192
08-31-2008 13:47
Yes it was working fine until the new server code.. Now only good for very short hops.. *sighs* I do wish they would leave these things alone or give us a real teleport function..