vee41, so now I'm using two different pathfinding objects. One pathfinds to the target, the other starts from the highlighted square closest to the target and pathfinds back to the active object, adding each space's UID to a string as it passes along its way.
The issue now is that the UID being passed to the string is passed multiple times for each square (since the pathfinding object overlaps each square more than once each second).
Any idea how to do this? The relevant code can be found here:
<img src="http://i.imgur.com/BEbo5WN.png" border="0">
I tried to account for it by doing left(str, 3) not equal space.UID, but that doesn't actually seem to work.
By the way, if you fire up the .capx and add the local static variable 'dirs' to inspect/watch, it's pretty cool to see it update in realtime during the computer's turn. You'll also see what I mean by the same UID being stored in the string repeatedly ;)
UPDATE: Nevermind, I think I got it!