Hypergate Teleport Script

The following is a script you can place on any object to turn it into a hypergrid teleportation portal.

If you put it on something that looks like a giant blue swirly circle, everyone will know that it’s a hypergate. But you can also use it to create teleport buttons or a teleportation doorway, or anything else.

Notes: Change the destination in the first line of the script — the hypergrid address goes inside the quotation marks. Right now, it’s set to go to LBSA Plaza.

Warning: You can only travel 4,096 regions in any direction. If you’re on ReactionGrid, you can’t jump to OSGrid center — they’re too far apart. But you can jump to some intermediary regions, first. You also can’t jump to another region with the same exact coordinates as yours, you can’t jump to a region that’s running HG 1.5 if you’re running HG 1.0 and vice versa. (ReactionGrid is currently on HG 1.0, and OSGrid is on HG 1.5.) You also need to have hypergrid enabled on your home region.

The script below uses both the “touch-start” function and the “collision” function. You can cut out the part you don’t need. So if you want the hypergate to work only when touched, take out the two lines at the end of the script that start with “collision”. If you want the gate to work only when someone walks into it, take out the two lines near the end of the script that start with “touch_start”.

In order for the collision detection to work, the gate must not be phantom. However, you can put some a nice watery object in front of it to create the illusion that you’re walking through that weird Stargate plasma stuff.

The script uses the LLMapDestination command. This brings up the map, with the destination coordinate filled in. Hit the “search” button and then hit “teleport.” You can also use the OSTeleport command instead, which doesn’t work on all regions — you have to have OS functions enabled, and set the threat level to high. Check with your hosting provider for more details.

Here is the OS function alternative:

osTeleportAgent( WhomToTeleport, SimName, LandingPoint, LookAt );

Hypergate Teleport Script

string SimName = “hg.osgrid.org:80“;
vector LandingPoint = <128.0, 128.0, 36.0>;
vector LookAt       = <1.0,1.0,0.0>;
list LastFewAgents;
PerformTeleport( key WhomToTeleport )
{   integer CurrentTime = llGetUnixTime();
integer AgentIndex = llListFindList( LastFewAgents, [ WhomToTeleport ] );
if (AgentIndex != -1)
{     integer PreviousTime = llList2Integer( LastFewAgents, AgentIndex+1 );
if (PreviousTime >= (CurrentTime – 5)) return;
LastFewAgents = llDeleteSubList( LastFewAgents, AgentIndex, AgentIndex+1);
LastFewAgents += [ WhomToTeleport, CurrentTime ];
llMapDestination(SimName, LandingPoint, LookAt);
{   state_entry()
{  llSetText(SimName, <1,1,1>, 1);
touch_start(integer number)
{    PerformTeleport( llDetectedKey( 0 ));  }
collision(integer number)
{    PerformTeleport( llDetectedKey( 0 ));  }
Maria Korolov