Difference between revisions of "LlPatrolPoints"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "{{Pathfinding alpha}} {{LSL_Function| func=llPatrolPoints| func_desc=Sets the object patrolling between the points specified in patrolPoints.| func_footnote=The list patrolPoints…")
 
(category)
 
(13 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Pathfinding alpha}}
{{LSL_Function
{{LSL_Function|
|func=llPatrolPoints
func=llPatrolPoints|
|func_desc=Sets the object patrolling between the points specified in patrolPoints.
func_desc=Sets the object patrolling between the points specified in patrolPoints.|
|p1_type=list|p1_name=patrolPoints|p1_desc=A list of vectors for the character to travel through sequentially.  The list must contain at least two entries.
func_footnote=The list patrolPoints is a list of vectors defining the patrol path.|
|p2_type=list|p2_subtype=instructions|p2_name=options|p2_desc=PATROL_* flags and their parameters
p1_type=list|
|caveats=
p1_name=patrolPoints|
* Must use [[llCreateCharacter]] or script won't compile
p1_desc=A list of vectors for the character to travel through sequentially.  The list must contain at least two entries.|
p2_type=list|
p2_name=options|
p2_desc=No options available at this time.|
caveats=
* Must use llCreateCharacter or script won't compile
* 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.
* 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.
* The patrolPoints list requires a minimum of two entries.
* The {{LSLP|patrolPoints}} list requires a minimum of two valid vectors.
* If a vector in the list is outside the nav volume (e.g.: too high,) it will be ignored.|
** If a vector in the list is outside the nav volume (e.g.: too high,) it will be ignored.
examples=
|constants={{LSL_Constants/llPatrolPoints}}
<lsl>
|examples=
<source lang="lsl2">
default
default
{
{
     state_entry()
     state_entry()
     {
     {
         llCreateCharacter([CHARACTER_DESIRED_SPEED, 50.0]);
         llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
        //MAX_SPEED is @ 20 by default
     }
     }


Line 27: Line 23:
     {
     {
         list points = [llGetPos() + <5,0,0>, llGetPos() - <5,0,0>];
         list points = [llGetPos() + <5,0,0>, llGetPos() - <5,0,0>];
         llPatrolPoints(points, []);
         llPatrolPoints(points, [PATROL_PAUSE_AT_WAYPOINTS, TRUE]);
     }
     }
}
}
</lsl> |
</source>  
also_functions=
|also_functions=
* [[llCreateCharacter]]
* [[llCreateCharacter]]
* [[llDeleteCharacter]]
* [[llEvade]]
* [[llExecCharacterCmd]]
* [[llGetClosestNavPoint]]
* [[llFleeFrom]]
* [[llNavigateTo]]
* [[llPatrolPoints]]
* [[llPursue]]
* [[llUpdateCharacter]]
* [[llWanderWithin]]
|also_events=
* [[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 15:18, 28 October 2023

Summary

Function: llPatrolPoints( list patrolPoints, list options );

Sets the object patrolling between the points specified in patrolPoints.

• list patrolPoints A list of vectors for the character to travel through sequentially. The list must contain at least two entries.
• list options PATROL_* flags and their parameters

Option V Parameters Default Description
PATROL_PAUSE_AT_WAYPOINTS ] 0 integer boolean ] FALSE ] Whether the character should pause briefly after reaching each patrol point.

Caveats

  • Must use llCreateCharacter or script won't compile
  • 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.
  • The patrolPoints list requires a minimum of two valid vectors.
    • If a vector in the list is outside the nav volume (e.g.: too high,) it will be ignored.

Examples

default
{
    state_entry()
    {
        llCreateCharacter([CHARACTER_MAX_SPEED, 25, CHARACTER_DESIRED_SPEED, 15.0]);
        //MAX_SPEED is @ 20 by default
    }

    touch_start(integer total_number)
    {
        list points = [llGetPos() + <5,0,0>, llGetPos() - <5,0,0>];
        llPatrolPoints(points, [PATROL_PAUSE_AT_WAYPOINTS, TRUE]);
    }
}

Deep Notes

History

Date of Release 31/07/2012

Signature

function void llPatrolPoints( list patrolPoints, list options );