[Behavior]PathFinder

  • Captain: could you post your capx ?

    I'll try to have a look at it and see if anything goes wrong.

  • My error. One of my families required a For each.

    Families is a great feature, but it can get a bit confusing sometimes with the pick lists :)

  • Captain: Well glad it works (and that I don't have to code anything into this, it's been so long, I don't know if I would be able to dive back into this behavior <img src="smileys/smiley1.gif" border="0" align="middle" />).

  • I hope this thread isnt dead, because i have some questions about it.

    1. When you click "generate path" strange pointer in (0;0) appears. I fixed by changing Source.PathFinder.getPathListLength to Source.PathFinder.getPathListLength-1

    <img src="http://puu.sh/3vRbD.png" border="0" />

    2. Name of loop in Event and in Sub-event is different, so i decided to delete sub-event and move actions to the main event, and it's still works fine, huh. Is it okay?

    <img src="http://puu.sh/3vRzR.png" border="0" />

    3. Your Pathfinder is calculating cells size from the beginning of the layout, right?

    Im using X = round(mouse.x/32)*32 and Y = round(mouse.y/32)*32 action to place "finish" point, for example, and it turns out that the coordinates are generated indented 16 pixels.

    <img src="https://dl.dropboxusercontent.com/u/34384736/w.gif" border="0" />

    And I get this:

    <img src="http://puu.sh/3vRQU.png" border="0" />

    Any suggestions how to fix this?

  • vladoss: you should not be using this behavior anymore since an official pathfinding behavior has been released.

    My suggestion, don't use the behavior of this thread, use the official one and check the packed example that comes with Construct2 as well as the official manual entry.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • So I have a question, as I really like this behaviour; I managed to get boardgame-style movement very easily with it, but couldn't get the official one to work that way. Which leads me to my question; I thought that this behaviour uses a grid system, whereas the built-in behaviour is more free-form, therefore making them different? Am I mistaken? Thanks

  • SecondDimension: I think the official behavior uses a grid system too since the a* algorithm works that way.

    The main difference is that the official pathfinding behavior allows to move the instance to which it is applied and doesn't propose several heuristic formulas.

  • Kyatric thanks

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)