LlMapDestination/ja

From Second Life Wiki
Jump to navigation Jump to search

要約

関数: llMapDestination( string simname, vector pos, vector look_at );

simname を中心として、 pos がハイライト表示された世界地図を開きます。
アバターに 装着 されたスクリプト、もしくは タッチ系 イベントの中でのみ動作します。

• string simname 地域名
• vector pos リージョン 座標
• vector look_at 未使用

(注意: look_at は現在何もしません)

警告

  • この関数は 1.0 秒間、スクリプトを停止します。
  • simname省略されたか不正な場合、地図はオブジェクトを中心として開きますが、 pos はハイライト表示されません。この関数はクライアントに処理を行うように依頼するため、これが失敗したかを知るすべがないためです。

Important Issues

~ All Issues ~ Search JIRA for related Bugs
   llMapDestination in attachments opens a map on owner's screen even when touched by someone else
   llMapDestination pos parameter is sometimes replaced with incorrect data (workaround included)
   height in pos is capped to 1000m (code patch included)

サンプル

<lsl>//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);
    }

}</lsl> <lsl> // 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);
    }
}</lsl>

注意点

  • possimname にない リージョン 座標でも動作します。(llRequestInventoryData で返されるような値)
  • タッチ系 以外のイベントから呼び出された場合、 オーナー に対してのみ動作します。
  • タッチで呼び出された場合、イベントキューの最初もしくは最後のタッチでのみ動きます。(例: num_touched > 1)
  • アタッチメント の中から呼び出された場合、オーナーに対してのみ動作します。

関連項目

関数

•  llRequestInventoryData

特記事項

All Issues

~ Search JIRA for related Issues
   Throttle llMapDestination to prevent "map bombing".
   llMapDestination in attachments opens a map on owner's screen even when touched by someone else
   llMapDestination pos parameter is sometimes replaced with incorrect data (workaround included)
   height in pos is capped to 1000m (code patch included)

Signature

function void llMapDestination( string simname, vector pos, vector look_at );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。