Skip to content
lsl.devlsl.devLSL Dev

llPatrolPoints

function
Function syntax
llPatrolPoints(
  1. list patrolPoints,// A list of at least two position vectors representing the patrol path.
  2. list options// A list of PATROL_* flags and parameters to configure the patrol behavior.
);
Energy
10

Directs a pathfinding character to patrol sequentially through the coordinates specified in patrolPoints, configured by options.

Sets the object patrolling between the points specified in patrolPoints.

How to use
llPatrolPoints([], []);
From the LSL definitions: CharacterPatrolPointsParam (rule, then its arguments)
PATROL_PAUSE_AT_WAYPOINTS  // Option parameter for llPatrolPoints (defaults to FALSE).
ConstantTypeValueDescription
PATROL_PAUSE_AT_WAYPOINTSinteger0Whether the character should pause briefly after reaching each patrol point.
OptionVParametersDefaultDescription
[ integer boolean ][ FALSE ]Whether the character should pause briefly after reaching each patrol point.
  • 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.
Example 1
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]);
}
}

Date of Release 31/07/2012

Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.