Difference between revisions of "LlTeleportAgent"

From Second Life Wiki
Jump to navigation Jump to search
Line 5: Line 5:
|func=llTeleportAgent
|func=llTeleportAgent
|sort=TeleportAgent
|sort=TeleportAgent
|p1_type=key|p1_name=avatar
|p1_type=key|p1_name=avatar|p1_desc=The key of the avatar for which to request a teleport.
|p2_type=string|p2_name=region
|p2_type=string|p2_name=region|p2_desc=The region to teleport the avatar to. Provide with an empty string, or the name of the current region, for a local teleport.
|p3_type=vector|p3_name=pos
|p3_type=vector|p3_name=pos|p3_desc=The position within the region to teleport the avatar to. If the value of the X or Y component is less than <code>0.0</code> or greater than or equal to <code>256.0</code>, then a local teleport will become a global one.
|p4_type=vector|p4_name=look_at
|p4_type=vector|p4_name=look_at|p4_desc=The position within the region that the avatar should be turned to face upon arrival.
|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.
|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
Line 40: Line 40:
|related
|related
|also
|also
|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.
|notes=This would be extremely useful in complex builds such as Stargates, HUDS and other teleportation creations.
*  See {{JIRA|SVC-212}} for the JIRA listing for this function.
* <code>look_at</code> is included to match [[llMapDestination]]'s still pending <code>look_at</code> functionalty (see {{jira|VWR-23580}}).
*  See {{jira|SVC-212}} for the JIRA listing for this function.
}}
}}

Revision as of 03:35, 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 <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 );