I need to control my statements

Just started using Construct 2? Post your questions here

Post » Thu Jun 30, 2016 6:55 am

check this URL : http://i.imgur.com/ADvF896.png
I have 2 conditions in (System | obst.IDO = 1) condition
it should execute one then exit/stop
but , it execute both , I don't know why
it's not logical - how to execute the both conditions (tmp = 1 and tmp = 0)
it's impossible for tmp to be equal to 2 different values
any help please ?
B
16
S
6
G
2
Posts: 31
Reputation: 2,196

Post » Thu Jun 30, 2016 7:05 am

If abst.tmp = 0, then Event 10 would set 'tmp=1', which in turn would then activate Event 11, therefore both would run.

The answer is either another variable or use 'Else', which would be my preference.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
84
Posts: 5,374
Reputation: 58,430

Post » Thu Jun 30, 2016 11:17 am

Sometimes it helps when you make those events in a differend order.

Say .. have ....

if x = 1
set x to 2

if x = 2
set x to 3

if x = 3
set x to 4

The first event makes the second true. As a result they will run all. A chain of elses is the best option, but it can also very easy.

if x = 3
set x to 4

if x = 2
set x to 3

if x = 1
set x to 2

Now they do not make each other true, when executed top down.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests