Difference between revisions of "LlTeleportAgent"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|inject-1={{LSL Generic/pre-release|3=RC Magnum channel}}
|inject-1={{LSL Generic/pre-release|3=RC Magnum channel}}
|inject-2={{LSL Function/avatar|avatar|region=*}}{{LSL Function/inventory|landmark|type=landmark|uuid=true|or=an empty string (for teleporting within the same region)}}
|inject-2={{LSL Function/avatar|avatar|region=*}}{{LSL Function/inventory|landmark|type=landmark|uuid=true|empty=(for teleporting within the same region)}}
|inject-3={{LSL_Function/permission|PERMISSION_TELEPORT|grant=<code>{{LSL Param|avatar}}</code>}}
|inject-3={{LSL_Function/permission|PERMISSION_TELEPORT|grant=<code>{{LSL Param|avatar}}</code>}}
|func=llTeleportAgent
|func=llTeleportAgent

Revision as of 07:34, 30 May 2012

Emblem-important-red.png Pre-release Documentation Warning!

This function is only available in RC Magnum channel. This documentation was written prior to its final release so it may not match the final implementation.

Summary

Function: llTeleportAgent( key avatar, string landmark, vector position, vector look_at );

Requests a teleport of avatar to a landmark stored in the object's inventory. If no landmark is provided (an empty string), the avatar is teleported to the location position in the current region. In either case, the avatar is turned to face the position given by look_at in local coordinates.

• key avatar avatar UUID that is in the same region (the avatar to teleport)
• string landmark a landmark in the inventory of the prim this script is in, a UUID of a landmark or an empty string (for teleporting within the same region)
• vector position The position within the local region to teleport the avatar to if no landmark was provided.
• vector look_at The position within the target region that the avatar should be turned to face upon arrival.

To run this function the script must request the PERMISSION_TELEPORT permission with llRequestPermissions and it must be granted by avatar.

Caveats

  • If landmark is not an empty string and...
    • landmark is missing from the prim's inventory and it is not a UUID or it is not a landmark then an error is shouted on DEBUG_CHANNEL.
  • If landmark is a UUID then there are no new asset permissions consequences for the object.
    • The resulting object develops no new usage restrictions that might have occurred if the asset had been placed in the prims inventory.
Permissions
  • Once the PERMISSION_TELEPORT permission is granted there is no way to revoke it except from inside the script (for example, with a new llRequestPermissions call) or the script is reset or deleted.
  • Sitting avatars cannot be teleported using this function. You must llUnSit them first.

Examples

Without a landmark in the object's inventory <lsl>key teleportee;

default {

   state_entry()
   {
       llSay(0, "Touch to teleport");
   }
   touch_start(integer total_num)
   {
       teleportee = llDetectedKey(0);
       llRequestPermissions(teleportee, PERMISSION_TELEPORT);
   }
   
   run_time_permissions(integer perm)
   {
       if(PERMISSION_TELEPORT & perm)
       {
           llTeleportAgent(teleportee, "", <13.0, 38.0, 23.5>, <13.0, 12.0, 23.5>);
       }
   }

} </lsl> With a landmark in the objects inventory <lsl> key teleportee;

default {

   state_entry()
   {
       llSay(0, "Touch to teleport");
   }
   touch_start(integer total_num)
   {
       teleportee = llDetectedKey(0);
       llRequestPermissions(teleportee, PERMISSION_TELEPORT);
   }
   
   run_time_permissions(integer perm)
   {
       if(PERMISSION_TELEPORT & perm)
       {
           llTeleportAgent(teleportee, "Experience Tools 1", <0.0, 0.0, 0.0>, <0.0, 0.0, 0.0>);
       }
   }

}

</lsl>

See Also

Events

•  run_time_permissions Permission receiving event

Functions

•  llGetPermissions Get the permissions granted
•  llGetPermissionsKey Get the agent who granted permissions
•  llRequestPermissions Request permissions
•  llTeleportAgentGlobalCoords Teleports an agent to a global position.

Articles

•  Script permissions

Deep Notes

Signature

function void llTeleportAgent( key avatar, string landmark, vector position, vector look_at );