pick highest/lowest not working

Get help using Construct 2

Post » Tue Jul 30, 2013 4:20 pm

CAPX

I have this capx in which the objects measure the distance between them and node 0 and then the distance between all nodes, and add those up to an instance value called "distance".

I'm trying to make the one with the lowest distance value trigger the "move along path". But every instance is moving D:

Some help would be really apreciated
B
43
S
12
G
6
Posts: 446
Reputation: 6,797

Post » Tue Jul 30, 2013 10:55 pm

Still haven't found out why this isn't working =/
B
43
S
12
G
6
Posts: 446
Reputation: 6,797

Post » Wed Jul 31, 2013 12:38 am

First you're using a for each loop so only one sprite will be picked on each iteration. There's no point picking the sprite with the smallest distance from a group of one. As well as that 'on pathfinding path found' triggers once for each sprite so even the loop is unnecessary.

You'd want to calculate all the paths first and then pick the sprite with the smallest distance once each sprite has calculated it's path.

moveWhenAllPathsFound.capx (r139)ramones2013-07-31 00:44:13
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,620

Post » Wed Jul 31, 2013 4:27 am

@ramones

I can't thank you enough man!!!

btw, you've helped me like 20 times over the past year xD love you =P


PD: i usually have trouble with the logic order of events -___-
B
43
S
12
G
6
Posts: 446
Reputation: 6,797


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, ColombageEnPLS, doriHOG, mrtumbles, rustomatic and 3 guests