Else on Construct 2

Get help using Construct 2

Post » Thu Dec 08, 2011 5:45 pm

Where are the else statement on the Construct 2 events?

it was removed?
B
3
G
1
Posts: 9
Reputation: 568

Post » Thu Dec 08, 2011 7:29 pm

There is none, but you can use this plugin

http://www.scirra.com/forum/plugin-branch_topic45712.html
B
33
S
7
G
6
Posts: 34
Reputation: 4,815

Post » Thu Dec 08, 2011 9:32 pm

You can also set and check a variable to get the same effect.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Fri Dec 09, 2011 4:49 pm

thank you very very much drpool... this plugin solution my problems
B
3
G
1
Posts: 9
Reputation: 568

Post » Tue Dec 20, 2011 7:12 pm

Hi Arima,

I am trying to use the set and check variable logic to decide which object to spawn in my game. However, I seem to be missing something because the condition occurring last in the chain always seems to be triggered. Can you help me understand what I am doing incorrectly?




blueseth2011-12-21 15:57:01
B
13
S
1
G
2
Posts: 7
Reputation: 1,747

Post » Tue Dec 20, 2011 7:42 pm

@blueseth : check this tutorial.
This is the same principle.

You can also implement with putting a local variable between event 1 & 2 (this way the local variable's scope is limited to events at the level of event 2 and 3). This var is 0 by default.
In event 2 & 3, add a condition to both being a compare localvariable = 0.

In both events add an action set localvariable to 1.

Remember C2 reads from top to bottom.
At the moment, when Turn = 1 your actions get executed. This includes subrsacting 1 to Turn.
So right after, Turn = 0, so the actions of this event would be executed.

If you inverted the order of those events you would have the opposite. Turn = 1 would always be executing too.

With the localvariable check, you are sure that only the proper event will execute its actions once per tick.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Tue Dec 20, 2011 9:04 pm

I hope Else and Or get implemented on future versions. Creating variables for this is cumbersome at least.
B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Wed Dec 21, 2011 4:08 am

Thank you, Kyatric. Your post helped me resolve my problem. I added a screen shot of the new working event sheet for any interested parties.





blueseth2011-12-23 01:34:03
B
13
S
1
G
2
Posts: 7
Reputation: 1,747

Post » Wed May 02, 2012 10:16 am

Thank you very much for this.
B
5
S
1
Posts: 2
Reputation: 639

Post » Wed May 02, 2012 10:18 am

@studioG, this thread is from December. It is now out of date, 'Else' was recently added to Construct 2.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Next

Return to How do I....?

Who is online

Users browsing this forum: BipolarMike, Televangelist and 22 guests