Forum rules - please read before posting.

Two problems I can't solve with AC and Unity UI

edited June 2016 in Technical Q&A

I have some big problems, I created a Unity UI Menu because I wanted a scrollbar to scroll the SavesList up and down, and I couldn't find a way to do that with the AC menu's. That  integration with Unity UI and AC thankfully works . But what happens next I can't find a solution for:

1. So I created a Main Menu that crossfades to the SaveGames List where you can save a Game. When I save a game, the game takes a snapshot but  is still paused (for some reason without enabling pause it won't go back to the game itself like it used to with the AC Menu's). I crossfade back to the Main Menu, close the Main Menu and it should go back to the gameplay, which it does BUT the SavesList Menu is still open. What ever I tried, it keeps displaying, I also don't get any Warning messages from AC, what I ussualy get. So I think this is a bug. Also, if I insert an Action List (ActionList after saving) with an Action that closes the SavesList Menu, the same thing happens: the game goes back to the Normal State and keeps displaying the SavesList Menu. I tried everything by now I think, it won't close, even the Engine : Manage Systems - Menu's disabled won't do anything!

So basically the SavesListMenu stays On after saving and nothing I can do about it.

2. Another problem is the SavesList itself, which looks all good with the slider but doesn't want to save the Empty slots. I created 20 slots. 5 of them already display a screenshot (which are savegames from the preciously created AC Menu that apparently kept their state) and they load fine and save well. But when I want to save a new game in slot 6 (an empty Save Slot), it doesn't do anything! I DID link the right buttons to the AC buttons and applied it to the Canvas but AC won't recognise that this is a save button. However, something I don't know is: should the savegame buttons have the same constant ID as the load buttons? I tried it this way, aswell as having seperate buttons (seperate constant ID's for Load and Save buttons), but both the Load and Save system of the already created games seem to work well. It could be that I missed something here though...

So, to sum it up: How to make an empty Save Button in Unity UI that actually works with AC?

(Using Unity 5.3.1f1 and AC 1.51B)


  • Please post separate issues in separate threads in future, as it makes it easier to manage.

    1. Upon saving, AC will close any "save" Menu that it finds provided that the Menu's Appear type is either Manual, On Input Key, or On Container.  Check that this is the case for your new Save menu.

    When you have an issue with a Unity UI-based Menu, always try switching the Menu's Source back to Adventure Creator to see if the problem still exists - this will help us determine where the problem lies.  What happens when you try this?

    It may be that, while you're turning off the Menu manually in the ActionList, some other operation is turning it back on immediately after.  Try locking the Menu instead - it'll prevent the Menu turning on until you unlock it.

    2. As with 1), switch back to Adventure Creator as the Menu's Source and see if it then works.  Also check that Show 'New save' option? is checked and that 'New save' text has been entered. 

    The demo game's Menu Manager, Demo_MenuManager, has a Save Menu with a Unity UI counterpart.  Load the demo game's Managers and change the Save Menu's Source to Unity Ui Prefab, then run the demo scene.  You should find that, so long as there is an empty slot available, you can click on the "New save" slot - bear in mind that you can only save a new game in the next available slot - the other empty slots will be hidden.

    If you want to create a dedicated "New save" slot Button, you can do this by creating a regular Button that runs an ActionList which contains the Save: Save or load Action.  This Action has an option to perform a Save New Game.
  • edited June 2016
    Sorry Chris, you are absolutely right!

    1. The appear type is set to Manual in the Main Menu, and the Save and Load Menu's.

    - The problem doesn't excist with the previous Menu's that have the same settings as far as they look like the AC Source type Menu's.

    - I tried both locking and turning off the SaveMenu after saving (also with ActionList when turn off) but it won't turn off. AC goes back to normal Gameplay but it forgets to close the SaveMenu it seems.

    2. The Adventure Source Menu's work without this problems. 'New Save' option is checked together with 'New Save' text. (both in Unity UI and AC Source)

    - Where is the Unity UI counterpart from the Demo_MenuManager in AC 1.51B? Probably this is a later version? Because I don't see it. 

    - How do I make a Unity UI button that runs an ActionList? I can call an ActionList from the Menu but then I would have to make multiple Menus which would be cumbersome.

  • 1. I tried what you said. So I switched the Unity UI  Save and Load Menu's back to AC Source. They work fine! But when I switch back again to Unity UI, same problem! It takes a snapshot after saving, State of Gameplay is Normal, but the SaveGame Menu is still open!
  • edited June 2016
    1. Are you certain the ActionList after saving ActionList is running?  If it only contains the menu-locking Action, test placing an Engine: End game Action in there as well to see if the game quits as you'd expect.

    2. I don't know what you mean by "Adventure Source Menus".  The Demo_MenuManager's UI counterparts are all found in /AdventureCreator/Demo/UI.  Each Menu is already linked to it's associated UI, so changing the Source field should be enough.

    A Unity UI Button that is linked to AC's Menu system can be given a Click type of Run Action List in the Menu Manager.
  • edited June 2016
    Thankfully point 1 is solved! Apparently if not having all the Canvas Group Fades enabled with a transition, things go wrong. But still it is strange, if I set transition to none, the Menu stays open. So probably if all Menu's are set to Canvas Group Fade and transitions are set to 0 it will also give no problems.

    2. What I would like to do is this (but I dont know if it's possible): Start the Game with 0 savegames (or with 1 AutoSaveGame). When the user wants to save the Game, make a new entry with a newly created save slot. So the slots from both the Save Menu and the Load Menu increase the number of savegames to the desire of the user. Is this possible?

    Edit: I see now that this is possible with the ProfilesUI from the Demo. I come back to it later when I looked at it!

    Very happy that point 1 is solved, thanks a lot for your help again!! :) :)
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.