Issue with save/load text on title screen

0 favourites
  • 13 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
  • Hi,

    The title screen for my game has both a "Continue" and "New Game" options. I'm using the following setup, which I'm sure needs a lot of adjustment. Data loads correctly but the "Continue" text never appears, even when saved data exists. How do I fix this?

    Tagged:

  • On get should be setting the variable not the local storage item?

  • Hi lionz,

    I've tried this and the text still isn't displaying.

  • Let's see the events

  • Hi,

    Sorry but I'm a bit confused. The events are the same as the ones posted above only I switched the local storage in "on get" to the global variable. The continue text displays if I save and then exit the game and return to the title screen, but not when I first load the game.

    I've got a setup where the game saves when a key is pressed, and on save complete the local storage key is set and the global variable is set to "1", but it's always "0" when I first load so the text won't display.

  • Maybe nothing is being saved. Can't see the save logic. Try adding a load logic to confirm it can load a previous save. Also fix those visible actions on the last event because you have both visibile and invisible for some reason.

  • Hi,

    I fixed the visible/invisible error. I forgot to mention I have a 'on key pressed load game". Loading works so it's definitely saving. The issue is getting the continue text to appear. As I mentioned in the previous post, the text appears if I save and then return to the title screen but it never appears on the first load. The game can still be loaded even though the text is invisible.

  • Yep please share updated screenshot so I can try and debug it. Also make sure that the event sheet is linked to that start up layout.

  • Hi, the event sheet's already linked. I added a couple of other things to the event sheet but don't think they're causing the issue.

    The idea was if "N" (start new game) is pressed and there's no saved data it goes to the intro. If "N" is pressed and there's data a window asking if you want to clear saved data pops up. If "Y" is pressed then it clears the data and goes to the intro. If "C" is pressed it loads saved data, and it does this even though the continue text won't display.

    I checked debug mode and the "GameSaved" global variable is always "0" even when there's saved data when the game starts, but if I save during the game it changes to "1" and the continue text displays normally when I return to the title screen.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • at the start of layout you are checking if "GameSaved" exists. You have the correct "missing" event, but you never issue a "Get" action, so the third event will not get executed.

    change the third even to "on exists" instead of "on get". Since you checked if the item exists, it will return the value stored so there is no need then issue a Get.

  • Hi AllanR, thanks for the advice. I've tried this but am now getting the opposite problem - the continue text appears even when there's no saved data as the global variable is always "1" when I first start up the game, even after cleaning the browser cache. Am I missing something?

  • ok, since the item exists, but can be either 0 or 1, you need to set the global variable in that third event to the local storage value (which will be in localstorage.itemvalue)

  • Thanks so much, it's working now. :) This had been driving me crazy for days.

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