Difference between revisions of "LlFleeFrom/ja"

From Second Life Wiki
Jump to navigation Jump to search
(copy from english(Todo: need translate to japanese))
 
m
Line 1: Line 1:
{{LSL_Function
{{LSL_Function/ja
|inject-2={{LSL Function/position|position|region=*}}
|inject-2={{LSL Function/position|position|region=*}}
|func=llFleeFrom
|func=llFleeFrom
Line 52: Line 52:
|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= 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>
|also_functions=
|also_functions=
* [[llCreateCharacter]]
* [[llCreateCharacter/ja]]
* [[llDeleteCharacter]]
* [[llDeleteCharacter/ja]]
* [[llEvade]]
* [[llEvade/ja]]
* [[llExecCharacterCmd]]
* [[llExecCharacterCmd/ja]]
* [[llGetClosestNavPoint]]
* [[llGetClosestNavPoint/ja]]
* [[llFleeFrom]]
* [[llFleeFrom/ja]]
* [[llNavigateTo]]
* [[llNavigateTo/ja]]
* [[llPatrolPoints]]
* [[llPatrolPoints/ja]]
* [[llPursue]]
* [[llPursue/ja]]
* [[llUpdateCharacter]]
* [[llUpdateCharacter/ja]]
* [[llWanderWithin]]
* [[llWanderWithin/ja]]
|also_events=
|also_events=
* [[path_update]]
* [[path_update/ja]]
|history = Date of Release  [[ Release_Notes/Second_Life_Server/12#12.07.31.262785 | 31/07/2012 ]]
|history = Date of Release  [[ Release_Notes/Second_Life_Server/12#12.07.31.262785 | 31/07/2012 ]]
|cat1=Pathfinding
|cat1=Pathfinding
|haiku={{Haiku|Alarming nighttime|A bitter, enemy flees|before the vector}}
|haiku={{Haiku|Alarming nighttime|A bitter, enemy flees|before the vector}}
}}
}}

Revision as of 12:44, 2 November 2023

要約

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

Directs a character to keep a specific distance from a specific position in the region or adjacent regions.

• vector position position in region coordinates from which to flee.
• float distance Distance in meters to flee from position.
• list options No options available at this time.

警告

  • Must use llCreateCharacter or script won't compile.
  • The position to flee from must be near the nav mesh; otherwise, this behavior will fail and trigger path update with PU_FAILURE_INVALID_GOAL.
  • 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.

サンプル

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, []);
	}
    }
}

注意点

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
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の関連した項目が参考になるかもしれません。