How do I ... Automated Pathfinding

Get help using Construct 2

Post » Tue Aug 26, 2014 4:59 pm

Hi! It's me again!

This time I've been toying around with possibility of doing a RTS and I got some of the base mechanics down when it comes to movement and harvesting which are working with some weird exceptions and I wondered if anyone can help me figure this out

My code is as following:

Image

and this is the exact same except switching out the food parts to gold, stone and wood

and it works and don't work as the image below shows:

Image

The weird part is it's not a error in the code as you might think, the problem lies in the positioning of the blocks it seems because if I put the gold and stone (the two on the right) where the wood and food (the two on the left) are they work but the wood and food don't.

Can anyone help me figure this out? I've tried placing the blocks further away from the "base", to no affect so it's not that they are too close.

If you need to have a look at my capx to get a closer look let me know and I'll PM you with a link for it.

Edit: Forgot to mention during the debugging on the ones that don't work the game finds a path to the destination but it don't start moving along the path.

Edit 2: I've noticed this only happens to resources that are to the right of the main base, if that helps anyone understand what the problem could be.
Maybe pathfinding cant go into -x or something? It just confuses me more than I am now personally...

Edit 3: I tried moving the base to the right of all the resource nodes and then it works just fine and then if I move it to the left of the nodes none of them work, so it seems like if the position I wanna go to from the node is in - X from the original position it don't work.
Last edited by Phealin on Tue Aug 26, 2014 6:41 pm, edited 1 time in total.
B
6
S
1
Posts: 13
Reputation: 847

Post » Tue Aug 26, 2014 5:22 pm

Have another look at the manual. You can't call 'Move along path' until you get 'On path found'.
ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Tue Aug 26, 2014 5:42 pm

It works though, it works on every place except the ones who are too far right of the "base" but I guess I'll just add a "on path found" and it should work?
B
6
S
1
Posts: 13
Reputation: 847


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], Lordshiva1948, plinkie, sublimate and 9 guests