User:haravikk Mistral/LlTeleportAgent

From Second Life Wiki
< User:Haravikk Mistral
Revision as of 01:58, 30 May 2012 by Haravikk Mistral (talk | contribs) (Created page with "{{LSL_Function |func_id|mode=request |func_sleep=0.0 |func_energy=10.0 |func=llTeleportAgent |sort=TeleportAgent |p1_type=key|p1_name=avatar|p1_desc=The key of the avatar for whi…")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 pos, vector look_at );
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.

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?
       vector pos = llList2Vector(llGetObjectDetails(teleportedAgent, [OBJECT_POS]), 0);
if ((pos == ZERO_VECTOR)

Notes

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

Deep Notes

Signature

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