Difference between revisions of "LlPatrolPoints"

From Second Life Wiki
Jump to navigation Jump to search
m (Fix minor error 50.0 to 40.0 in llCC in script)
Line 21: Line 21:
     state_entry()
     state_entry()
     {
     {
         llCreateCharacter([CHARACTER_DESIRED_SPEED, 50.0]);
         llCreateCharacter([CHARACTER_DESIRED_SPEED, 40.0]);
     }
     }



Revision as of 10:19, 25 March 2012

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 Currently, the only option is PATROL_PAUSE_AT_WAYPOINTS which defaults to FALSE but allows you to request that characters slow down and momentarily pause at each waypoint. Otherwise, characters will continue to move to the next waypoint at full speed.

The list patrolPoints is a list of vectors defining the patrol path.

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 entries.
  • If a vector in the list is outside the nav volume (e.g.: too high,) it will be ignored.

Examples

<lsl> default {

   state_entry()
   {
       llCreateCharacter([CHARACTER_DESIRED_SPEED, 40.0]);
   }
   touch_start(integer total_number)
   {
       list points = [llGetPos() + <5,0,0>, llGetPos() - <5,0,0>];
       llPatrolPoints(points, []);
   }

}

</lsl>

Deep Notes

Signature

function void llPatrolPoints( list patrolPoints, list options );