Difference between revisions of "LlFleeFrom/ja"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 2: Line 2:
|inject-2={{LSL Function/position|position|region=*}}
|inject-2={{LSL Function/position|position|region=*}}
|func=llFleeFrom
|func=llFleeFrom
|func_desc=Directs a character to keep a specific {{LSLP|distance}} from a specific {{LSLP|position}} in the region or adjacent regions.
|func_desc=キャラクターに特定の{{LSLP|position}}から一定の{{LSLP|distance}}を保つように指示します。
|p1_type=vector
|p1_type=vector
|p1_name=position
|p1_name=position
|p1_desc= from which to flee.
|p1_desc= 逃げるための位置。
|p1_hover= from which to flee.
|p1_hover= 逃げるための位置。
|p2_type=float
|p2_type=float
|p2_name=distance
|p2_name=distance
|p2_desc=Distance in meters to flee from {{LSLP|position}}.
|p2_desc={{LSLP|position}}からの逃げる距離(メートル)。
|p2_hover=Distance in meters to flee from 'position'.
|p2_hover='position'からの逃げる距離(メートル)。
|p3_type=list
|p3_type=list
|p3_subtype=instructions
|p3_subtype=instructions
|p3_name=options
|p3_name=options
|p3_desc=No options available at this time.
|p3_desc=現時点では利用可能なオプションはありません。
|caveats=
|caveats=
* Must use llCreateCharacter or script won't compile.
* [[llCreateCharacter]]を使用しないと、スクリプトはコンパイルされません。
* The {{LSLP|position}} to flee from must be near the nav mesh; otherwise, this behavior will fail and trigger [[path update]] with {{LSL Const|PU_FAILURE_INVALID_GOAL|ihex=3|hex=0x03|nolink=*}}.
* 逃げる{{LSLP|position}}はナビメッシュの近くにある必要があります。それ以外の場合、この動作は失敗し、{{LSL Const|PU_FAILURE_INVALID_GOAL|ihex=3|hex=0x03|nolink=*}}をトリガーします。
* If you want to avoid an agent or object as per the example below, it's much more elegant and less sim resource intensive to use [[llEvade]] instead.
* 下記の例のようにエージェントやオブジェクトを避けたい場合、[[llEvade/ja]]を使用する方がエレガントでシムのリソースを節約できます。
|examples=
|examples=
<syntaxhighlight lang="lsl2">
<syntaxhighlight lang="lsl2">
Line 50: Line 50:
}
}
</syntaxhighlight>  
</syntaxhighlight>  
|notes= The position vector can be set outside the current region by using extended range region coordinates: e.g., to avoid the SE corner of the region to the East of the current one, you could <syntaxhighlight lang="lsl2">llFleeFrom(<0.0, 512.0, 0.0>, 20.0, []);</syntaxhighlight>
|notes= 位置ベクトルは、拡張範囲のリージョン座標を使用して現在のリージョンの外部に設定できます。たとえば、現在のリージョンの東にあるリージョンのSEコーナーを避けるには、次のようにします:<syntaxhighlight lang="lsl2">llFleeFrom(<0.0, 512.0, 0.0>, 20.0, []);</syntaxhighlight>
|also_functions=
|also_functions=
* [[llCreateCharacter/ja]]
* [[llCreateCharacter/ja]]

Revision as of 11:58, 22 November 2023

要約

関数: llFleeFrom( vector position, float distance, list options );

キャラクターに特定のpositionから一定のdistanceを保つように指示します。

• vector position position in region coordinates 逃げるための位置。
• float distance positionからの逃げる距離(メートル)。
• list options 現時点では利用可能なオプションはありません。

警告

  • llCreateCharacterを使用しないと、スクリプトはコンパイルされません。
  • 逃げるpositionはナビメッシュの近くにある必要があります。それ以外の場合、この動作は失敗し、PU_FAILURE_INVALID_GOALをトリガーします。
  • 下記の例のようにエージェントやオブジェクトを避けたい場合、llEvade/jaを使用する方がエレガントでシムのリソースを節約できます。
All Issues ~ Search JIRA for related Bugs

サンプル

vector last_touched_pos;
key last_touched_key;

default
{
    state_entry()
    {
        llCreateCharacter([CHARACTER_DESIRED_SPEED, 50.0]);
    }

    touch_start(integer total_number)
    {
	last_touched_key = llDetectedKey(0);
	last_touched_pos = llDetectedPos(0);
	llFleeFrom(last_touched_pos, 10, []);
	llSetTimerEvent(0.2);
    }
	
    timer()
    {
	vector last_touched_pos_now = llList2Vector(llGetObjectDetails(last_touched_key, [OBJECT_POS]), 0);
	if ( llVecDist(last_touched_pos, last_touched_pos_now) > 1 )
	{
	    last_touched_pos = last_touched_pos_now;
	    llFleeFrom(last_touched_pos, 10, []);
	}
    }
}

注意点

位置ベクトルは、拡張範囲のリージョン座標を使用して現在のリージョンの外部に設定できます。たとえば、現在のリージョンの東にあるリージョンのSEコーナーを避けるには、次のようにします:
llFleeFrom(<0.0, 512.0, 0.0>, 20.0, []);

特記事項

経緯

Date of Release 31/07/2012

Search JIRA for related Issues

Signature

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