Go to 'next layout'...

Get help using Construct 2

Post » Wed Jan 25, 2012 4:58 pm

Hi there. So far this forum has been really helpful in solving any problems I've had, so lets have another go...

For the type of game I am creating I can basically use the same event sheet throughout for all of my layouts if it wasn't for one problem.

Upon the ball reaching the target I would like the option to go to next layout. However, I have to select a specific layout by name. This means that for each level, the layout that proceeds is different so I have had to create a new event sheet for each layout with a complete copy of events apart from this one event directing the player to the next level or layout.

I know another option would be to create multiple versions of my target/goal, and create several events in one sheet so depending on which level the player is on, the target in question will lead to the appropriate layout that follows but this is a bit tedious.

I think it would be much more convenient if the order that the slides appeared in the project browser were the order they were read by the game, so a simple 'Go to next layout' or 'Restart current layout' would be a great help.

I hope I've explained that clearly enough and apologises in advance if there is an easier way that is staring me in the face that I have missed.

Thanks

ImageImage
Mr. Green - Platform/puzzle game out now!
B
24
S
7
G
1
Posts: 222
Reputation: 3,325

Post » Wed Jan 25, 2012 5:02 pm

For a few releases now, you have a system action "Go to layout (by name)" that allows you to write down the layout name (and so being able to use variable as well).
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,998
Reputation: 57,791

Post » Wed Jan 25, 2012 5:08 pm

I did notice this, but I couldn't find anywhere that explained about how I would proceed to the next layout relative to the current one.

So what would I need to type into here to proceed to the next layout? Keeping in mind the fact that I would use this same event sheet for all layouts.

And also, upon the ball hitting the spikes, how would I restart current layout?
ImageImage
Mr. Green - Platform/puzzle game out now!
B
24
S
7
G
1
Posts: 222
Reputation: 3,325

Post » Wed Jan 25, 2012 5:17 pm

Use a global var "Level".

When you want to restart the current level :
Go to layout by name : "Layout" & Level (for C2 this will mean "Layout0", "Layout1", "Layout2", etc...)

For the next level, it is the same thing, just make sure to add 1 to Level on the end of level condition.
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,998
Reputation: 57,791

Post » Fri Feb 10, 2012 12:05 am

Sorry to bump this after quite a while but I got distracted. But I have since tried to implement this and can't seem to get it working.

Can anyone with a spare couple of minutes just throw down the events into a simple capx for me please? It would be massively appreciated.

Thanks in advance
ImageImage
Mr. Green - Platform/puzzle game out now!
B
24
S
7
G
1
Posts: 222
Reputation: 3,325

Post » Fri Feb 10, 2012 12:46 am

Just want to throw in that you can include all your common events with an event sheet include. Then, you can add any level-specific events for each layout beneath the include. For example, just a single event to go to which ever layout you want to be the next one when the level's complete.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Thu Jan 09, 2014 8:59 pm

You need to add str(Level) to work.
I know is a old thread but I am posting for myself.:D
1. Best Construct2 course :HERE!
2. 155 games source codes for sale on scrira store 12,86$each. PM me if interested to speed up the uploading process.
B
21
S
5
G
2
Posts: 102
Reputation: 2,036


Return to How do I....?

Who is online

Users browsing this forum: Khamsou, MarkThomas and 19 guests