LlMapDestination

From Second Life Wiki

Jump to: navigation, search

Template:Needs Translation/LSL/de Template:Needs Translation/LSL/es Template:Needs Translation/LSL/el Template:Needs Translation/LSL/he Template:Needs Translation/LSL/it Template:Needs Translation/LSL/ko Template:Needs Translation/LSL/nl Template:Needs Translation/LSL/hu Template:Needs Translation/LSL/no Template:Needs Translation/LSL/da Template:Needs Translation/LSL/sv Template:Needs Translation/LSL/tr Template:Needs Translation/LSL/pl Template:Needs Translation/LSL/pt Template:Needs Translation/LSL/ru Template:Needs Translation/LSL/uk Template:Needs Translation/LSL/zh-Hans Template:Needs Translation/LSL/zh-Hant

Contents

Summary

Buggy
Function: llMapDestination( string simname, vector pos, vector look_at );
309 Function ID
1.0 Delay
10.0 Energy

Opens world map centered on simname with pos highlighted.
Only works for scripts attached to avatar, or during touch events.

• string simname Region name
• vector pos Region coordinates
• vector look_at not used

(NOTE: look_at currently does nothing)

Caveats

  • This function causes the script to sleep for 1.0 seconds.
  • if simname is omitted or invalid, the map will open centered on object, but pos will not be highlighted. Since this function requests the client to perform a task, there is no way for script to know if it has failed.

Important Issues

~ Search JIRA for related Bugs
Bug - A problem which impairs or prevents the functions of the product. Fix Pending - Issues that have been fixed in Linden Lab's internal codebase, but not yet deployed in a viewer    llMapDestination in attachments opens a map on owner's screen even when touched by someone else
Bug - A problem which impairs or prevents the functions of the product. Open - The issue is open and ready for the assignee to start work on it.    llMapDestination pos parameter is sometimes replaced with incorrect data (workaround included)
Bug - A problem which impairs or prevents the functions of the product. Fix Pending - Issues that have been fixed in Linden Lab's internal codebase, but not yet deployed in a viewer    height in pos is capped to 1000m (code patch included)

Examples

//Click the object this script is in and your map opens up in the middle of Oasis.
default
{
     touch_start(integer num)
     {
          llMapDestination("Oasis", <128, 128, 0>, ZERO_VECTOR);
     }
}

 
// Get a teleport map, via touch_start, from the name of the first landmark in inventory.
// NOTE:  Requires a landmark that contains name, region and position data.
//        The correct format is "name, region (x, y, z)".  If a landmark's 
//        name is too long the position data is truncated from the end, 
//        which will cause the position to be wrong.
default
{
     touch_start(integer num)
     {
          // Parse the name of the first landmark found in inventory into a list using 
          // commas as separators.
          list lstTemp = llParseString2List(llGetInventoryName(
               INVENTORY_LANDMARK,0),[","],[]);
 
          // Get list length and subtract 3 to get the correct element containing
          // the region name.  Moving backward from the end of the list keeps
          // commas in the landmark name from giving us grief with misaligned
          // and incorrect data.
          integer intElement = llGetListLength(lstTemp)-3;
 
          // Get the region name from the list element, eliminating unneeded 
          // characters in the string and trimming leading/trailing spaces.
          string strSimname = llStringTrim(llGetSubString(llList2String(lstTemp,
               intElement),0,llSubStringIndex(llList2String(lstTemp,intElement),"(")-1),
               STRING_TRIM);    
 
          // The vector is pulled from the landmark name, based on the 
          // position of "(" in the string starting with the next 
          // character and ending with the second to the last character.
          vector vecVector = (vector)("<"+llGetSubString(llGetInventoryName(
               INVENTORY_LANDMARK,0),llSubStringIndex(llGetInventoryName(
               INVENTORY_LANDMARK,0),"(")+1,-2)+">");
 
          // Bring up the teleport map using the data we extracted.
          llMapDestination(strSimname,vecVector,ZERO_VECTOR);
     }
}

Notes

  • pos will work with Region coordinates not inside simname. (like those returned by llRequestInventoryData)
  • if called from non touch events, it only works for the owner.
  • if called from touch, it may only work for the first or last touch in the event queue (example: num_touched > 1)
  • if called inside an attachment, it only works for the owner.

See Also

Functions

•  llRequestInventoryData

Deep Notes

Issues

~ Search JIRA for related Issues
New Feature - A new feature of the product, which has yet to be developed. Fix Pending - Issues that have been fixed in Linden Lab's internal codebase, but not yet deployed in a viewer    Throttle llMapDestination to prevent "map bombing".
Bug - A problem which impairs or prevents the functions of the product. Fix Pending - Issues that have been fixed in Linden Lab's internal codebase, but not yet deployed in a viewer    llMapDestination in attachments opens a map on owner's screen even when touched by someone else
Bug - A problem which impairs or prevents the functions of the product. Open - The issue is open and ready for the assignee to start work on it.    llMapDestination pos parameter is sometimes replaced with incorrect data (workaround included)
Bug - A problem which impairs or prevents the functions of the product. Fix Pending - Issues that have been fixed in Linden Lab's internal codebase, but not yet deployed in a viewer    height in pos is capped to 1000m (code patch included)
This article wasn't helpful for you? Maybe the related article at the LSL Wiki is able to bring enlightenment.
In other languages