How to make pathfinding go to "exact" location?

Get help using Construct 2

Post » Tue Nov 25, 2014 9:25 pm

Okay, so if we had a top-down or isometric game, and we wanted a hero to move to an exact location, how do we go about this?

I set up a quick capx example. Now, the blue box should be "completely" overlapping the green box, but it always stops right in front of it. I tried playing with cell size and whatnot, but it didn't ever seem to stop where I wanted. I want it to land on it dead center.

Think of the green box as a marker rather than a sprite. It would be an invisible marker that indicated exactly where the hero would stop walking. While it is close enough for normal games, it would not really work as well if you wanted tile-based floors since the hero would never be centered (the green box would be centered on each tile).

I don't know if what I'm trying to do is even possible, but I thought I'd post here and see. Obviously, this could be done with other behaviors than pathfinding, but I need them to walk around obstacles or walls.
You do not have the required permissions to view the files attached to this post.
B
75
S
30
G
35
Posts: 340
Reputation: 22,896

Post » Tue Nov 25, 2014 10:17 pm

Hi @DrewMelton - xPos and zPos is no good?
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

Post » Tue Nov 25, 2014 11:13 pm

@hundredfold I'm afraid I'm not sure what you mean. Can you be more specific?

I have it set to go to the target's x and y coordinates. With the image point in the center, I assumed it would go to the center, but it always stops right in front of the object.

There could be 20 or 50 of these targets in a single level, so I will not know the exact coordinates beforehand. I'm just not sure of any other way to set it up to be more exact.

Anyway, thanks for the help. If you could clarify what you meant, I will look into it some more.
B
75
S
30
G
35
Posts: 340
Reputation: 22,896

Post » Tue Nov 25, 2014 11:28 pm

Have you checked the origin point of your images? - double click on an image so the edit image box appears, select the second to last icon down the left hand side and see where the little marker is positioned on your image.
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

Post » Tue Nov 25, 2014 11:47 pm

Yes, I have the image points for both objects set to center. I even tried moving them to the edge to see if it would go further, but it didn't make any difference, so I put it back to middle.
B
75
S
30
G
35
Posts: 340
Reputation: 22,896

Post » Wed Nov 26, 2014 12:32 am

You'd have to use On pathfinding arrived to trigger a final behaviour to finish the precise positioning (LiteTween) & orientation.
ImageImageImage
B
71
S
21
G
231
Posts: 3,691
Reputation: 129,358

Post » Wed Nov 26, 2014 1:24 am

blackhornet wrote:You'd have to use On pathfinding arrived to trigger a final behaviour to finish the precise positioning (LiteTween) & orientation.


I figured that'd be the case. After doing some more tests, I ended up using the moveTo behavior for the final adjustment. I just need to make sure it doesn't look too awkward. I don't want my characters doing a nice walking animation and then sliding into place at the last second. These will be 3d models that I will be building and animating. I'm just using placeholders from old games for now.
B
75
S
30
G
35
Posts: 340
Reputation: 22,896


Return to How do I....?

Who is online

Users browsing this forum: evillair, unicornspitfire and 13 guests