OsLocalTeleportAgent

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
Line 33: Line 33:
 
   }
 
   }
 
}</source>
 
}</source>
|description=Teleports an avatar with uuid agentID to the specified newPosition within same region.  
+
|description=
 +
<div style="background-color:#FFA0A0; padding:10px; padding-bottom:5px; border: 1px #FF544F solid">
 +
'''Caution !''' Only supported by '''ubOde''' for now
 +
</div>
 +
Teleports an avatar with uuid agentID to the specified newPosition within same region.  
 
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.<br>
 
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.<br>
 
<br>
 
<br>

Revision as of 13:43, 1 May 2019

void osLocalTeleportAgent(key agentID, vector newPosition, vector newVelocity, vector newLookat, integer optionFlags)

Caution ! Only supported by ubOde for now

Teleports an avatar with uuid agentID to the specified newPosition within same region. 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.

If newPosition is outside the region the target will be at nearest region border.

OptionFlags is a bit field:
bit 0 (mask 1): use newVelocity
bit 1 (mask 2): use newLookAt
bit 2 (mask 4): align lookat to velocity if not zero
bit 3 (mask 8): fly
bit 4 (mask 16): do not fly

if both bits 1 and 2 are set bit 2 is ignored
if both bits 3 and 4 are set bit 4 is ignored

Threat Level Severe
Permissions ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Extra Delay 5 seconds
Example(s)
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 : " + (string)LandingPoint);
    osLocalTeleportAgent(avatar, LandingPoint, ZEROVECTOR, <0,1,0>, 2); 
  }
}
Personal tools
General
About This Wiki