Understanding "Else" Conditions

Get help using Construct 2

Post » Fri Apr 12, 2013 7:51 am

Say I have the following:

-> Event | Condition
--> Sub-event | Condition
-> Else

I understand that Else will take effect if the previous Event was false. In this case, does the Else wait for the Event or Sub-event to be false, since both come prior. However, to my thinking, the Sub-event is still part of the main Event, so it shouldn't matter, yes/no?

So...let's say......
-> Event | Condition TRUE
--> Sub-event | Condition FALSE
-> Else ...?...

Similarly...
-> Event | Condition FALSE
--> Sub-event | Condition Doesn't run...
-> Else TRUE......right?

How does the Sub-event's true/false status play into the outcome of the Else condition since both the Event and Else are on the same level? Is the Sub-event viewed as an extension of the Event in the eyes of Else, or is the Sub-event still part of the Event and factor into the overall true/false?

Additionally...
I'm using a For Each to check the conditions of each instance of an object. Some instances may have true statements, others false. Will the Else condition take that into account?

-> For Each | Instance 0 TRUE
-> Else ...?...

-> For Each | Instance 1 FALSE
-> Else ...?...

Thank you for your help!
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661

Post » Fri Apr 12, 2013 8:43 am

The first condition is every time TRUE.

-> Event | Condition | TRUE
--> Sub-event | Condition | TRUE
--> ELSE | FALSE
-> Else | FALSE


-> Event | Condition TRUE
--> Sub-event | Condition
-> Else FALSE


"However, to my thinking, the Sub-event is still part of the main Event, so it shouldn't matter, yes/no?"

It doesnt matter, here is a example:

-> Event | Condition | TRUE
--> Sub-event | Condition | TRUE
-> Else | FALSE

So lets say the firstEvent|condition|true makes a true, the sub event get triggered with an false. So the sub event wont work but also the Else will not trigger.



You need to understand it like:

-> This Shirt is yellow!
--> Yes it is yellow and it is also blue !
---> ....
-> No it isnt yellow

So the subevent will totaly ignore the else, if it would work it is like:

-> This Shirt is yellow!
--> Yes it is yellow and it is also blue !
---> ....
-> No it isnt yellow but it is yellow and blue

You see the problem ? :D








B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Fri Apr 12, 2013 3:49 pm

'Else' means 'the previous event at the same indentation level was false'. So sub-events don't affect else in your example.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Fri Apr 12, 2013 7:29 pm

@Darklinki - Thank you for your help. You kinda lost me with the shirt examples but I truly appreciate the examples all the same. :)

@Ashley - Gotcha. Thank you! :) Next up...a post requesting help to understand how For Each loops are rendered at/during runtime. LOL (I'm trying to peek UNDER the hood to see how the engine does its thing. That's why all these "basic" questions. Trying to see where the limits are for each event and function, and where I need to add other instructions to compensate.)
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661

Post » Wed Apr 17, 2013 6:32 am

I tried to make it as easy as possible :D Sry, but im glaad that I could help you a bit.
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Wed Apr 17, 2013 6:35 am

@Karklinki - It's all good. Even teaching well requires some learning. Was actually one of my favorite classes in Bible college...just learning how people learn in different ways and relating to each type.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661


Return to How do I....?

Who is online

Users browsing this forum: marekmk and 3 guests