llPursue
function
Function syntax
llPursue(key target,// UUID of the group, avatar, or object to pursue.list options// A list of options to configure pursuit behavior.
);- Energy
- 10
Directs a pathfinding character to pursue and chase target, configured by the parameters specified in options.
Causes the object to pursue target.
llPursue(NULL_KEY, []);Specification
Section titled “Specification”PURSUIT_FUZZ_FACTOR // Option for llPursue that selects a random destination near the PURSUIT_OFFSET (range is 0 to 1, where 1 is most random).PURSUIT_GOAL_TOLERANCE // Option for llPursue defining how close (between 0.25m and 10m) the character must be to consider the goal reached.PURSUIT_INTERCEPT // Option for llPursue specifying whether the pathfinding character attempts to predict and intercept the target's future location.PURSUIT_OFFSET // Option for llPursue specifying a constant position offset relative to the target for the character to navigate toward.REQUIRE_LINE_OF_SIGHT // Option flag for llPursue defining whether the character requires a physical line-of-sight to chase the target.
| Option | Value | Description | Usage | Default Value |
|---|---|---|---|---|
PURSUIT_OFFSET | 1 | Go to a position offset from the target. | | ZERO_VECTOR |
REQUIRE_LINE_OF_SIGHT | 2 | Define whether the character needs a physical line-of-sight to give chase. When enabled, the character will not pick a new target position while there is a something solid between the character and the target object/agent. | | FALSE |
PURSUIT_FUZZ_FACTOR | 3 | Selects a random destination near the PURSUIT_OFFSET. The valid fuzz factor range is from 0 to 1, where 1 is most random. This option requires a nonzero PURSUIT_OFFSET. | | 0.0 |
PURSUIT_INTERCEPT | 4 | Define whether the character attempts to predict the target’s future location. | | FALSE |
PURSUIT_GOAL_TOLERANCE | 5 | Defines approximately how close the character must be to the current goal to consider itself to be at the desired position. The valid range is from 0.25 to 10m. | | Default is proportional to character size |
Caveats
Section titled “Caveats”- Must use
llCreateCharacteror script crash (script error) - 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 behaviour.
- Z value is unused (erroneous if not 0.0) in parameter for
PURSUIT_OFFSET. REQUIRE_LINE_OF_SIGHTdoes not require line of sight immediately afterllPursue()is called - it only affects target position updates after the target object/agent moves.- FUZZ_FACTOR picks a point within an area of approximately (scale * lengthOfOffset) around the offset position. Value must be between 0.0 and 1.0.
Examples
Section titled “Examples”Example 1
default{ state_entry() { llCreateCharacter([CHARACTER_DESIRED_SPEED, 35.0, CHARACTER_MAX_SPEED, 35.0]); }
touch_start(integer total_number) { llPursue(llDetectedKey(0), [PURSUIT_OFFSET, <-2.0, 0.0, 0.0>, PURSUIT_FUZZ_FACTOR, 0.2]); }}History
Section titled “History”Date of Release 31/07/2012
See also
Section titled “See also”Functions
Section titled “Functions”llCreateCharacterllDeleteCharacterllEvadellExecCharacterCmdllGetClosestNavPointllFleeFromllNavigateTollPatrolPointsllPursuellUpdateCharacterllWanderWithin
Events
Section titled “Events”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.