Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Teleport For House

Jeff Drake
Novice builder & scripter
Join date: 5 Mar 2006
Posts: 4
06-27-2006 15:34
I have a basic teleport script but it requires me to enter a destination coordinate. I want to know how designers build houses with telporters built in. How does the teleport set itself up when a house is rezzed? There is no way to know its location in advance.

Hope this isnt too simple a question. I am a scripting novice.

Heres the telport script I was working with (it was freebie):

key lastAVkey = NULL_KEY;
string fltText = "Go downstairs";
vector dest = <47.633,23.086,43.830>;

init()
{
llSetSitText("Teleport";);
llSetText(fltText, <1,1,1>, 1);
llSitTarget(dest-llGetPos(), <0,0,0,1>;);
}

default
{
state_entry()
{
init();
}
touch_start(integer i)
{
init();
}
changed(integer change)
{
key currentAVkey = llAvatarOnSitTarget();
if (currentAVkey != NULL_KEY && lastAVkey == NULL_KEY)
{
lastAVkey = currentAVkey;
if (!(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION))
llRequestPermissions(currentAVkey,PERMISSION_TRIGGER_ANIMATION);
llSleep(0.5);
llUnSit(currentAVkey);
llStopAnimation("sit";);
llResetScript();
}
}
}
Burke Prefect
Cafe Owner, Superhero
Join date: 29 Oct 2004
Posts: 2,785
06-27-2006 15:41
On prefab houses they usually use 'relative' coordinates for sit-teleport instead of region coordinates. I can't write up a script at the moment but it's usually pretty simple.
_____________________
Jesse Malthus
OMG HAX!
Join date: 21 Apr 2006
Posts: 649
06-27-2006 15:59
or, you could have it notecard configurable. that's how I package my teleporters for use in prefabs.
Jeff Drake
Novice builder & scripter
Join date: 5 Mar 2006
Posts: 4
Hmmm
06-27-2006 17:30
Relative coordinates. I have to look that up. I don't know anything about it.

Thanks!
Rodrick Harrington
Registered User
Join date: 9 Jul 2005
Posts: 150
06-27-2006 20:46
Something like this for the sittarget:

CODE

llSitTarget(<2.0, 45,0, 0,0>, ZERO_ROTATION * llGetRot());
//this will set the position and rotation relative to the prim you put this in
_____________________