Difference between revisions of "LlTeleportAgentGlobalCoords"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "{{KBwarning|This function is still under development and is subject to change at any time.}} {{LSL_Function |func=llTeleportAgentGlobalCoords |func_desc=Teleports an <code>agent<…")
 
m (for grins)
Line 1: Line 1:
{{KBwarning|This function is still under development and is subject to change at any time.}}
{{LSL_Function
{{LSL_Function
|inject-1={{LSL Generic/pre-release|3=RC Magnum channel}}
|inject-2={{LSL Function/avatar|agent|region=*}}
|inject-3={{LSL_Function/permission|PERMISSION_TELEPORT|grant=<code>{{LSL Param|agent}}</code>}}
|func=llTeleportAgentGlobalCoords
|func=llTeleportAgentGlobalCoords
|func_desc=Teleports an <code>agent</code> to set of a <code>region_coordinates</code> within a region at the specified <code>global_coordinates</code>.  The agent lands facing the position defined by <code>look_at</code> local coordinates.  A region's global coordinates can be retrieved using <code>[[llRequestSimulatorData]](region_name, DATA_SIM_POS)</code>
|func_desc=Teleports an <code>{{LSL Param|agent}}</code> to set of a <code>{{LSL Param|region_coordinates}}</code> within a region at the specified <code>{{LSL Param|global_coordinates}}</code>.  The agent lands facing the position defined by <code>{{LSL Param|look_at}}</code> local coordinates.  A region's global coordinates can be retrieved using <code>[[llRequestSimulatorData]](region_name, DATA_SIM_POS)</code>
|func_footnote=This call requires [[PERMISSION_TELEPORT]], which must be requested with [[llRequestPermissions]].  The combination of [[llRequestSimulatorData]] and [[llTeleportAgentGlobalCoords]] allows agents to be teleported to regions by region name.
|func_footnote=This call requires [[PERMISSION_TELEPORT]], which must be requested with [[llRequestPermissions]].  The combination of [[llRequestSimulatorData]] and [[llTeleportAgentGlobalCoords]] allows agents to be teleported to regions by region name.
|p1_type=key
|p1_type=key
|p1_name=avatar
|p1_name=agent
|p1_desc=The key of the avatar to be teleported.
|p1_desc=&#32;(avatar to be teleported)
|p2_type=vector
|p2_type=vector
|p2_name=global_coordinates
|p2_name=global_coordinates
Line 16: Line 18:
|p4_name=look_at
|p4_name=look_at
|p4_desc=Location avatar will face after completing the teleport, given in local coordinates.
|p4_desc=Location avatar will face after completing the teleport, given in local coordinates.
|caveats=* Use of this call requires the target avatar to have granted [[PERMISSION_TELEPORT]], which must be requested using [[llRequestPermissions]].
|caveats=
* Sitting avatars cannot be teleported using this function.
* Sitting avatars cannot be teleported using this function. You must [[llUnSit]] them first.
|examples=<lsl>
|examples=<lsl>
key agent;
key agent;
Line 57: Line 59:
}
}
</lsl>
</lsl>
|also_functions=*[[llRequestPermissions]]
|also_functions=
*[[llRequestSimulatorData]]
{{LSL DefineRow||[[llRequestSimulatorData]]|Useful for requesting simulator position}}
*[[llTeleportAgent]]
{{LSL DefineRow||[[llTeleportAgent]]|Teleporting agents to a landmark or position in the region.}}
}}
}}

Revision as of 23:01, 29 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: llTeleportAgentGlobalCoords( key agent, vector global_coordinates, vector region_coordinates, vector look_at );

Teleports an agent to set of a region_coordinates within a region at the specified global_coordinates. The agent lands facing the position defined by look_at local coordinates. A region's global coordinates can be retrieved using llRequestSimulatorData(region_name, DATA_SIM_POS)

• key agent avatar UUID that is in the same region (avatar to be teleported)
• vector global_coordinates Global coordinates of the destination region. Can be retrieved by using llRequestSimulatorData(region_name, DATA_SIM_POS).
• vector region_coordinates Destination position inside the target region, given in local coordinates.
• vector look_at Location avatar will face after completing the teleport, given in local coordinates.

To run this function the script must request the PERMISSION_TELEPORT permission with llRequestPermissions and it must be granted by agent. This call requires PERMISSION_TELEPORT, which must be requested with llRequestPermissions. The combination of llRequestSimulatorData and llTeleportAgentGlobalCoords allows agents to be teleported to regions by region name.

Caveats

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.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl> key agent; vector gloc = <0,0,0>; integer have_gloc = 0;

default {

  state_entry()
  {
      llSay(0, "Caching Global Coords for Experience Tools 4");
      llRequestSimulatorData( "Experience Tools 4", DATA_SIM_POS );
  }
  touch_start(integer total_number)
  {
      if ( have_gloc )
      {
          agent = llDetectedKey(0);
          llRequestPermissions(agent, PERMISSION_TELEPORT);
      }
  }
  run_time_permissions(integer perms)
  {
      if (perms & PERMISSION_TELEPORT)
      {
          vector mt = <96,100,21>;
          llTeleportAgentGlobalCoords( agent, gloc, mt, <0,0,0> );
      }
  }
  dataserver(key qid, string data)
  {
      llSay(0, "Received Global Coords for Experience Tools 4");
      gloc = (vector)data;
      have_gloc = 1;
  }

}

</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
•  llRequestSimulatorData Useful for requesting simulator position
•  llTeleportAgent Teleporting agents to a landmark or position in the region.

Articles

•  Script permissions

Deep Notes

Search JIRA for related Issues

Signature

function void llTeleportAgentGlobalCoords( key agent, vector global_coordinates, vector region_coordinates, vector look_at );