Question about conditions.

Discussion and feedback on Construct 2

Post » Thu Jan 21, 2016 10:35 am

Hello, a question about conditions.
I have this list:

Image

I have read the document "How events works" but due to the translation into my language, I'm not sure I understood well.

My question is:
If the first condition "Array value at 18 = 0" is false, the remaining conditions of the list are checked?, or construct jump to the next block of events?.

I mean, all conditions are checked although the former condition is false?.
Last edited by The Mnk on Thu Jan 21, 2016 7:25 pm, edited 1 time in total.
B
28
S
11
G
18
Posts: 690
Reputation: 12,594

Post » Thu Jan 21, 2016 11:36 am

Mirlas wrote:Hello, a question about events.
My question is:
If the first event "Array value at 18 = 0" is false, the remaining events of the list are checked?, or construct jump to the next block of events?.

I mean, all events are checked although the former event is false?.


Construct 2 logic is the same as in programming,

If the top condition is false, then everything below that require that specific condition to pass is invalid. Construct will move on to other events.

And more importantly, the image you are showing is a list of conditions, not events. Conditions are conditions, actions are actions and events are events. Please don't mix them up.
B
36
S
18
G
11
Posts: 248
Reputation: 8,694

Post » Thu Jan 21, 2016 11:44 am

An event is just the name of the slot where logic code is placed. It is made up of the conditions on the left and the actions on the right. The conditions test whether the actions are executed or not. Therefore if there are multiple conditions in the same event all conditions must be true in order to execute the actions. So placing conditions in the same event is like placing "AND" between them.
If you want your conditions to be "OR", so that any one condition being true (while the rest are false) executes an event, you will need to either place them in separate events or create an "OR" condition between conditions.
https://www.scirra.com/manual/76/conditions
B
4
Posts: 4
Reputation: 204

Post » Thu Jan 21, 2016 7:26 pm

Ok, I think I understand, thanks for the info.
B
28
S
11
G
18
Posts: 690
Reputation: 12,594


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests