Load a layout inside an other

Get help using Construct 2

Post » Wed Oct 02, 2013 4:43 pm

Is even possible to load a layout inside a layout that is running??

Let me explain a bit better. I need to enable a secret area that has been created inside an other layout without stopping the main layout running. Is possible to do that in any way?
B
5
Posts: 22
Reputation: 344

Post » Wed Oct 02, 2013 8:33 pm

The layout doesn't have to be on screen and visible to enable things on it. You can run functions on the secret area to enable it while the main layout is on screen if you want.
B
47
S
17
G
82
Posts: 2,230
Reputation: 48,607

Post » Thu Oct 03, 2013 10:07 am

@plinkie could you further talk on this of you have the time? A couple weeks ago I tried to the same thing but failed. Imagine an enemy in the secret place you want to "find path" and "check for collisions" with other elements in the secret place. But since the secret place is on another layout no one is moving until you go to that layout, even if you include it's event sheet? So you can "goto secret place layout" but then main "layout" stops, and you just can't run both of them together.

The way to solve this was to mathematically model all the behaviours and events in both the secret place and the main area in an event sheet, and update each tick. Upon entering the secret place you draw secret place objects, and upon exiting you draw normal place objects.

Which was borderline impossible/unneccesarily long to implement and debug.

@v00d0, what I did to solve my problem can be described as:

1-)Use a large layout
2-)Use a global variable to keep current location ie outside, inside secret place
3-)Place your secret place sprites somewhere in the layout, way far from outside sprites
4-)Define camera limits for outside and inside
5-)Switch player location and camera when entering/leaving the secret place.

I hope I could describe it :)
B
18
S
4
G
1
Posts: 332
Reputation: 3,149

Post » Sun Oct 06, 2013 2:38 am

Ok to explain my problem better i'll try to describe the game.

This game is a DB of songs that an italian singer has made for childrens. These songs are represented inside a scenario with wich you can interact while listening the song.

So at a certain point of the song this hidden area will be activated and players will be be able to interact in this new area, while we are in this new area, the song must continue to play from where it was left, and all the layout must still be alive. So the problem is this, i need to zoom to this place and get inside the cave where i do something for 10 second and then i go out. If i could wrap a layout inside an other.


Anyway thanks a lot.
B
5
Posts: 22
Reputation: 344

Post » Sun Oct 06, 2013 2:57 am

Either make a REALLy large level or use a method to transition between layouts.

There is noway to load a layout onto another layout.

What could do is spend a lot of effort to create a streaming based level loader. but the prior two suggestions are better for what you want.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,038

Post » Sun Oct 06, 2013 10:32 pm

But my layout size is equal to the ipad3 resolution so when it goes on tablets and smartphone can be resized without problems. If i make a larger layout how will work the resize?
B
5
Posts: 22
Reputation: 344

Post » Sun Oct 06, 2013 11:16 pm

You mistaking Layout size and Canvas size.

Your canvas size is the display that users will see at anyone time. The Layout size is the size of the game map.

You need to read the tutorial. I would suggest read the basic tutorial before going any farther. This tutorial is by far shuold be mandatory read. It teaches the fundamentals. Don't skip it :)

https://www.scirra.com/tutorials/37/beginners-guide-to-construct-2
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,038

Post » Mon Oct 07, 2013 11:56 am

oh well, i always learn new software by using them. I'll give a look at that tutorial, thanks guys.
B
5
Posts: 22
Reputation: 344

Post » Mon Oct 07, 2013 12:14 pm

I always learn software by using it as well, but that also means looking at examples (a lot of them are provided with the download and many others are here on the forums)

Following a tutorial that isn't about what you want to achieve isn't a very nice thing to do, but it does provide you with basic (and as such) nescessary information about the use of Construct2.

This basic information will help you also when asking for solutions to event-creating, because you have a far greater understanding of the possibilities and the way things are done. (and for the right names of certain aspects of your project.)
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: Congrats2u and 22 guests