llTeleportAgentGlobalCoords

From Second Life Wiki
Revision as of 14:25, 29 May 2012 by Jeremy Linden (talk | contribs) (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<…")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
KBwarning.png Warning: This function is still under development and is subject to change at any time.

Summary

Function: llTeleportAgentGlobalCoords( key avatar, 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 avatar The key of the 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.

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

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>

Deep Notes

Search JIRA for related Issues

Signature

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