Difference between revisions of "LlTeleportAgent"

From Second Life Wiki
Jump to navigation Jump to search
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|func_id|mode=request
|func_id|mode=request
|func_sleep=0.1
|func_sleep=0.0
|func_energy=10.0
|func_energy=10.0
|func=llTeleportAgent
|func=llTeleportAgent
Line 9: Line 9:
|p3_type=vector|p3_name=pos
|p3_type=vector|p3_name=pos
|p4_type=vector|p4_name=look_at
|p4_type=vector|p4_name=look_at
|func_desc=Teleports agent <code>avatar</code> to location <code>pos</code> within <code>region</code>, turning the avatar to face the position given by <code>look_at</code>.
|func_desc=Requests a teleport of <code>avatar</code> to location <code>pos</code> within <code>region</code>, turning the avatar to face the position given by <code>look_at</code>. Providing an empty string for <code>region</code> requests a local teleport, and is identical to explicitly providing the name of the current region.
|return_text
|return_text
|spec
|spec
|caveats=* This function requires <code>PERMISSION_TELEPORT</code> to be granted, this permission is auto-granted when requested for an avatar wearing or sat upon the scripted object, or if the requested avatar is on land owned by the scripted object's owner. Do not rely on the auto-grant feature of the permission, instead always make proper use of the [[run_time_permissions]]() event.
|caveats=* This function sends requests to an agent's viewer, compatible with calls to [[llMapDestination]]() in unsupported viewers.
** This function will silently fail if requested for an avatar that is no longer on land with the same owner as the scripted object. This is a special case for objects on land only; attachments and sat upon objects will teleport normally.
* By default, viewers that permit automatic teleportation will do so if:
* An empty string (<code>""</code>) for <code>region</code> indicates a local teleport and is identical to calling <code>llTeleportAgent(id, llGetRegionName(), pos, look_at);</code>.  
** The scripted object is worn by the avatar being teleported.
* Same-region teleports are instantaneous, however all teleports are throttled such that a request will silently fail if made within 5 seconds of a previous teleport completing.
** 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.
* Upon completion of a teleport the user will receive a teleport complete notice in chat as normal, this will include a "Block" link that will revoke an object's teleport permissions, detaching if necessary, allowing avatars to quickly and easily block malicious teleport requests.
* 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.
|examples=<lsl>default {
|examples=<lsl>default {
    key teleportedAgent;
     touch_start(integer x) {
     touch_start(integer x) {
         llRequestPermissions(llDetectedKey(0), PERMISSION_TELEPORT);
         llTeleportAgent(teleportedAgent = llDetectedKey(0), "", <128.0, 128.0, 25.0>, <129.0, 128.0, 25.0>);
        llSetTimerEvent(30.0);
     }
     }
     run_time_permissions(integer perms) {
 
         if (perms & PERMISSION_TELEPORT)
     timer() {
            llTeleportAgent(llGetPermissionsKey(), "", <128.0, 128.0, 25.0>, <129.0, 128.0, 25.0>);
        // 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>
}</lsl>

Revision as of 03:29, 29 June 2011

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 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
• string region
• vector pos
• vector look_at

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. NOTE: look_at is included to match llMapDestination's look_at possible future functionality, which currently does nothing.

  • See SVC-212 for the JIRA listing for this function.

Deep Notes

Search JIRA for related Issues

Signature

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