Skip to content

LPathFollower

Nak edited this page May 13, 2022 · 1 revision

LPathFollower is a custom object to hold PathFind results. The idea is that these can be used on multiple NPC's, unlike PathFollower.

Both NNN and NodeGraph returns this object.

Move Enums ( NN recreates these 4 on the client )

CAP_MOVE_GROUND	= 0x01 -- walk/run
CAP_MOVE_JUMP	= 0x02 -- jump/leap
CAP_MOVE_FLY	= 0x04 -- can fly, move all around
CAP_MOVE_CLIMB	= 0x08 -- climb ladders

Note: You can combine these with bit.bor( CAP_MOVE_GROUND, CAP_MOVEJUMP, CAP_MOVE_CLIMB )

Functions Returns Description
alt textLPathFollower.CreatePathFollower(Vector start_pos ) LPathFollower Creates an empty path-follower with a starting position.
Functions Returns Description
alt textLPathFollower:GetStart() Vector Returns the starting position of the path
alt textLPathFollower:GetEnd() Vector Returns the ending position of the path (Note, will update if the target is an entity)
alt textLPathFollower:GetAge() Number Returns the age of the path.
alt textLPathFollower:ResetAge() Resets the age of the path.
alt textLPathFollower:GetLength() Number Returns the length of the path
alt textLPathFollower:AddSegment( Vector from, Vector to, Number curvature, CAP_MOVE ) Adds a segment
alt textLPathFollower:FirstSegment() Table Returns the first segment.
alt textLPathFollower:LastSegment() Table Returns the last segment
alt textLPathFollower:FindClosestSeg( Vector position ) Table Returns the closest sequence.
alt textLPathFollower:GetAllSegments() Table Returns all segments.
alt textLPathFollower:GetClosestPosition( Vector position ) Vector Returns the closest position along the path to said position.
alt textLPathFollower:GetPositionOnPath( Number distance ) Vector Returns the position on the path by given distance
alt textLPathFollower:FindDistanceFromPath( Vector position) Number Returns the distance from the path.
alt textLPathFollower:Invalidate() Invalidates the path
alt textLPathFollower:IsValid() Boolean Returns true if the path is valid
Cursor Functions Returns Description
alt textLPathFollower:GetCursorPosition() Number Returns the cursor progress along the path.
alt textLPathFollower:MoveCursorToStart() Moves the cursor to the start of the path.
alt textLPathFollower:MoveCursorToEnd( ) Moves the cursor to the end of the path.
alt textLPathFollower:MoveCursor( Number distance ) Moves to cursor to the said distance ahead.
alt textLPathFollower:MoveCursorTo( Number distance ) Moves the cursor to said distance.

Nik Naks Wiki


Features:

Clone this wiki locally