How do I check "Is NOT Highest"?

Get help using Construct 2

Post » Sun Sep 18, 2016 2:09 am

I can set up an event that reads "If object var is highest - Do something".

I'd like to be able to have an event that will do something to an object if it's variable NOT the highest. I can check for lowest, but that doesn't cut it. It's a pick event, so it won't allow me to simply invert.

Did a search on the forums, but couldn't see anything.

Any help is appreciated.

Thanks!
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
84
S
15
G
7
Posts: 991
Reputation: 11,231

Post » Sun Sep 18, 2016 1:58 pm

First pick the highest, then save that value to another variable. Then in a sub event, pick all, then pick by conditions, and then you can use the saved value to compare against with a system - compare values.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Sun Sep 18, 2016 2:25 pm

oosyrag wrote:First pick the highest, then save that value to another variable. Then in a sub event, pick all, then pick by conditions, and then you can use the saved value to compare against with a system - compare values.

Yeah, I came to the same conclusion after I'd posted, though I had hoped for a single event solution without the need for a variable.

Thanks though!
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
84
S
15
G
7
Posts: 991
Reputation: 11,231

Post » Sun Sep 18, 2016 2:30 pm

I try not to use a for each loop, as it tends to slow my games down. I suppose I could add a time to it to limit the number of loops... less accurate, but it has potential.
@bearboxmedia
www.bearboxmedia.com

Nintendo Wii U Developer using Construct 2
B
84
S
15
G
7
Posts: 991
Reputation: 11,231

Post » Sun Sep 18, 2016 7:50 pm

Try to avoid being too spartan regarding number of events - it generally has no discernible effect on performance, while usually having a clear effect on readability and coding time.

Avoiding loops where they are not appropriate is a fair though.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 36 guests