Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Basic Teleporting Script

Cypher Olsen
Registered User
Join date: 7 Aug 2004
Posts: 54
08-16-2004 19:09
I'm sure this has been covered before, but I need a little help on a basic teleporting script.

I have a multiple floor house planned, and I want to be able to teleport to the different floors from an object through touching that object.

I was told to use the sit command and then have the script 'sit' the player x/y/z from the object then stand the player back up, but this looks really bad when used. Is there a better way?

Thanks if you can help this new scripter.
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
Re: Basic Teleporting Script
08-16-2004 19:27
From: someone
Originally posted by Cypher Olsen
I have a multiple floor house planned, and I want to be able to teleport to the different floors from an object through touching that object.

Scripts cannot force an avatar to sit on the object that contains them.
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
08-16-2004 19:45
The only way of teleporting is through a quirk in llSitTarget.
That function lets us change the sitting position of someone relative to the object. It was meant for really short distances, but LL forgot to cap it, and when they decided to cap it we were already relying on it so they let us use it to move a player up to 300 meters away from the object being sat upon.
There is no other way of teleporting someone without them sitting. You could push them with llPushObject but thats even nastier.
We may be getting a real teleport feature soon.
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
08-16-2004 19:58
Problem is, they're trying to sneak in another cap to llSitTarget, this time one that's only 10m, while "promising" a teleport function. Like they've promised fully functional RPC in the early stages of 1.4, or Havok2 in 1.3.
_____________________
</sarcasm>
Cypher Olsen
Registered User
Join date: 7 Aug 2004
Posts: 54
08-16-2004 20:45
OK, thanks for the info everyone. IN that case, is there a way to make it appear 'smoother'? I've seen teleports in night-clubs that seemed to work fine. Mine seems to jerk me everywhere and looks horrible.

Is there a way to hide the AV until the script is done then reshow him in the new location? Something else to this effect?

Also, what is Havok?
Evil Fool
"==" != "="
Join date: 30 Jul 2004
Posts: 110
08-16-2004 21:24
you could use a custom animation and have the script stop the sit animation early, and start the new animation...

Havok is the physics engine
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
08-17-2004 01:57
From: someone
Originally posted by Cypher Olsen
OK, thanks for the info everyone. IN that case, is there a way to make it appear 'smoother'? I've seen teleports in night-clubs that seemed to work fine. Mine seems to jerk me everywhere and looks horrible.

Is there a way to hide the AV until the script is done then reshow him in the new location? Something else to this effect?

Also, what is Havok?


To halt the jerkiness, put a 0.1 delay just before the unsit command.

Havok is the physics engine SL uses.
_____________________
</sarcasm>
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
08-17-2004 17:38
Fortunately, teleporters happen to be one of my specialties. While LL has already promised a teleport feature (read as: Don't bet the farm house just yet), current ways range from simple to significantly more elaborate:

1) Sit Teleporters. Set to be phased out, already commented on above. I wish someone would make one with a stand animation and an actual "beam up" effect, though :p
2) Physics glitches. If you go really fast under the current engine, you can phase through prims. One way to do a teleporter, then, would in theory be an exceptionally powerful avatar magnet, or playing with Force. This is significantly more elaborate than a simple sit TP, however...:rolleyes:

Plus it probably won't work when Havok 2 (ever) goes live.
3) llSetPos/llMoveToTarget/(other) movement teleporters. These are the ones I use most readily, since they're stable, reliable, somewhat fast, and won't get axed any time soon. Besides - I find it more fun to turn physics on and ride a ball down for my teleporter experience than simply, well, teleporting. Call me crazy if you want - it's a factual statement. ;)
4) You could just put in an elevator... :D

I'll likely find myself missing sit teleporters once they're phased out, purely because I discovered they work cross-sim (yup, you read that right. It's a little glitchy, however). Oh well. :rolleyes:
Cypher Olsen
Registered User
Join date: 7 Aug 2004
Posts: 54
08-18-2004 14:28
From: someone

3) llSetPos/llMoveToTarget/(other)


Can you use these to move an Avatar and do teleports? I was told by someone else that you couldn't, and that's why you need to use the Sit method.
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
08-18-2004 15:44
Not as gracefully, but you can, especially with llSetPos. Just sit on the object, let the SetPos run, and your object will 'slide' to the position in question.
_____________________
</sarcasm>
Cubey Terra
Aircraft Builder
Join date: 6 Sep 2003
Posts: 1,725
08-18-2004 15:56
From: someone
Originally posted by Moleculor Satyr
Not as gracefully, but you can, especially with llSetPos. Just sit on the object, let the SetPos run, and your object will 'slide' to the position in question.


If you want to see an example of this, see my (former) home in Arosa, which is now owned by Viper (I hope he doesn't mind me pointing out his new home :) ). The elevator uses llSetPos to carry the avatar up 20m through the floor above, deposit the avatar, and return to the starting point. So it behaves much like a teleporter, but slightly slower.

Over longer distances, you'll see jerky movement for several seconds as the avatar is moved in 10m increments to the target position. Another drawback of llSetPos is that it doesn't work over 512m (or something like that). The sit target teleporter works fine at any altitude.
_____________________
C U B E Y · T E R R A
planes · helicopters · blimps · balloons · skydiving · submarines
Available at Abbotts Aerodrome and XstreetSL.com

Cypher Olsen
Registered User
Join date: 7 Aug 2004
Posts: 54
08-18-2004 17:30
Ok thanks all. When I get a chance to try these out, I'll post if it doesn't work =)