2010-08-22 13:13:17 +00:00
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
< !DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
2009-05-09 13:11:51 +00:00
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs >
<func >
<title > GetPathLength</title>
2010-08-22 13:13:17 +00:00
<category > Landscape</category>
2011-06-30 10:52:55 +00:00
<version > 5.1 OC</version>
2009-05-09 13:11:51 +00:00
<syntax >
<rtype > int</rtype>
<params >
<param >
<type > int</type>
2010-03-15 22:55:14 +00:00
<name > startx</name>
2011-07-30 23:32:02 +00:00
<desc > X coordinate of starting position. Always global coordinate.</desc>
2009-05-09 13:11:51 +00:00
</param>
<param >
<type > int</type>
2010-03-15 22:55:14 +00:00
<name > starty</name>
2011-07-30 23:32:02 +00:00
<desc > Y coordinate of starting position. Always global coordinate.</desc>
2009-05-09 13:11:51 +00:00
</param>
<param >
<type > int</type>
2010-03-15 22:55:14 +00:00
<name > endx</name>
2011-07-30 23:32:02 +00:00
<desc > X coordinate of end position. Always global coordinate.</desc>
2009-05-09 13:11:51 +00:00
</param>
<param >
<type > int</type>
2010-03-15 22:55:14 +00:00
<name > endy</name>
2011-07-30 23:32:02 +00:00
<desc > Y coordinate of end position. Always global coordinate.</desc>
2009-05-09 13:11:51 +00:00
</param>
2016-09-25 19:48:19 +00:00
<param >
<type > int</type>
<name > depth</name>
<desc > Determines search depth of the pathfinder algorithm (range from 1 - 10 with default 1). Warning: higher values may slow down the game. See also the PathFinder entry in the <emlink href= "definition/properties.html" > DefCore</emlink> .</desc>
</param>
2009-05-09 13:11:51 +00:00
</params>
</syntax>
2011-07-30 23:32:02 +00:00
<desc > 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 <code > nil</code> if no path was found.</desc>
2009-05-09 13:11:51 +00:00
<examples >
<example >
2011-07-07 10:34:10 +00:00
<code > var dist = GetPathLength(<funclink > GetX</funclink> (), <funclink > GetY</funclink> (), <funclink > GetX</funclink> (<funclink > FindBase</funclink> (<funclink > GetOwner</funclink> ())), <funclink > GetY</funclink> (<funclink > FindBase</funclink> (<funclink > GetOwner</funclink> ())));</code>
2010-08-22 13:13:17 +00:00
<text > Determines the distance from an object to its closest friendly base.</text>
2009-05-09 13:11:51 +00:00
</example>
</examples>
</func>
2010-08-22 13:13:17 +00:00
<author > PeterW</author> <date > 2002-04</date>
2009-05-09 13:11:51 +00:00
</funcs>