Welcome to PenUltima Online. Click to login or register.

Functions:

FindPath( x1, y1, z1, x2, y2, z2, realm := _DEFAULT_REALM, flags := FP_IGNORE_MOBILES, searchskirt := 5 )
Parameters:
Name Type
x1,y1,z1 Integer world coordinates - start of the path
x2,y2,z2 Integer world coordinates - destination
realm String - case-sensitive name of the realm
flags Integer
searchskirt Integer
Explanation
Finds a path from start to destination and will return an array of coordinates, representing each step along the path from the next step to take from the start of the path to the actual destination. The coordinates are found in .x, .y, and .z.
Notes: The skirt around the square that is formed around the start of the path to the destination which represents the searchable area is set by searchskirt. Check out MaxPathFindRange in servspecopt.cfg too.
Notes: uo.em constant for this function:
// FindPath flags
const FP_IGNORE_MOBILES         := 0x01;    // ignore Mobiles
const FP_IGNORE_DOORS           := 0x02;    // ignore Doors (you've to open doors by yourself)
Return values
Error or Array of coordinates, representing each step along the path.
Errors
"Invalid parameter"
"Realm not found"
"Start Coordinates Invalid for Realm"
"End Coordinates Invalid for Realm"
"Beyond Max Range."
"Failed to find a path."
"Out of memory."
"Solution Corrupted!"
"Pathfind Error."
Related
NPC
Array