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

0 favourites
  • 4 posts
From the Asset Store
Helping streamers give their viewers more excitement.
  • 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.

  • 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.

  • Hi,

    Thank you for your reply,

    I'm affraid I don't quite get it though.

    Especially that part :

    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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)