Find a path length by Lua
Posted: 03 Jun 2009, 09:13
I've been thinking of ways to make a certain Lua ai smarter - like not send ground units to conquer sectors that are either inaccessible to them, or obstructed by difficult terrain.
The obvious way to do that would be to make it check the path length to a candidate sector for the ground units, but the only way to do this that i found, seems to fetch the Path UserData Object, get a whole list of waypoints, and then manually calculate distances.
Is there perhaps anything easier?
The obvious way to do that would be to make it check the path length to a candidate sector for the ground units, but the only way to do this that i found, seems to fetch the Path UserData Object, get a whole list of waypoints, and then manually calculate distances.
Is there perhaps anything easier?