Jump to content

Cross island teleporter


Natsely Amaterasu
 Share

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

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

Recommended Posts

Hello, I've been trying to modify a teleport script, given to me by a friend that has worked really well for inside teleporting, to teleport me across into another Island (my group owns both islands and they are next to each other). I've had minor success, but more than avarage it gets me to place then I freeze and wiggle in place. I'm able to rotate but not move.  At worst I'm teleported into water and just keep bouncing of the ground till I teleport home. Below is the edited teleport script. The thing I'm doing is grabing the distance for an edge from the other island to the desire location in that island and adding it the edge location.  Thanks for any help.

 

//replace the three numbers in following line with the target coordinates
//teleport only works within the same sim (no crossing sim borders)
//max teleport distance around 300 meters
vector desiredLoc = <94.123,208,97.333>; // Where I want to go
vector island2Edge = <2,127,34>; // These edges are together 
vector island1Edge =<265,127,34>;// 2Edge is the edge of the island
                                 // where the desiredLoc is and 1Edge
                                 // is the edge of the island I'm currently
                                 // on.
vector target;

vector offset;

default
{
    on_rez(integer params)
    {
        offset = (target- llGetPos()) * (ZERO_ROTATION / llGetRot());
        llSitTarget(offset, ZERO_ROTATION);
    }

    state_entry()
    {
        target = island1Edge + (desiredLoc-island2Edge);
        llSay(0, (string)target);
        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
                llSleep(10);
                llUnSit(llAvatarOnSitTarget()); // unsit him
            }
        }
    }
    
    touch_start(integer i)
    {
        llSay(0, "Please right-click and select Teleport");
    }
}
Link to comment
Share on other sites

Using a distant sit target is often a tricky proposition.  I can get tossed all over the place when I use this method to simply go from place to place in a single building.  Crossing a sim boundary and having to deal with the Mono bug, among other things, is likely to be problematic.  If you want a smooth TP that is almost 100% reliable, use llMapDestination instead.

 

