How do I assign multiple event sheets to layout?

Get help using Construct 2

Post » Sat Jan 09, 2016 8:08 pm

Hi,
is there any was that I can assign multiple event sheets to only one layout?
B
5
Posts: 10
Reputation: 245

Post » Sat Jan 09, 2016 8:11 pm

checkmate3 wrote:Hi,
is there any was that I can assign multiple event sheets to only one layout?


You use 'Include Event Sheet' https://www.scirra.com/manual/82/includes.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
129
S
29
G
77
Posts: 5,191
Reputation: 54,287

Post » Sat Jan 09, 2016 8:14 pm

Not as far as I know. You can take a event sheet and include other events sheet in it(right click in a empty space within the event sheet>include event sheet), but then all the events from all the included sheets will run concurrently.
So if you have duplicate events(maybe with just minor changes) in those event sheets then problems will arise.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Sat Jan 09, 2016 8:16 pm

Message: checkmate3 is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
You use 'Include Event Sheet' .

Thanks. This is what I was looking for. :ugeek:
B
5
Posts: 10
Reputation: 245

Post » Sat Jan 09, 2016 8:31 pm

I don't know if this applies to you @checkmate3 , but I had to deal with similar issues in some of my games where the difference between the levels was quite small code wise(in one case even layout wise) so there really was no need to make a ton of event sheets that had 90% the same code between them.
In that case what you can do(I found it a bit fiddly and annoying, but it works in the end) is to make as many things variable dependent, for example an every x seconds event, instead of having different every x seconds events and using numbers instead of the x put a variable there "Every SpawnTimer seconds" for example. And you just change that variable depending on what level the player starts.
You olso wanna use groups and subgroups. Put all your code in one event sheet, but put the parts that change into groups "Level 1 Group", "Level 2 Group", etc. and when you create the groups untick "active at start". Then again you use variable to decide which group/groups will get enabled when the layout starts depending on what level the player just clicked on for example, and so only the code from those groups will run.

If you wanna see an example of this in action, you have an android and you don't mind spending a bit of time to install a game then you can check out one of my games Kill The Blocks. If you play it, you'll notice it has about 10 different levels, and different things happen in each level, however the levels all use the same layout and the same event sheet!
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Sat Jan 09, 2016 8:34 pm

On the Project tab Click on the layout (any one)
Whenever u select a layout, the left side display properties of the currently selected layout.
you'll see
Name :xxx
Event Sheet: Event Sheet 2
Active Layer: xxx
..
Select the event sheet for each layout you are selecting
B
5
S
1
Posts: 16
Reputation: 416


Return to How do I....?

Who is online

Users browsing this forum: FabianB and 11 guests