[SOLVED] How do I Create an in-game menu?

0 favourites
  • 5 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Hello!

    First Post!

    Alright. So I have been scratching my head trying to figure some things out. The most problematic is an in-game menu. First, here is what I mean.

    Scenario:

    Player is playing in a rpg, and decides to enter the menu to view a characters stats. Other engines bake this in, but since Construct 2 is genre-agnostic, it (naturally) excludes this.

    I figured I would try a few ideas.

    At first, I tried to make text elements (dummy menu commands) that would link to other layouts. This... did not work at all. When going back to game, the original layout is restarted. So then, I tried saving the game state in "MenuPauseState" and reload this save when coming back. IT WORKED!!! Or so I thought. When performing another operation, and reloading the layout, it reverted back to the state. I could not find an easy way to clear it after reloading layout. (Not to mention, if a player say, assigned a stat point, it would revert to the initial saved data anyway).

    Next, I tried to set timescale to 0, and then make individual elements visible without switching layouts. What a pain to go through every single layout, and set up a layer for every single "map" that has the elements positioned just so. Not to mention, sub menus... eek.

    I have looked all over and tried a couple of things from the only two relevant tutorials. Global UI (which uses a global layer loaded after starting the game) was originally the most helpful. It seemed like the perfect solution. Except when I tried to use the .capx and make it so a text object would appear on Esc (from UI layout) instead of going back to main menu. To my woe, items (even if layer is set invisible in event sheets) are ALWAYS visible.

    I tried the tried and true method of google and youtube... only to find most "Game Menu" or "GUI" results almost always refer to title screen menus... Great and all, but I have that figured out, and it doesn't really help.

    I'm trying to learn more about Construct 2 (coming from a PHP background, so things are a little different as one may imagine). Right now, with the goal to learn the engine (rather than designing an actual game), I am trying to expand the Ghost Shooter (Beginner's Guide) tutorial project. So far, I have some things (respawn, bar HUD, Ammo count, score, XP) added. It just seems in-game menus are either not a hot topic, or so crazy simple (or complex) that no one really covers it in detail.

    Any help with a good direction to go would be greatly appreciated. I still need to work on things like inventory (I plan on using the menu to equip/upgrade items) and I've seen a couple of tutorials about Dictionary, WebStorage, and XML (which, frankly, looks SO promising and familiar!).

    Edit (TL;DR)

    Need pointers on how to create an in-game menu. I think the best way would be with global layers, to prevent other issues that I have had in other attempts.

  • Long story, not so very clear question..

    Do you want to know how to change to a different layout and coming back to your original one?

    Do you want to know how to set items invisible and/or untouchable?

    Do you want to know how to work with global layers?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry for the wall of text. Just wanted to include what I've tried, and why I had difficulties. Edited to simplify the whole question. Ideally, usage of global layers would be great, as I could modify one layout (Menu) and have the changes in effect no matter what layout (Map) the player is on. Also, allows changing instance variables and such without having to call global variables or resetting the layout.

  • Global Layer should work..

    Not sure why you'd have an issue with the visibility..

    https://dl.dropboxusercontent.com/u/485 ... sible.capx

  • Not sure why I was having issues either. I had everything set up... Though, the tutorial stated to start execution at Main Menu > UI > Layout 1. I was under the impression that the layer would have to be first loaded with the layout the elements are on, and THEN direct you to game layout. Your project file is simpler, works better, and really made me feel like an idiot.

    Thanks for taking the time to set me straight. Reminds me of all the most ridiculously nubile errors I've made...

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