default{    touch_start(integer total_number)    {            vector target = <128,128,22>; //Where I'm going            llMapDestination("NewSimNameHere",target,ZERO_VECTOR);    }}

 You could also have your script echo a SLURL in chat.  That's another very reliable mehod which, like llMapDestination, is a two-click teleport.

 

Link to comment
Share on other sites

When I had two adjacent islands, I sometimes used Ezian Ecksol's Camjumper script to get between the two of them.   That goes in an attachment, finds your destination by where your camera is, and then calls llMoveToTarget repeatedly to move you there very fast -- so fast that you normally blast through apparently solid objects with ease.

I don't know, but I'm wondering if the same method wouldn't get you from sim to sim if you sat on something that used it.   I know warppos looks as if it should, but doesn't do it at all reliably, so I'm not sure how well the physical equivalent would do.  Though, as I say, when called from an attachment it always worked well for me.

 

Link to comment
Share on other sites

I sell a HUD on Marketplace that has a TP to Cam position script that works with llMapDestination too.  Works like a dream. Thanks for mentioning Ezian's script, Innula.  I tried doing the same thing as an attachment with WarpPos/PosJump and had very squirrely results.  I ought to give his a try to see if it's more reliable.  Crossing a sim boundary with a pseudo-teleport can be bumpy.

Link to comment
Share on other sites

I've tried both solutions suggested by Roliq but both seem to only teleport me to the middle of the island.  I need to teleport to the specific place. While I know how to move around in SL, I'm building this for people who have a harder time adapting to moving in SL. Also, teaching people who rarely use SL or have never tried playing games on a computer to attach somerthing extra is something I woulld like to avoid.

EDIT: I've tried numerous postions now and it seems that some locations I can go to directly and some seem to take me to a different location than specified.

Link to comment
Share on other sites

Well, the example I posted will put you in the middle of the island, because that's where <128,128,22> is.  If you change those to your real target coordinates, it should work, unless your target sim has a telehub that forces incoming TPs to a preset spot.  The SLURL option will do the same thing.

 

default{     touch_start(integer num)     {          string target_spot = "http://maps.secondlife.com/secondlife/NewSimName/128/128/22";          llSay(0, "Click this link in your Chat History window to teleport >>> " + target_spot);     }}

 

 

Link to comment
Share on other sites

That's unfortunate, because a telehub negates your easy options.  Estate owners and managers or owners of a group to whom land is deeded can always TP freely, circumventing any telehubs or preset landing points, but nobody else can.

Link to comment
Share on other sites

Take a good look at the script that Innula mentioned.  As written, it TP's you to a camera position, but that's not the  important part of the script.  I think you could modify it to work as a sit TP and feed the position of the target directly to his jumpto function instead of feeding it a camera position.  

Normally, we think of position vectors within a single sim, but you can target a position on the other side of a sim border too.  If a position is 50m north of your sim's border, for example, its Y coordinate is 256.0 + 50.0 = 306.0 .   If it's 100m west of the sim's border, its X coordinate is -100.0.  So a target coordinate of <310.0,35.0,22.0>  should land you correctly at  <54.0,35.0,22.0> in the next sim.

Link to comment
Share on other sites

posJump may be able to beat the telehub restrictions... assuming the target parcel has object entry allowed. I recommend using the slower llSetPrimitiveParams with it, since the built in 0.2 delay makes it play better with the physics engine when unsitting

Link to comment
Share on other sites

I have a system that every day does thousands of cross-sim object transports (not teleports; no agents are transported).  Despite everything I've tried, they'll occasionally go very wrong for a short span, then recover and work correctly for thousands of repetitions before doing something stupid again for a while.  I suspect it has to do with conditions in the destination sim.

FWIW (and it's not worth much), I've had pretty much indistinguisable results from posJump and warpPos, so I mostly use posJump for efficiency, but I'll sometimes switch them, probably superstitiously.

With these, I move up close to the sim border, hop across with less than a 10m jump, then to the intended destination.  Judging by where these things end up when this fails, it seems most often to be because the new sim's coordinate system isn't quite in effect yet, so the coordinates of the next hop will end up being offset from the previous sim's origin.  Or something like that.

Link to comment
Share on other sites

Ok, I have something working. I edited Ezian Ecksol's Camjumper script to make it activate when one sits on the object and when at the location it removes and dies. I originally had it so people could touch it and then it would attach to them and take them to the desired location but forgot that only the owner can attach it. Here is the code:

// CamJumper (Dash)// © Ezian Ecksol. Use, modify, steal or sale as you like. Keep credits.//// usage: attach anywhere. Say /1 jc // to jump to cam position. works also to neighbour sims.// doesnt work most of the time if flying. integer jump_max=63;integer chan = 1;key user; integer wouldGoOffWorld(vector here, vector there) {     if (there.x < 0. || there.x >= 256. || there.y < 0. || there.y >= 256.)        return llEdgeOfWorld(here, there - here);    else        return FALSE;} jumpto(vector to, float time) {    vector e; vector from; vector s; float d; integer i; integer j;    vector from0;    vector region0; vector region;    from = llGetPos();     if (!wouldGoOffWorld(from, to)) {         region0 = llGetRegionCorner()/256.;         do {            region = llGetRegionCorner()/256.;            if (region != region0) {                if (region.x > region0.x)                    to.x -= 256.;                else if (region.x < region0.x)                    to.x += 256.;                if (region.y > region0.y)                    to.y -= 256.;                else if (region.y < region0.y)                    to.y += 256.;            }             from0 = from;            region0 = region;            d = llVecDist(from, to);            j = (integer)(d / jump_max)+1;            e = from + (to - from) / (float)j;            //llOwnerSay("j="+(string)j+", d="+(string)d+", to="+(string)to);             llMoveToTarget(e, time);            llSleep(.5);             from = llGetPos();         } while ((llVecDist(from, to) > 3.) && (llVecDist(from0, from) > 6.));        llStopMoveToTarget();        llRequestPermissions(user, PERMISSION_ATTACH);        llDetachFromAvatar();        llDie();     } else        llOwnerSay("Destination is - or would cross - off-world."); } default {    state_entry()     {        llSetText("CLick to be taken to the Actigraph area", <0,1,0>,1);        llSitTarget(<0,0,0.1>, llEuler2Rot(<0,0,90> * DEG_TO_RAD)/llGetRot());    }     run_time_permissions(integer perm)     {        if (perm & PERMISSION_ATTACH)        {            llAttachToAvatar(ATTACH_LLARM);           }        if (perm & PERMISSION_TRACK_CAMERA)        {            llSay(-99, "gone");            llSetText("Moving...", <0,1,0>,1);            llSetStatus(STATUS_PHYSICS, TRUE);            llSetStatus(STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z,FALSE);            jumpto(<363,203,97.7>, 1.05);        }                else            llOwnerSay("Did not get permissions, failed.");    }        changed(integer change)    {        if(change & CHANGED_LINK)        {            key user = llAvatarOnSitTarget();            if(user)            {                llRequestPermissions(user, PERMISSION_TRACK_CAMERA);            }        }    }     on_rez(integer start_param)     {        llResetScript();    }}

 Any constructive criticism accepted.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4801 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...