Jump to content

TP script for room to room?


Nimue Mistwalker
 Share

You are about to reply to a thread that has been inactive for 4520 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

The simplest teleporter, if you are going less than 10m, is simply a prim that moves to the new location when you sit on it and then returns when you stand up.  With no frills at all, that's ....

 

vector gTarget = <128,128,23>;   // Your own target coordinate go here. Must be within 10m of gHomevector gHome;default{    state_entry()    {        gHome = llGetPos();        llSitTarget(<0.0,0.0,0.1>,ZERO_ROTATION);    }    changed (integer change)    {        if(llAvatarOnSitTarget())        {            llSetPos(gTarget);            llUnSit(llAvatarOnSitTarget());        }        else        {            llSetPos(gHome);        }    }}

  You'll want frills, but that's the basics.

 

 

  • Like 1
Link to comment
Share on other sites

I dare say the 'sit teleporter' is more simple and it teleports up to 300m

vector target=<162,134,27>; // Enter the target coordinates here!!!

default
{
    state_entry()
    {
        llSetClickAction(CLICK_ACTION_SIT);
        llSitTarget(( target - llGetPos())/llGetRot(), ZERO_ROTATION/llGetRot());
    }
    changed(integer change)
    {
        llUnSit(llAvatarOnSitTarget());
    }
}

It may be a good idea to insert a llSleep(t); before the llUnsit(). t may be one or two seconds.

Link to comment
Share on other sites

If you want something that moves more like an elevator, this one is nice and smooth.  It uses llSetKeyframedMotion():

 

// simple smooth elevator/transporter script using llSetKeyframedMotion()// by Rufus Darkfold - This is Public Domainfloat movetime = 3.0;   // time in seconds the trip should take.  speed limit 250m/sec.vector distance = <0.0, 0.0, 60.0>;  // how far to go - use the x and y if you want to go sideways.// You can do sim crossings, but don't go too fast.key sitter;default{    state_entry()    {        llSetPrimitiveParams([PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); // needs new physics.        llSitTarget(<0.0,0.0,-.1>, ZERO_ROTATION);  // adjust as needed, it only needs to be set to something    }    changed(integer change)    {        if (change & CHANGED_LINK) {            sitter = llAvatarOnSitTarget();            if (sitter != NULL_KEY) {                vector pos = llGetPos();                llSetKeyframedMotion([distance, ZERO_ROTATION, movetime], [KFM_MODE, KFM_FORWARD]);                llSleep(movetime + 1.0);  // wait for it to finish                llUnSit(sitter);                llSetKeyframedMotion([distance, ZERO_ROTATION, movetime], [KFM_MODE, KFM_REVERSE]);                llSleep(movetime + 0.5);  // wait for it to finish                llSetPos(pos); // should be almost there already,  correct for keyframe motion drift            }        }    }}

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4520 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...