Different event happen on start of each new layout

Get help using Construct 2

Post » Sun Apr 14, 2013 1:43 pm

Hi dudes! I have several levels, each is a different layout. When I start each level I want something new to happen, but it's different each time. Obviously I want to use the "on start of layout" condition, but need to determine which layout it is. How would it be best to do this?

What I currently do is have one master event sheet, which is inherited by each layout. Each layout then has 1 event which sets a global "levelNum" to the correct level number. Then in the "on start of layout" I check the value of levelNum.

Is this the best way to do this, or is there a better way? onion2013-04-14 13:43:18
B
12
S
2
G
3
Posts: 86
Reputation: 2,955

Post » Sun Apr 14, 2013 2:29 pm

You can use an Array to store the different actions you want to happen, and on start of layout randomnly select one, or put "Wait N seconds" and call more than one.
Also, you can put them as Groups (Unactive on Start), and activate them as needed.
Or, using a local variable, select a value floor(random(0 to N)) with N as many events as you have, and compare the local variable and activate the one which equals the value created.

California2013-04-14 14:39:30
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Sun Apr 14, 2013 8:29 pm

Couldn't you just use the LayoutName expression with a system compare?
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Mon Apr 15, 2013 12:18 am

I wonder if anyone is in the making of a on start layout ( number ) WOuld be helpful in level selector SO that you can only use one Master sheet
B
7
S
2
G
3
Posts: 58
Reputation: 2,284

Post » Wed Apr 17, 2013 12:00 am

@R0J0hound I didn't know there was a LayoutName expression, how do you compare against it?
B
12
S
2
G
3
Posts: 86
Reputation: 2,955


Return to How do I....?

Who is online

Users browsing this forum: Aserak2012, Colorfish and 4 guests