Difference between revisions of "LlMapDestination/ja"

From Second Life Wiki
Jump to navigation Jump to search
Line 12: Line 12:
* '''simname''' が{{HoverText|省略された|空の文字列: {{String}}}}か不正な場合、地図はオブジェクトを中心として開きますが、 '''pos''' はハイライト表示されません。この関数はクライアントに処理を行うように依頼するため、これが失敗したかを知るすべがないためです。
* '''simname''' が{{HoverText|省略された|空の文字列: {{String}}}}か不正な場合、地図はオブジェクトを中心として開きますが、 '''pos''' はハイライト表示されません。この関数はクライアントに処理を行うように依頼するため、これが失敗したかを知るすべがないためです。
|constants
|constants
|examples=<lsl>//Click the object this script is in and your map opens up in the middle of Oasis.
|examples=<lsl>//スクリプトが入っているオブジェクトをクリックすると、世界地図が開き、 Oasis の真ん中を表示します。
default
default
{
{
Line 21: Line 21:
}</lsl>
}</lsl>
<lsl>
<lsl>
// Get a teleport map, via touch_start, from the name of the first landmark in inventory.
// touch_start で、インベントリの中の最初のランドマークの名前で、テレポートマップを取得します。
// NOTERequires a landmark that contains name, region and position data.
// 注意名前、地域、位置データが入っているランドマークが必要です。
//        The correct format is "name, region (x, y, z)".  If a landmark's
//        正確な書式は "名前, 地域 (x, y, z)" です。ランドマークの名前が
//        name is too long the position data is truncated from the end,
//        長すぎると、位置データが最後から削られ、誤った位置が設定されてしまいます。
//        which will cause the position to be wrong.
default
default
{
{
     touch_start(integer num)
     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(
           list lstTemp = llParseString2List(llGetInventoryName(
               INVENTORY_LANDMARK,0),[","],[]);
               INVENTORY_LANDMARK,0),[","],[]);


           // Get list length and subtract 3 to get the correct element containing
           // リストの長さを取得して 3 を引き、地域名が含まれている要素を割り出します。
           // 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;
           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,
           string strSimname = llStringTrim(llGetSubString(llList2String(lstTemp,
               intElement),0,llSubStringIndex(llList2String(lstTemp,intElement),"(")-1),
               intElement),0,llSubStringIndex(llList2String(lstTemp,intElement),"(")-1),
               STRING_TRIM);     
               STRING_TRIM);     


           // The vector is pulled from the landmark name, based on the
           // ランドマークの中からベクトルを抽出します。文字列の中で "(" がある位置の次の文字から
          // position of "(" in the string starting with the next
           // 最後から 2 番目の文字までを切り出します。
           // character and ending with the second to the last character.
           vector vecVector = (vector)("<"+llGetSubString(llGetInventoryName(
           vector vecVector = (vector)("<"+llGetSubString(llGetInventoryName(
               INVENTORY_LANDMARK,0),llSubStringIndex(llGetInventoryName(
               INVENTORY_LANDMARK,0),llSubStringIndex(llGetInventoryName(
               INVENTORY_LANDMARK,0),"(")+1,-2)+">");
               INVENTORY_LANDMARK,0),"(")+1,-2)+">");
            
            
           // Bring up the teleport map using the data we extracted.
           // 抽出したデータを使用してテレポートマップを表示します。
           llMapDestination(strSimname,vecVector,ZERO_VECTOR);
           llMapDestination(strSimname,vecVector,ZERO_VECTOR);
     }
     }

Revision as of 06:34, 16 May 2010

要約

関数: 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>//スクリプトが入っているオブジェクトをクリックすると、世界地図が開き、 Oasis の真ん中を表示します。 default {

    touch_start(integer num)
    {
         llMapDestination("Oasis", <128, 128, 0>, ZERO_VECTOR);
    }

}</lsl> <lsl> // touch_start で、インベントリの中の最初のランドマークの名前で、テレポートマップを取得します。 // 注意: 名前、地域、位置データが入っているランドマークが必要です。 // 正確な書式は "名前, 地域 (x, y, z)" です。ランドマークの名前が // 長すぎると、位置データが最後から削られ、誤った位置が設定されてしまいます。 default {

    touch_start(integer num)
    {
         // インベントリで最初に見つかったランドマークの名前を解析して、
         // カンマ区切りのリストにします。
         list lstTemp = llParseString2List(llGetInventoryName(
              INVENTORY_LANDMARK,0),[","],[]);
         // リストの長さを取得して 3 を引き、地域名が含まれている要素を割り出します。
         // リストの最後から検索することで、ランドマークの名前の中のカンマが悪さをして
         // リストを破壊したりしないようにします。
         integer intElement = llGetListLength(lstTemp)-3;
         // リストの要素から地域名を取得し、文字列の中の不要な文字を取り除いて
         // 先頭と末尾のスペースを取り除きます。
         string strSimname = llStringTrim(llGetSubString(llList2String(lstTemp,
              intElement),0,llSubStringIndex(llList2String(lstTemp,intElement),"(")-1),
              STRING_TRIM);    
         // ランドマークの中からベクトルを抽出します。文字列の中で "(" がある位置の次の文字から
         // 最後から 2 番目の文字までを切り出します。
         vector vecVector = (vector)("<"+llGetSubString(llGetInventoryName(
              INVENTORY_LANDMARK,0),llSubStringIndex(llGetInventoryName(
              INVENTORY_LANDMARK,0),"(")+1,-2)+">");
         
         // 抽出したデータを使用してテレポートマップを表示します。
         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の関連した項目が参考になるかもしれません。