Forum rules - please read before posting.

Unity GUI Load Menu Confirm Window Failure

Good morning, everyone!

Today I'm working on the save systems on Unity 2019.4.0f1 and Adventure Creator v 1.69.5. I have two Unity GUIs, one for saving and one for loading, each have their own save list. Instead of saving/loading as soon as a slot is clicked, a confirmation window is turned on, a separate menu object for save and load. If the player selects "Yes", the Load menu is supposed to load the selected menu and then close the confirmation menu, returning us to the load menu. Instead, the Save confirmation window opens without active buttons, and the Load Confirmation Window and LoadMenu close unprompted. I tried using a custom script, but It didn't recognize the slot's ID, despite successfully counting all the slots available.
https://imgur.com/NRPbdg7

What could be causing this?

I'm sorry if anything I posted is too vague. Please correct me if this is the case.

Comments

  • edited July 2020

    The number of saves present may not always correspond to the slot ID - if you have saves with IDs 6 and 7, for example, you'll still only have 2 save files.

    If you update to the latest AC, the Settings Manager now has a "Save File manager" window that will list all save files currently associated with your project.

    You shouldn't have to rely on custom script (though it is a viable option), because you can pass the clicked save slot's ID as a parameter when clicking on a SavesList element to the ActionList its set to run. That workflow is covered in this tutorial, if you haven't seen it already.

    Let's start with the first issue of the Save confirmation window opening up instead of the Load confirmation window. How/when are you opening this window, and are these two Menus linked to separate Unity UI prefabs?

    When debugging Unity UI-based menus, it's often best to temporarily switch their Source back to "Adventure Creator" - so that Unity UI isn't compounding the problem. Try roughly restyling them in AC and see if the correct one then turns on. If not, let's see some screenshots of the Menus / ActionLists involved.

  • "Let's start with the first issue of the Save confirmation window opening up instead of the Load confirmation window. How/when are you opening this window, and are these two Menus linked to separate Unity UI prefabs?"

    The Load confirmation window is told to open through an action list connected to the Load Menu's save list. The Load and Save menus as well as the Load and Save message menus are each connected to a separate Unity UI prefab.

    As I try your debugging suggestions, I would like to know if it would more convenient for you if I send you my project file? I know the difference between sending a message and posting to your wall now, honest!

    Thank you for your help!

  • edited July 2020

    Oh, wait, I'm using Dialogue System for Unity and Animated Gif Player by Old Moat Games, too. Do I need to buy you copies of anything from the asset store before I send anything?

  • The issue will be down to some key detail hidden amongst the various fields and settings. Screenshots would be best, though I'd need to know the results of switching to AC-based menus first.

    Those other assets wouldn't be contributing to the issue. If you want to send me files, make it a .unitypackage file that has:

    • Your Managers
    • Your UI Prefabs and graphics
    • Your ActionList assets

    As well as details on how to recreate the issue.

  • Okay, I can say that switching to the AC Menus didn't change anything. It's going to take a while to composite the screen grabs of all the Action Lists.

    See you Monday, and as always, thank you for your help!

  • There are too many references to other Menus and custom script functions to get the full picture here.

    Is the game paused during this time? How far down (looking at comments) does the "LoadMessageMenu_Yes_OnClick" manage to run? Temporarily disconnect the "Engine: Wait" Action so as to prevent any issues related to pausing.

    Does the load actually occur or not? It may be that the SaveMessage is becoming active because that's the state it was in at the point the save was made - and it's state is being restored.

    To find out when/how it's turning on, open up Menu.cs and find the line:

    gameStateWhenTurnedOn = KickStarter.stateHandler.gameState;
    

    And insert the following just above it:

    if (title == "MyMenu") Debug.Log ("Turning on " + title);
    

    Replace "MyMenu" with the name of the menu (SaveMessage?) that's turning on at the wrong moment. The Console will then record any time it's turned on. Find the one that's referring to the time this shouldn't happen, and share the full messge that appears when you select it.

  • "... It may be that the SaveMessage is becoming active because that's the state it was in at the point the save was made - and it's state is being restored."

    I think that was exactly what was going on. I've done some rearranging, and
    the SaveMessage menu isn't showing up anymore! But now it looks like loading... is... saving? I do have the save/load command set to "Load", and GameLoadMenu's SavesList's list type is set to "Load". I also don't see any opening or closing action lists running any save commands, either.

    Well, at least there's progress. Can't complain about that!
    Thank you again for your help!

  • The Console should always notify when loading or saving a game - what does it report when trying to load?

    This "save/load command" is a variable? That too will be included in the save file, so it'll be restored upon loading unless you set it's Link to property to Options Data.

    What's the purpose of this variable? Would it be possible to do away with it, and replace with e.g. a Menu: Check state Action to check which confirmation window is open?

  • edited July 2020

    After Loading, I get this message:

    File read: C:/Users/Melissa/AppData/LocalLow/DefaultCompany/DialogueAdventure\AdventureCreator_Demo_15.save

    The variable's job is to remember which slot was chosen to save/load. As to if I can do away with it; I'll see what I can do.

  • After Loading, I get this message:

    File read: C:/Users/Melissa/AppData/LocalLow/DefaultCompany/DialogueAdventure\AdventureCreator_Demo_15.save

    The variable's job is to remember which slot was chosen to save/load. As to if I can do away with it; I'll see what I can do.

    Hmm, I have another variable called StoryProgress that communicates with Dialogue Editor for Unity. It loads a value, but it's PixelCrusher's counterpart doesn't seem to update it's own variable to reflect it. It used to, though. :-(

    I wonder if this might have something to do with this weird thing that happened when I updated to the newest version of Adventure Creator:

    After the update, all my menu and variable managers were apparently corrupted and their corresponding data vanished. Thank goodness I had archived my project like you said! I made copies of the archived managers and sent them to the updated project folder. Menus are completely fine, but the variable menu doesn't display correctly.

    https://www.mediafire.com/view/zalwjk945zudkm9/UhOh.png/file
    (not sure if this is important.)

    Thank you again so much for your patience. This project is, like, this close to done!

  • edited July 2020

    After Loading, I get this message

    That's the correct one - it's loading, not saving.

    The variable's job is to remember which slot was chosen to save/load.

    An integer? We may be talking about different things - I thought I was seeing a string that was set to either "save" or "load".

    After the update, all my menu and variable managers were apparently corrupted and their corresponding data vanished.

    Do the variables and menus still work in-game despite not being able to view them in their respective Managers? If so, it's likely just a cosmetic issue - but it'll still be necessary to fix. How might I recreate this? By importing your backup's Manager asset files into the latest AC? If so, please send me a .unitypackage file of the eight of them, and I'll look into it.

  • Here's the managers! https://www.mediafire.com/file/jt1jhc3o9hjlczh/Managers.unitypackage/file

    Everything works in-game just fine. The variables seem to be doing their job, they just don't display in the editor.

  • Thanks, downloaded. You might want to remove the link, now - in future, you should PM me any files for your game in private.

  • Recreated an issue with the Variables Manager (the window's just too wide to fit), but can't see anything wrong with the Menu Manager. Do I need to select a particular menu?

  • edited July 2020

    The Menu Manager is perfectly fine, as far as I can tell.

    Wait a minute, "too wide to fit"? What? Wait, where'd this horizontal scrollbar come from? What happens if I slide it?

                                             ********************
    

    Guess what, Chris? I'm finally a master hacker!

    Also, it looks like the reason I thought that the load games were saving was because the variable used to signal an update to a save file label was set to "true", which of course it would, since that would be the state it was in when the save file was created. I set the variable to false in a post load action script and the problem cleared right up.

    The other major problem seemed to revolve around Pixelcrusher variables not being made to reflect their AC counterparts. I finally found the buttons to fix that.

    I... think the nightmare's over for now. All that's left is to remove some of the unnecessary actions I added in previous attempts to debug the Load Message window.

    Hopefully, I'll have a demo to share with everybody soon.
    Thank you again!

  • edited July 2020

    It looks like Save: Save or Load (OverwriteExistingSave) does not shut down the menu that calls it, but Save: Save or Load (LoadGame) does.

    I can work with that, no problem! I thought I'd mention it, just in case that's not supposed to happen.

    God bless, sir, and have a lovely weekend!

  • You too, I look forward to the demo!

    Save: Save or Load (OverwriteExistingSave) does not shut down the menu that calls it, but Save: Save or Load (LoadGame) does.

    Saving the game from an Action detaches it from the way in which the Action was called (e.g. a menu) as it can be called from anywhere. When loading, the menus will be restored to their previously-saved state - unless you check Selective loading? to prevent this.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.