How do I Use single event sheet for 20 layouts

Get help using Construct 2

Post » Fri Mar 06, 2015 7:10 pm

Hi i am trying to optimize the game as much as i can. Now i have 20 levels with 20 event sheets. Is there a way to use only 1 event sheet for all of them.

For example If in Layout 1 , spawn my hero here, if in layout 2 spawn my hero there. And such things. But i could not find an condition called on layout 1 active or someting similar?
B
11
S
3
G
1
Posts: 411
Reputation: 1,766

Post » Fri Mar 06, 2015 7:28 pm

You could use a common layout for all the common stuff, and then outside of that have a spawn event that's unique to each?
B
6
S
1
G
1
Posts: 91
Reputation: 900

Post » Fri Mar 06, 2015 7:30 pm

If you click on the layout in the Project tab, the Properties tab shows the "Event sheet" used. You can change it there. Or, you can right click an event sheet and "Include event sheet" to include a common event sheet. That way you can have specific data per layout as well as any common functionality needed.
ImageImageImage
B
71
S
19
G
168
Posts: 3,429
Reputation: 97,074

Post » Fri Mar 06, 2015 7:44 pm

isn't there a way to have, multiple events sheets in one layout.
Or you say: events sheet, work on all layouts.

Or is that too demanding
B
5
Posts: 21
Reputation: 267

Post » Fri Mar 06, 2015 7:45 pm

thank you , i was already trying to do it this way , but what i wanted is , i have in each level different soundtrack. So i would have to create 20 event sheets just for the music. I thought it would be easier to create 1 event sheet for Music , and point each track to specific layout.

It would be great if there was a function On start of layout ( and add name of layout)
B
11
S
3
G
1
Posts: 411
Reputation: 1,766

Post » Fri Mar 06, 2015 7:50 pm

Make a global variable to store what level you are on and compare that variable to what music to play. Variable don't reset till you tell them to.

So like on start of layout then sub event if level equal this stop anything playing and play this.
B
22
S
4
G
2
Posts: 362
Reputation: 2,355

Post » Fri Mar 06, 2015 7:55 pm

PhoenixNightly: thanks , maybe webstorage could be used as well? because i use a lot of variables and reset variables.
B
11
S
3
G
1
Posts: 411
Reputation: 1,766

Post » Fri Mar 06, 2015 8:03 pm

You can use the expression: System.LayoutName.
ImageImageImage
B
71
S
19
G
168
Posts: 3,429
Reputation: 97,074

Post » Fri Mar 06, 2015 8:49 pm

Thx black hornet wasn't sure it there was an option for as I am can't power up C2 right now. Since black hornet confirmed you can have the system look at the name of the layout that should do what you need.

If system.layout name equal this then stop all playing and play this.
B
22
S
4
G
2
Posts: 362
Reputation: 2,355

Post » Fri Mar 06, 2015 9:26 pm

thank you, i am bit strugling with it, would you be so kind and make little capx to see how it suposed to work, thank you
B
11
S
3
G
1
Posts: 411
Reputation: 1,766

Next

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Alysdo, Phoenixbowman, vubidugil, xpunk81 and 1 guest