How do I Pick All Other Instances

Get help using Construct 2

Post » Thu May 15, 2014 6:22 am

I'm trying to figure out how to pick all the instances NOT met in the condition:

Code: Select all
If Mouse is overlapping MenuItem
>>>Set MenuItem frame 1

Pick All Other Instances
>>> Set MenuItem frame 0


Something like this. My usual non-coding way of doing it would be to set an instance variable for each individual one and do:

Code: Select all
If MenuItem Var = 1
>>> Set Frame to 1
>>>>>>>If Menu Item Var 2
>>>>>>>If Menu Item Var 3
>>>>>>>If Menu Item Var 4
>>>>>>>If Menu Item Var 5
>>>>>>>If Menu Item Var 6
>>>>>>>If Menu Item Var 7
>>>>>>>If Menu Item Var 8
>>>>>>>>>>>>Set Frame to 0


But this gets incredibly messy. Am I over-complicating this?
B
44
S
12
G
1
Posts: 545
Reputation: 4,271

Post » Thu May 15, 2014 10:50 am

Simply change all before changing the desired object.

For instance:
Main Event
On mouse overlapping menuitem
action: tmpvariable = menuitem.UID

sub event 1
pick all menuitem
action: menuitem set frame 0

sub event 2
pick menuitem by evaluate menuitem.UID = tmpvariable
action: menuitem set frame 1
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592


Return to How do I....?

Who is online

Users browsing this forum: AlexiarTW and 7 guests