(it should create a 'pathfinder' folder and the files should sit nicely in there)
You can also find a new example showing you how to move an object with the pathfinder behavior.
This example is available here
Here also come an example allowing you to display "in real time" the possible path the unit might take. Get it here now.
Have fun finding paths. <img src="smileys/smiley2.gif" border="0" align="middle">
Important note about the usage of the PathFinder
Now the PF boards is accurate with the setting of the obstacles, no matter what their size is, as long as you respect the square grid aspect in your level design.
<img src="http://dl.dropbox.com/u/36472942/construct/plugin/release/pathfinder/r75-inprogress.PNG" border="0">
Quick image to show, the blue "mask" represents what the PF knows as "unwalkable" squares. The red sprite is the player.
You can see the first wall on the top left has a "double" mask compared to the other obstacles.
It's because of its position.
The CSS (Cell's Side Size) there is 32. And the wall's position happen also to be 32, meaning it sits on the edge of 2 squares.
And so it will appear as your sprite is avoiding the wall when it seems it should walk right next to it.
So if you respect the positioning of the obstacles in your level designs, it will work as intended (the rest of the blue masks).
11-09-2011: Reuploaded PFDemo.capx and the C2runtime.js from the demo to fix a bug in the drag/drop method (When dragging Source on Destination, Destination also get picked as to be dragged/dropped. And vice versa.)
13-09-2011: Reuploaded PFDemo.capx and the C2runtime.js from the demo to fix a bug when clicking the GUI panel button, if the panel was showing/hiding and/or the commands fading in/out.
Update to the PathFinder behavior runtime itself (setCellSizeSide). It appeared that the PathFinder was looking for a path out of the layout boundaries.
09-01-2012: Update to the PathFinder Behavior: corrected bugs concerning the cleaning of the ObstList and the bounding boxes of obstacles. If you had prior troubles with having several obstacles, this should now be fixed, and you should be able to place/use obstacles far more easier.
Fixes thanks to —
Moving the object with pathfinder behavior thanks to Yann & myself.
16-01-2012: Update to the PF behavior. Fixing of all previous bugs, fixing of the obstacle recognition (wasn't good enough yet). Fixing of the moving example and addition of the moving with preview example.