Difference between revisions of "LlDetectedType/ja"

From Second Life Wiki
Jump to navigation Jump to search
(New page: {{LSL_Function/detected/ja|number|type}} {{LSL_Function/ja |func_id=34|func_sleep=0.0|func_energy=10.0 |sort=DetectedType|func=llDetectedType |return_type=integer |p1_type=integer|p1_name=...)
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{LSL_Function/detected/ja|number|type}}
{{LSL_Function/detected/ja|number|type|error={{HoverText|ゼロ|0}}}}{{LSL_Function/ja
{{LSL_Function/ja
|func_id=34|func_sleep=0.0|func_energy=10.0
|func_id=34|func_sleep=0.0|func_energy=10.0
|sort=DetectedType|func=llDetectedType
|sort=DetectedType|func=llDetectedType
|return_type=integer
|return_type=integer
|p1_type=integer|p1_name=number
|p1_type=integer|p1_name=number
|func_footnote={{HoverText|ゼロ|0}}が返るとき、'''number'''は検出されたオブジェクトまたはアバターの妥当な番号ではありません。
|func_footnote='''number''' が検出されたオブジェクトまたはアバターの妥当な番号ではないとき {{HoverText|ゼロ|0}} が返ります。
|func_desc
|func_desc
|return_text=検出したオブジェクトまたはアバターの型フラグ
|return_text=検出したオブジェクトまたはアバターの型フラグ
Line 12: Line 11:
|constants={{LSL Constants Sensor/ja}}
|constants={{LSL Constants Sensor/ja}}
|examples=
|examples=
<lsl>
<source lang="lsl2">
//--// Type & name of collision source //--//
//--// 衝突源の型と名前 //--//


default{
default{
  collision_start( integer vIntCollided ){
    collision_start( integer vIntCollided ){
    integer vBitType;
        integer vBitType;
    string vStrType;
        string vStrType;
    do{
        do
      vBitType = llDetectedType( --vIntCollided );
        {
      if (1 & vBitType){
            vBitType = llDetectedType( --vIntCollided );
        vStrType = "Avatar";
            if (vBitType & AGENT)
      }else{
                vStrType = "avatar";
        vStrType = "object";
            else
      }
                vStrType = "object";
      llOwnerSay( "An " + vStrType + "named '" + llDetectedName( vIntCollided ) + "' collided with me" );
            llOwnerSay( "An " + vStrType + " named '" + llDetectedName( vIntCollided ) + "' collided with me" );
    }while (vIntCollided);
        }
  }
        while (vIntCollided);
    }
}
}
</lsl>
</source>
|helpers
|helpers
|also_functions
|also_functions

Latest revision as of 15:34, 25 February 2016

要約

関数: integer llDetectedType( integer number );

検出したオブジェクトまたはアバターの型フラグを integer で返します。

• integer number 探知情報の番号

number には 負のインデックス を使用できません。 number が検出されたオブジェクトまたはアバターの妥当な番号ではないとき ゼロ が返ります。

仕様

llDetected* 関数はどこでも使用可能ですが、探知イベント (collision, collision_start, collision_end, sensor, touch, touch_start, touch_end) の中、または探知イベントで呼ばれた関数の中で呼び出されたときのみ使用可能な値を返します。

マスクフラグ 説明 (llDetectedType()) 説明 (llSensor() と llSensorRepeat() のマスク)
AGENT 0x1 エージェント 廃止: AGENT_BY_LEGACY_NAME を使ってください。
AGENT_BY_LEGACY_NAME 0x1 エージェント Legacy Name(レガシー名)でエージェントを検索します。
AGENT_BY_USERNAME 0x10 エージェント Username(ユーザ名)でエージェントを検索します。
ACTIVE 0x2 物理タスク(物理オブジェクトとエージェント) 移動している物理オブジェクト、または動作中のスクリプトが入っているオブジェクトを検索します。つまり、現在 SecondLife サーバのリソースを消費しているものを検索します。
PASSIVE 0x4 非物理オブジェクト 移動していない物理オブジェクト、または動作中でないスクリプトが入っている非物理オブジェクト、またはスクリプトの入っていないオブジェクトを検索します。つまり、現在 SecondLife サーバのリソースを消費していないものを検索します。
SCRIPTED 0x8 動作中のスクリプトが入っているオブジェクト 動作中のスクリプトが入っているオブジェクトを検索します。つまり、現在 SIM に何かしているものを検索します。
llDetectedType() スクリプトあり スクリプトなし
物理 10 (ACTIVE|SCRIPTED) 2 (ACTIVE)
非物理 12 (PASSIVE|SCRIPTED) 4 (PASSIVE)

警告

  • number が正常なインデックス範囲を外れていても、この関数は ゼロ を返し、スクリプトはエラー表示を出さずに処理を続けます。
  • llDetected* 関数が有効になるイベントは、常に少なくとも 1 個以上の探知結果を返します。
    • 何も探知されなかった場合、探知イベントは発生しません。[1]
    • 探知イベントの探知個数を表す引数は、最初は決して 1 未満にはなりません。[2]
All Issues ~ Search JIRA for related Bugs

サンプル

//--// 衝突源の型と名前 //--//

default{
    collision_start( integer vIntCollided ){
        integer vBitType;
        string vStrType;
        do
        {
            vBitType = llDetectedType( --vIntCollided );
            if (vBitType & AGENT)
                vStrType = "avatar";
            else
                vStrType = "object";
            llOwnerSay( "An " + vStrType + " named '" + llDetectedName( vIntCollided ) + "' collided with me" );
        }
        while (vIntCollided);
    }
}

関連項目

記事

•  検出
•  Object Type

特記事項

Search JIRA for related Issues

脚注

  1. ^ 例外は no_sensor ですが、ここでは llDetected* 関数は有効にはなりません。
  2. ^ 他のあらゆるイベント引数と同じように、ユーザは初期値を上書きすることができます。

Signature

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