Pick instance by highest value?

Get help using Construct 2

Post » Tue Aug 20, 2013 7:40 pm

How do I pick an object instance by highest/lowest value? For example pick an instance with the highest Y value?

Thanks :)
B
3
Posts: 16
Reputation: 232

Post » Tue Aug 20, 2013 8:54 pm

Somebody correct me if I'm wrong, but I don't think you can with a simple "pick expression".

However, maybe you could use a "for each object", test one of its value, and use ascending/descending for min/max. Add your action to that loop, then add a "stop loop". That way, only the object with the minimum or maximum value will be affected.
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Tue Aug 20, 2013 9:14 pm

Yep "for each (ordered)" that is.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630

Post » Tue Aug 20, 2013 9:23 pm

Oh yeah, "for each (ordered)", my mistake !
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Wed Aug 21, 2013 1:17 am

doesn't the "pick by highest/lowest value" action already do this?
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Wed Aug 21, 2013 7:26 am

[QUOTE=Sargas] doesn't the "pick by highest/lowest value" action already do this?[/QUOTE]

That only lets you compare instance variables on the object, versus say it's x or y value (unless you just copied those into an instance variable beforehand)
B
11
S
2
Posts: 87
Reputation: 1,112

Post » Sun Sep 01, 2013 4:57 am

Thanks guys! :)
B
3
Posts: 16
Reputation: 232


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 6 guests