llTeleportAgent

From Second Life Wiki
Jump to navigation Jump to search
Emblem-important-yellow.png LSL Feature Request
The described function does not exist. This article is a feature request.

Summary

Function: llTeleportAgent( key avatar, string region, vector <span title="The position within the region to teleport the avatar to. If the value of the X or Y component is less than 0.0 or greater than or equal to 256.0, then a local teleport will become a global one." style="border-bottom:1px dotted; cursor:help;">pos, vector look_at );
REQUEST Function ID
0.0 Forced Delay
10.0 Energy

Requests a teleport of avatar to location pos within region, turning the avatar to face the position given by look_at. Providing an empty string for region requests a local teleport, and is identical to explicitly providing the name of the current region.

• key avatar The key of the avatar for which to request a teleport.
• string region The region to teleport the avatar to. Provide with an empty string, or the name of the current region, for a local teleport.
• vector pos The position within the region to teleport the avatar to. If the value of the X or Y component is less than 0.0 or greater than or equal to 256.0, then a local teleport will become a global one.
• vector look_at The position within the region that the avatar should be turned to face upon arrival.

Caveats

  • This function sends requests to an agent's viewer, compatible with calls to llMapDestination() in unsupported viewers.
  • By default, viewers that permit automatic teleportation will do so if:
    • The scripted object is worn by the avatar being teleported.
    • The scripted object belongs to the land-owner of the parcel that the avatar is currently within, and the requested teleport is a local one.
  • Other requests, or all requests for viewers that have disabled automatic teleportation, will trigger a dialogue giving details of the teleport request.
  • This function is throttled at 10 requests per every 30 seconds by the simulator, and 1 per every 20 seconds in supported viewers.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>default {

   key teleportedAgent;
   touch_start(integer x) {
       llTeleportAgent(teleportedAgent = llDetectedKey(0), "", <128.0, 128.0, 25.0>, <129.0, 128.0, 25.0>);
       llSetTimerEvent(30.0);
   }
   timer() {
       // Is the teleported avatar still nearby?
       if (llVecDist(llGetPos(), llList2Vector(llGetObjectDetails(teleportedAgent, [OBJECT_POS]), 0)) > 10.0) {
           // Teleport request appears to have been accepted
       } else {
           // Teleport request appears to have been refused
       }
       llSetTimerEvent(0.0);
   }
}</lsl>

Notes

This would be extremely useful in complex builds such as Stargates, HUDS and other teleportation creations.

Deep Notes

Search JIRA for related Issues

Signature

//function void llTeleportAgent( key avatar, string region, vector pos, vector look_at );