Difference between revisions of "LlEvade"

From Second Life Wiki
Jump to navigation Jump to search
m
 
(13 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Pathfinding alpha}}
{{LSL_Function
{{LSL_Function|
|inject-2={{LSL Function/uuid|target|object=*}}
func=llEvade|
|func=llEvade
func_desc=Characters will (roughly) try to hide from their pursuers if there is a good hiding spot along their fleeing path. Hiding means no direct line of sight from the head of the character (center of the top of its physics bounding box) to the head of its pursuer and no direct path between the two on the navmesh.|
|func_desc=Characters will (roughly) try to hide from their pursuers if there is a good hiding spot along their fleeing path. Hiding means no direct line of sight from the head of the character (center of the top of its physics bounding box) to the head of its pursuer and no direct path between the two on the navmesh.|
p1_type=key|
|p1_type=key
p1_name=target|
|p1_name=target
p1_desc=Agent or object to evade|
|p1_desc= to evade
p2_type=list|
|p2_type=list
p2_name=options|
|p2_subtype=instructions
p2_desc=No options currently available|
|p2_name=options
caveats=*Must use llCreateCharacter or script won't compile
|p2_desc=No options currently available
*Vertical positions specified for any vectors should be chosen to be as close as possible to the actual height of the terrain requested. Large difference between the provided vertical position and the actual terrain/object will result in failure of the behavior.|
|caveats=*Must use [[llCreateCharacter]] or script will not compile.
examples=
<!--*Vertical positions specified for any vectors should be chosen to be as close as possible to the actual height of the terrain requested. Large difference between the provided vertical position and the actual terrain/object will result in failure of the behavior.-->
<lsl>
*If the {{LSLP|target}} is an object, it must be unlinked or be the root prim of a linkset.
|examples=
<source lang="lsl2">
vector start_position;
 
default
default
{
{
    on_rez(integer start_param)
    {
        llResetScript();
    }
     state_entry()
     state_entry()
     {
     {
         llCreateCharacter([CHARACTER_DESIRED_SPEED, 35.0]);
        llDeleteCharacter();
         llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
 
        start_position = llGetPos();
        llWanderWithin(start_position, <10.0, 10.0, 2.0>, [] );
    }
    touch_start(integer num_detected)
    {
        llEvade(llDetectedKey(0), []);
        llSetTimerEvent(20.0);
     }
     }


     touch_start(integer total_number)
     timer()
     {
     {
         llEvade(llDetectedKey0), []);
    //  do not keep running away...
         llSetTimerEvent(0.0);
 
        llWanderWithin(start_position, <10.0, 10.0, 2.0>, [] );
     }
     }
}
}
</lsl> |
</source>
also_functions=
|also_functions=
* [[llCreateCharacter]]
* [[llCreateCharacter]]
* [[llDeleteCharacter]]
* [[llDeleteCharacter]]
Line 37: Line 59:
* [[llPursue]]
* [[llPursue]]
* [[llUpdateCharacter]]
* [[llUpdateCharacter]]
* [[llWanderWithin]]|
* [[llWanderWithin]]
also_events=
|also_events=
* [[path_update]]
* [[path_update]]
|history = Date of Release  [[ Release_Notes/Second_Life_Server/12#12.07.31.262785 | 31/07/2012 ]]
|cat1=Pathfinding
}}
}}

Latest revision as of 00:21, 22 January 2015

Summary

Function: llEvade( key target, list options );

Characters will (roughly) try to hide from their pursuers if there is a good hiding spot along their fleeing path. Hiding means no direct line of sight from the head of the character (center of the top of its physics bounding box) to the head of its pursuer and no direct path between the two on the navmesh.

• key target group, avatar or object UUID to evade
• list options No options currently available

Caveats

  • Must use llCreateCharacter or script will not compile.
  • If the target is an object, it must be unlinked or be the root prim of a linkset.

Examples

vector start_position;

default
{
    on_rez(integer start_param)
    {
        llResetScript();
    }

    state_entry()
    {
        llDeleteCharacter();
        llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);

        start_position = llGetPos();
        llWanderWithin(start_position, <10.0, 10.0, 2.0>, [] );
    }
 
    touch_start(integer num_detected)
    {
        llEvade(llDetectedKey(0), []);
        llSetTimerEvent(20.0);
    }

    timer()
    {
    //  do not keep running away...
        llSetTimerEvent(0.0);

        llWanderWithin(start_position, <10.0, 10.0, 2.0>, [] );
    }
}

Deep Notes

History

Date of Release 31/07/2012

Signature

function void llEvade( key target, list options );