osTeleportAgent for hypergrid teleports

Creating scripts
Post Reply
User avatar
Dot Matrix
Posts: 1626
Joined: Sun Jul 28, 2013 3:26 am
Has thanked: 1209 times
Been thanked: 2326 times

osTeleportAgent for hypergrid teleports

Post by Dot Matrix »

I'm trying to make a single destination HG teleport HUD button by adapting the script from http://opensimulator.org/wiki/OsTeleportAgent -- copied below for completeness. The intention is to make it straightforward for Metaverse Tourists to find their way back to a central spot if they get lost anywhere on the hypergrid.

Code: Select all

// Example osTeleportAgent Script
//
// Set Destination as described below, There are a Few Options depending on Application:
// IN GRID Teleport 
// Destination = "1000,1000"; = Using In-Grid Map XXXX,YYYY coordinates
// Destination = "RegionName"; = Using RegionName
// HyperGrid Teleport (region must be HG Enabled)
// Destination = "TcpIpAddr:Port:RegionName"; = Using the Target/Destination IP Address
// Destination = "DNSname:Port:RegionName"; = Using the Target/Destination DNSname
// Note: RegionName is Optionally Specified to deliver Avatar to specific region in an instance.
// 
// ========================================================================================
// === SET DESTINATION INFO HERE ===
//
string Destination = "LBSA Plaza"; // your target destination here (SEE NEXT LINES) Can Be
vector LandingPoint = <128,128,50>; // X,Y,Z landing point for avatar to arrive at
vector LookAt = <1,1,1>; // which way they look at when arriving
//
default
{
  on_rez(integer start_param)
  {
    llResetScript();
  }
  changed(integer change) // something changed, take action
  {
    if(change & CHANGED_OWNER)
      llResetScript();
    else if (change & 256) // that bit is set during a region restart
      llResetScript();
  }
  state_entry()
  {
    llWhisper(0, "OS Teleportal Active");
  }
  touch_start(integer num_detected) 
  {
    key avatar = llDetectedKey(0);
    llInstantMessage(avatar, "Teleporting you to : "+Destination);
    osTeleportAgent(avatar, Destination, LandingPoint, LookAt); 
  }
}
This script works for in-grid teleports within Kitely, where you just put the region name.

However, it doesn't seem to work for hypergrid teleports, for destinations using "DNSname:Port:RegionName", both within and outside Kitely.

For destinations within Kitely, the message is "Teleport failed. The region "grid.kitely.com:8002:RegionName" could not be found."

For destinations outside Kitely, the message is "Teleport failed. The region you tried to teleport to doesn't exist anymore". However, pasting the external HG address into the map works ("Region found"), so the region does exist.

What am I doing wrong?
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1142 times

Re: osTeleportAgent for hypergrid teleports

Post by Graham Mills »

This dumps you in the sea at Romenna.

Code: Select all

default
{
    touch_start(integer n)
    {
        osTeleportAgent(llDetectedKey(0),"www.pmgrid.org:8002:rom31",<248,140,27>,<0,0,0>); 
    }
}
Mind you, a fair few cross-grid teleports failed for some reason.

This worked within Kitely but I wasn't able to check other grids.

Code: Select all

default
{
    touch_start(integer n)
    {
        osTeleportAgent(llDetectedKey(0),"Micrographia",<239,208,22>,<0,0,0>); 
    }
}

Last edited by Graham Mills on Mon Jan 26, 2015 2:04 pm, edited 1 time in total.
These users thanked the author Graham Mills for the post:
Dot Matrix
User avatar
Dot Matrix
Posts: 1626
Joined: Sun Jul 28, 2013 3:26 am
Has thanked: 1209 times
Been thanked: 2326 times

Re: osTeleportAgent for hypergrid teleports

Post by Dot Matrix »

Thanks, Graham.

I've just tried the first script, as given, from Vespers, which is HG enabled.

The first time I clicked the prim I get an error message that "The destination region doesn't exist anymore."

The second time I clicked it, the teleport worked. Hurray!

But why don't things work every time?!

Edited to add... what an impressive destination!
These users thanked the author Dot Matrix for the post:
Selby Evans
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1142 times

Re: osTeleportAgent for hypergrid teleports

Post by Graham Mills »

Yes, Romenna is a great place to visit but historically has always suffered performance-wise. A great place to take a friend but not a safari.
Dot Matrix wrote:
Edited to add... what an impressive destination!
These users thanked the author Graham Mills for the post:
Constance Peregrine
User avatar
Dot Matrix
Posts: 1626
Joined: Sun Jul 28, 2013 3:26 am
Has thanked: 1209 times
Been thanked: 2326 times

Re: osTeleportAgent for hypergrid teleports

Post by Dot Matrix »

As an alternative method for getting people to the same spot, I've been trying

Code: Select all

    default
    {
        touch_start(integer n)
        {
            llMapDestination("www.pmgrid.org:8002:rom31",<248,140,27>,<0,0,0>);
        }
    }
Providing the position is in the SW area of a varregion (i.e. x and y are less than 256), this method works. Unfortunately, I'm trying to get people to the NE area.
User avatar
Selby Evans
Posts: 620
Joined: Wed Sep 04, 2013 6:00 pm
Has thanked: 1840 times
Been thanked: 822 times

Re: osTeleportAgent for hypergrid teleports

Post by Selby Evans »

Dot Matrix wrote:Thanks, Graham.

I've just tried the first script, as given, from Vespers, which is HG enabled.

The first time I clicked the prim I get an error message that "The destination region doesn't exist anymore."

The second time I clicked it, the teleport worked. Hurray!

But why don't things work every time?!

Edited to add... what an impressive destination!
I don't know why, but I can confirm that HG travel attempts often result in that message. My blog is carrying the advice to ignore that message on the first try. Most of the time it works on the second try. My guess is that the time-out is set too soon and does not allow enough time for the timeout to complete unless the database is already accessed.
These users thanked the author Selby Evans for the post:
Dot Matrix
User avatar
Dot Matrix
Posts: 1626
Joined: Sun Jul 28, 2013 3:26 am
Has thanked: 1209 times
Been thanked: 2326 times

Re: osTeleportAgent for hypergrid teleports

Post by Dot Matrix »

Thanks, Selby!

A further test using llMapDestination suggests that focusing on a single region rather than part of a varregion is helpful.

And using the original script with a single region also works.

/me scratches head.
User avatar
Dot Matrix
Posts: 1626
Joined: Sun Jul 28, 2013 3:26 am
Has thanked: 1209 times
Been thanked: 2326 times

Re: osTeleportAgent for hypergrid teleports

Post by Dot Matrix »

Testing the HUD with Daniel Hoffman's help, I made another discovery. Using the HUD with osTeleportAgent does not work if you are not on your own land (to do with threat level). So it looks like I need to use llMapDestination in a general-purpose HUD.
Post Reply