[Behavior]PathFinder

Post your completed addons to share with the community

Post » Wed Jan 09, 2013 12:47 pm

@Kyatric, loving the pathfinder behaviour.

1 problem:
I've placed this behaviour in a family and running 2 sprites from this family simultaneously.

It doesn't work for me. If I run each sprite individually, its good. However together, its mayhem (?).

Any thoughts on this (maybe its my code). Thanks.
B
12
S
3
G
4
Posts: 57
Reputation: 3,186

Post » Wed Jan 09, 2013 12:52 pm

@Captain: could you post your capx ?
I'll try to have a look at it and see if anything goes wrong.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Wed Jan 09, 2013 8:43 pm

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 :)
B
12
S
3
G
4
Posts: 57
Reputation: 3,186

Post » Wed Jan 09, 2013 8:58 pm

@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 ).
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Jul 05, 2013 9:45 pm

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


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?


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.


And I get this:


Any suggestions how to fix this?
B
37
S
15
G
6
Posts: 238
Reputation: 7,735

Post » Sat Jul 06, 2013 12:34 am

@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.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Sun Jul 07, 2013 8:55 pm

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
B
13
S
4
Posts: 127
Reputation: 1,479

Post » Mon Jul 08, 2013 9:58 am

@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.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Nov 04, 2016 10:53 am

Kyatric thanks
B
206
S
27
G
13
Posts: 1,834
Reputation: 35,776

Previous

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 6 guests