OsTeleportAgent

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(added additional reference links)
(Listed function variants and extended description)
Line 1: Line 1:
Example Script for Teleporting Agent using osTeleportAgent.
+
'''osTeleportAgent(key UUID, string destinationTarget, vector position, vector lookAt)''' <br />
 +
'''osTeleportAgent(key UUID, integer regionX, integer regionY, vector position, vector lookAt)''' <br />
 +
'''osTeleportAgent(key UUID, vector position, vector lookAt)'''
  
Syntax:&nbsp; osTeleportAgent(key UUID, string "DestinationTarget", vector LandingZone, vector LookAt)  
+
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.
  
This must be Activated / Allowed in OpenSim.ini for operation.&nbsp;
+
These functions have a [[threat level]] of ''High'' and must be allowed in OpenSim.ini for operation (see [[OSSL Enabling Functions]] for examples).
  
Please refer to [[OSSL_Enabling_Functions]]&nbsp; &amp;&nbsp;&nbsp; [[OSSL_Implemented]]
 
  
 
+
<source lang="lsl">// Example osTeleportAgent Script
 
+
<source lang="ini">// Example osTeleportAgent Script
+
 
//
 
//
 
// Set Destination as described below, There are a Few Options depending on Application:
 
// Set Destination as described below, There are a Few Options depending on Application:
Line 29: Line 28:
 
default
 
default
 
{
 
{
on_rez(integer start_param)
+
  on_rez(integer start_param)
{
+
  {
llResetScript();
+
    llResetScript();
}
+
  }
changed(integer change) // something changed, take action
+
  changed(integer change) // something changed, take action
{
+
  {
if(change & CHANGED_OWNER)
+
    if(change & CHANGED_OWNER)
{
+
      llResetScript();
llResetScript();
+
    else if (change & 256) // that bit is set during a region restart
}
+
      llResetScript();
else if (change & 256) // that bit is set during a region restart
+
  }
{
+
  state_entry()
llResetScript();
+
  {
}
+
    llWhisper(0, "OS Teleportal Active");
}
+
  }
+
  touch_start(integer num_detected)  
state_entry()
+
  {
{
+
    key avatar = llDetectedKey(0);
llWhisper(0, "OS Teleportal Active");
+
    llInstantMessage(avatar, "Teleporting you to : "+Destination);
}
+
    osTeleportAgent(avatar, Destination, LandingPoint, LookAt);  
+
  }
touch_start(integer num_detected)  
+
{
+
key avatar = llDetectedKey(0);
+
llInstantMessage(avatar, "Teleporting you to : "+Destination);
+
osTeleportAgent(avatar, Destination, LandingPoint, LookAt);  
+
}
+
 
}</source>
 
}</source>

Revision as of 14:39, 15 November 2010

osTeleportAgent(key UUID, string destinationTarget, vector position, vector lookAt)
osTeleportAgent(key UUID, integer regionX, integer regionY, vector position, vector lookAt)
osTeleportAgent(key UUID, vector position, vector lookAt)

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.

These functions have a threat level of High and must be allowed in OpenSim.ini for operation (see OSSL Enabling Functions for examples).


// 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
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