Conditions overlapping

Get help using Construct 2

Post » Wed Mar 07, 2012 1:43 pm

Hi folks,
I have encountered a strange problem!
I want to check wether the player colides with different rectangles. So far my Actions look like this:

But I noticed that only the two bottom actions/conditions are working. They seem to override the top ones.
Does anyone know how to fix this?Kageetai2012-03-07 13:49:38
B
10
S
1
Posts: 15
Reputation: 849

Post » Wed Mar 07, 2012 2:05 pm

[code]System: Every tick
-> t_Overlay: set Invisible
Player: Is overlaping Cave_top
-> t_Overlay: set Visible
Player: Is overlaping Cave_bottom
-> t_Overlay: set Visible[/code]
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Wed Mar 07, 2012 8:57 pm

Thanks, this works perfect!
Can you maybe explain why my way didn't work?
B
10
S
1
Posts: 15
Reputation: 849

Post » Thu Mar 08, 2012 1:27 am

Because of event order

The last one on the list is : if Player isn't over Cave_bottom, then sent t_Overlay to invisible
So event if you are over Cave_top the last event will be true then t_Overlay will be invisible
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Mar 08, 2012 1:53 am

Another way would be to join the two inverted conditions into one event. (putting conditions together is like using 'and')
That way the order doesn't matter...

[QUOTE=Kageetai] Thanks, this works perfect!
Can you maybe explain why my way didn't work?[/QUOTE]

Your original way did not work because for example: player can be overlapping the cave_top at the same time as NOT overlapping the cave_bottom..

as you said, they were overriding
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Thu Mar 08, 2012 9:33 am

Okay, I didn't think about the order. Thanks! :)

Functional seen the two solutions given are no difference, aren't they?
And I think the speed should not differ much either...
B
10
S
1
Posts: 15
Reputation: 849

Post » Thu Mar 08, 2012 12:33 pm

Technically, it's more performatic to make two events with both conditions, because you won't be setting/resetting some attribute over and over to the same object.
English is not my native language. Sorry for any mistakes and feel free to correct me if needed.
B
14
S
5
G
3
Posts: 110
Reputation: 3,225

Post » Thu Mar 08, 2012 3:45 pm

You mean like keepee mentioned?
B
10
S
1
Posts: 15
Reputation: 849


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests