How do I Go back to last active layout [Savegame/Inventory]

Get help using Construct 2

Post » Fri Mar 06, 2015 3:40 pm

Hi everyone,

So here is my problem,
My game as a few Layouts (capter1, chapter2 etc..)
The savegame menu and inventory menu are as well in their own layout

So for exemple I'm on layout "chapter3" click on the button "save" ---> go to layout SaveMenu, choose a slot and save.
And then here is the problem, i wish i could have a "return" button and go back to "chapter3" layout.

The system "Go to Previous/next Layout" doesn't work since it doesn't send you back where you were playing
but uses the order on your project construction line.

Is there a way?
Can you have a menu/inventory in a separate layout you can call at anytime in the game and then go back where you were playing once you close it?

Thank you.
B
4
Posts: 9
Reputation: 218

Post » Fri Mar 06, 2015 9:24 pm

You can have a global variable which has the name of the current layout, which can be returned from a system expression and when you go to the save menu, do not update the variable. Then when they click back, use the 'go to layout by name' action using the global variable you stored as the name.
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,388

Post » Mon Mar 09, 2015 5:09 pm

Hi,

Thank you for your reply,

I'm affraid I don't quite get it though.
Especially that part :
briggybros wrote:do not update the variable.

what is updating a variable?

How do you guys manage your ingame menus? inventory /options/save
Everything on a top layer and duplicated in every layout?
B
4
Posts: 9
Reputation: 218

Post » Mon Mar 09, 2015 8:06 pm

Yes, I use a layer and hide it when not needed.

If you want to use your original method, that can also work though.

What I mean is that, you keep a global variable set to the level the player is on. Then when you go to the save layout, and the back button is pressed, you can send them to the last game layout based on that variable.
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,388


Return to How do I....?

Who is online

Users browsing this forum: ling200916, ridhoemgl, vext and 7 guests