# GetPathLength

Landscape
5.1 OC
int
int startx X coordinate of starting position. Always global coordinate.
int starty Y coordinate of starting position. Always global coordinate.
int endx X coordinate of end position. Always global coordinate.
int endy Y coordinate of end position. Always global coordinate.
Searches for a path from start point to end point using the pathfinding algorithm as used by clonks and returns the length of the found path. Returns `nil` if no path was found.
var dist = GetPathLength(GetX(), GetY(), GetX(FindBase(GetOwner())), GetY(FindBase(GetOwner())));
Determines the distance from an object to its closest friendly base.
PeterW
2002-04