Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Teleporter Function -- In Sim Version

Ahroun Maelstrom
Registered User
Join date: 30 Sep 2004
Posts: 22
03-28-2005 12:01
Okay, okay... I haven't seen much said about teleporters since the llSitTarget loophole was fixed. SOOOOO...

I found another work around. It's very very simple. The function takes two vectors, the start vector and the end vector. Needless to say, your start vector should be determined by llGetPos().

The limitation of this function is that it doesn't work across sim boundries, because it uses local coordinates. The offset version wouldn't be too terribly hard, I'll code it up in a few minutes and post it.

Without further ado:

CODE

jpMoveFromTo(vector from, vector to)
{
// How much to move X, Y, Z, and total.
float delta_x;
float delta_y;
float delta_z;
float delta_total;

// The number of steps we need to break total distance into, plus an accumulator.
integer steps;
integer i;

// Calculate the X, Y, Z distances.
delta_x = to.x - from.x;
delta_y = to.y - from.y;
delta_z = to.z - from.z;

// Calculate the total distance involved using 3D Pythagorean
delta_total = llSqrt( llPow(delta_x,2) + llPow(delta_y,2)
+ llPow(delta_z,2) );

// Since we can only move an object 10 meters, find out how many steps we need
// for each step to be less than 10 meters.
steps = llCeil( delta_total / 10 );

// Pythagorean: ratio the length of sides, ratio the length of hypotenuse
// So since we need to break the delta_total into 'steps' steps, we need
// to break each of X, Y, and Z into 'steps' steps, and move each time.
for( i = 0; i < steps; i++ )
{
llSetPos(llGetPos() + <delta_x/steps, delta_y/steps, delta_z/steps>);
}

// Finished!
}
Cartman Ludd
I'm with stupid ---->
Join date: 25 Mar 2005
Posts: 11
How do I use it??
04-05-2005 21:27
This looks, and sounds great, but how do I use it? :confused: :cool:
_____________________
Siggy's are stupid. 'Hey, look! Its that really random signature that I have had to read for the last 6 weeks, because that darn person is to defective to change it!' If this is you, I think we should get our freakin' panzerfrausts and blow every signature on this forum to kingdom come. Thank you for ignoring my signature, and if you went through painstaking process of reading it, then either you have to much time on your hands, or you have the I.Q of the slug.
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
04-06-2005 02:54
You know, if you call llSetPos with a destination further than 10 meters away, llSetPos moves the object 10m in the correct direction (but stops at the ground) so you just have to keep calling it until you are within a few inches of the destination ;) No need to calculate intermediate steps linearly, SL does it for you already.
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
Cartman Ludd
I'm with stupid ---->
Join date: 25 Mar 2005
Posts: 11
04-08-2005 16:10
Ahem, I am still sitting here patiently with my legs and arms folded, wondering how the heck to get this working. Anyone??? :mad: :confused:
_____________________
Siggy's are stupid. 'Hey, look! Its that really random signature that I have had to read for the last 6 weeks, because that darn person is to defective to change it!' If this is you, I think we should get our freakin' panzerfrausts and blow every signature on this forum to kingdom come. Thank you for ignoring my signature, and if you went through painstaking process of reading it, then either you have to much time on your hands, or you have the I.Q of the slug.
Gurgon Grumby
Registered User
Join date: 2 Dec 2004
Posts: 24
04-09-2005 13:47
"llSitTarget loophole was fixed" in the last 6 seconds?!?! :/
Gurgon Grumby
Registered User
Join date: 2 Dec 2004
Posts: 24
04-09-2005 13:52
"llSitTarget loophole was fixed" in the last 6 seconds?!?! :/
Gurgon Grumby
Registered User
Join date: 2 Dec 2004
Posts: 24
04-10-2005 13:05
"the llSitTarget loophole was fix"?! what in the last 2 seconds?
Korin Ingersoll
I R Teh Short!
Join date: 8 Dec 2004
Posts: 21
04-10-2005 14:06
Since when is the sittarget teleport fixed? I'm using it right now.
_____________________
Korin Ingersoll
Admin
AzureIslands

I am, Ms. Brightside
Earnest Clymer
Registered User
Join date: 20 Feb 2005
Posts: 17
Teleport what?
04-13-2005 16:10
Is the intention that this script will teleport an avatar? It works just great on a prim.. but I'm not sure there was any problem there that needed fixing.

I do want to find a way to teleport past the limitations of the llSitTarget, and better yet do it with a voice command so I can embed it in an attachment, and not have to rez something and click it