OsLocalTeleportAgent

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Created page with "{{osslfunc |threat_level=Severe |permissions=${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER |delay=5 |additional_info= '''osTeleportAgent''' has a 0.5 second delay if ...")
 
Line 4: Line 4:
 
|delay=5
 
|delay=5
 
|additional_info=
 
|additional_info=
'''osTeleportAgent''' has a 0.5 second delay if the teleport is not allowed, or when the destination is to a location in the same region as the Agents current region.
+
|function_syntax=void osLocalTeleportAgent(key agent, vector position, vector lookat, integer flags)
|function_syntax=void osTeleportAgent(key agent, integer regionX, integer regionY, vector position, vector lookat)<br />
+
void osTeleportAgent(key agent, string regionName, vector position, vector lookat)<br />
+
void osTeleportAgent(key agent, vector position, vector lookat)
+
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
// 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/Detination 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
 
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 LandingPoint = <128,128,50>; // X,Y,Z landing point for avatar to arrive at
Line 51: Line 34:
 
   }
 
   }
 
}</source>
 
}</source>
|description=Teleports an agent to the specified location. The first variant is able to teleport to any addressable region, including [[hypergrid]] destinations. The second variant teleports to a region in the local grid; the region coordinates are specified as region cells (not as global coordinates based on meters). The third variant teleports within the current region.
+
|description=Teleports an agent to the specified location within same region.  
  
For osTeleportAgent() to work, the owner of the prim containing the script must be the same as the parcel that the avatar is currently on.  If this isn't the case then the function fails silently.
+
For osLocalTeleportAgent() to work, the owner of the prim containing the script must also be owner of the parcel where the avatar is currently on. The Avatar must have rights to enter the target position.  If this isn't the case then the function fails silently.
  
See also  [[osTeleportOwner]], and if you receive an error see [[OSSL Enabling Functions|how to enable OS functions]].
 
 
|
 
|
 
}}
 
}}

Revision as of 13:34, 1 May 2019

void osLocalTeleportAgent(key agent, vector position, vector lookat, integer flags)
Teleports an agent to the specified location within same region.

For osLocalTeleportAgent() to work, the owner of the prim containing the script must also be owner of the parcel where the avatar is currently on. The Avatar must have rights to enter the target position. If this isn't the case then the function fails silently.

Threat Level Severe
Permissions ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Delay 5 seconds
Example(s)
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); 
  }
}
Personal tools
General
About This Wiki