Find nearest object on a path?

Get help using Construct 2

Post » Wed Nov 13, 2013 9:58 am

I think I almost have it. Distances are calculated now, but sometimes the game seems to hang in calculation. In other words, in the debugger I see 'calculating path' constantly change from true to false and the 'activity' variable (which tells what the object is currently doing) change from 'action' (meaning paths have been calculated) to 'path' (which is when it is calculating paths).

However, I'm not sure why there is sometimes a failure to determine distance.

Definitely agree with @TELLES0808 on the suggestion for a 'path distance' expression of some kind that will let us derive the distance from a calculated path. I'll post in the general forum as a suggestion.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,224

Post » Wed Nov 13, 2013 11:00 am

@Excal,

Sometimes, my objects collide with solids and it turn them unable to calculate any route, try setting them smaller (only the collision polygon, not the image)
Image
B
104
S
23
G
17
Posts: 1,350
Reputation: 22,028

Post » Wed Nov 13, 2013 11:36 am

@TELLES0808, that doesn't seem to be the issue here (I set the size smaller).

However, I think I have found one possible reason why it hangs - if in the case there are two or more objects with equal distance, the game fails to identify which is shortest.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,224

Post » Wed Nov 13, 2013 11:39 am

Nevermind, apparently that isn't the issue either.

I'm not sure what is going on. The computer object keeps alternating between calculating path true and calculating path false, causing a hang.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,224

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 15 guests