Forum rules - please read before posting.

Loading Saves/Autosaves from a (non AC) Frontend scene?

Hello and a Happy New Year,

I am looking to implement a standard "Continue Game" feature in my frontend where upon clicking that option you'll be loaded into the latest Autosave.

At the moment my frontend scene is not an Adventure Creator scene and while (I am guessing) I could turn it into an AC scene and then use the relevant Save/Load Actions to achieve what I need, I was wondering if there's a way to do it without turning my scene into an AC scene. I.e. can I initialise just the save/load module in my scene and then call some relevant functions from the AC namespace?

Sorry if this has been answered already, I did a quick search but couldn't find anything.


  • edited January 2016
     I've just battled through an autosave problem, that took me about half a day to resolve!
    You must have your starting scene (main menu) converted into AC, or you gonna have few nasty bugs.
     One of them is when you do autosave it might not autosave your next scene after your main menu
     Second one is really terrible. When you do autosave and leave you game and quit to your main menu or completely quit your game, and then load from your autosave, you will never be able to autosave again. Althoug the picture of the autosave will be snapshot and refreshed in your autosave window, but the autosave will always load that autosave you made before you left your game completely or quit to the main menu scene. It sort of maps that autosave forever.

     I only resolved my problem when I found out that in my Main menu scene I accidentally didn't have some objects that I have in all other scenes, I don't remember what those objects were though, could have been AC objects, could have been some others. But it showed no errors.

     I don't want you to repeat my woes, but heck it might work in your project. Since who knows what I was missing there.

  • edited January 2016
     Damn it, the problem still persists :(
     And I think this time I have found why.
    In my Main menu scene, when I click New game I run action Engine: End game with Restart Game and Number 1 scene to restart. Otherwise how else can you reset all and start a new game.
    So later this causing the autosave malfunction as I described in the previous post :(
    If I remove this action, then autosave doesn't malfunction but it won't restart/reset a new game.
     By the way I run autosave cutscene right before I  leave/change for a new scene, and not autosaving it at the start of a new scene. Unity 5.2.4f1 AC 1.50b

    Hope Chris will fix it soon when he comes back.

    Also it would have been useful to be able to select actual scenes in the action Engine: End game Reset Scene. and continue after running.
  • @oxyscythe: The safest way is to make it an AC scene.  You can disable any unwanted systems (interaction, movement) etc by using the Engine: Manage systems Action.  You can also hard-code AC's Cutscene mode by calling AC.KickStarter.stateHandler.StartCutscene ();
  • @SkyTree: I cannot recreate.  Please provide further detail in a new thread.  Does the "File written" line in the Console appear as it should do when autosaving incorrectly?  Does the timestamp of the file it references change?  Does it work if you manually delete the old autosave first?
  • Cheers Chris, yeah I thought that might be the case. I'll give it a shot and report back, should be fine.

    SkyTree thanks for the additional info
  • Hello again! 

    So following your advice I set up my frontend scene as an AC scene and hooked things up accordingly.

    It all seems to work more or less as intended, I am however having one issue:

    When I load into a gameplay scene with the autosave, the camera doesn't seem to work.

    This is what I am doing:

    - In my Frontend scene's OnStart cutscene I have an Engine: Manage Systems action disabling pretty much everything (other than the Save system)

    - Then when I click the "Continue Game" button, I run an action list from an ActionListAsset which re-enables all disabled systems and loads the autosave

    - When the scene loads it appears that all previously visibly disabled systems (menu, inventory, player, cursor) have been properly re-enabled, however the camera won't move as the player walks around, it's stuck at its initial position.

    Any thoughts? I even tried leaving the camera to "No Change" in the frontend (as theoretically I don't need it to be disabled) but it still doesn't work when I load into the game.

    I am guessing I am doing something iffy in my scene setup that's causing the camera to fail when I load the scene in this way. but I can't quite figure what it might be... plus the camera works fine in every other scenario so maybe that's not it.
  • Does the camera work properly if you load the same autosave during regular gameplay?

    It may be that the front-end is a red-herring.  Check that the camera in question has a Constant ID component attached to it - it'll need one when the game is saved.

    Also check the MainCamera component after loading - at the bottom, it should tell you the currently attached GameCamera.  Is the correct one named?
  • Right again Chris. It was the ConstantID. To test I actually carried on playing so the game would autosave the next level and once I loaded that one I noticed I didn't have the issue. So as you said it had nothing to do with the frontend stuff, I just couldn't pinpoint what was different between the levels so your response was very helpful in identifying the culprit.

    I am going to do a pass of all my levels now as I am rather certain this will be an issue in other levels too.

    Thanks again!
  • edited January 2016
    So I am getting another weird problem now and I am hitting a bit of a brick wall trying to debug it on my own so I thought I'd seek your wisdom once again...

    I've set up some custom menus which use a mixture of AC menus and Unity UI menus. The way it works is that there's an AC menu that appears when you hover over the bottom right of the screen which brings up another AC menu when you click it and the AC menu buttons on that menu each bring up Unity UI menus.

    The problem I am having is that the Unity UI menus do not work when I start the game from my (newly converted to an AC scene) frontend scene.

    The exact sequence of events is:

    - I load the Frontend scene which (in its OnStart) deactivates all AC systems other than the Save/Load system

    - I click on Start New Game, this reenables all systems and then loads my "Intro Cutscene" scene (which is not an AC scene - could this be a problem?)

    - The intro cutscene scene then loads the first gameplay scene via an animation event at the end of the cutscene

    - Then, in the gameaplay scene, If I try to bring up my custom menu I get the behaviour described above (basically nothing happens)

    I've noticed that when I load directly into the gameplay scene my custom menu gameobjects are there under the _UI "folder" (deactivated), whereas when I load via the frontend and the intro cutscene scene, they're not (so no wonder they don't work).

    Also in the console window I get the following 3 errors when I load the intro cutscene scene from the frontend:


    Any pointers are much appreciated

  • The script errors do not match the latest version of AC, so you'll have to update before I can give advice on them (they may even go, if you're using a very old version).

    The key issue is that the UIs are not loading on your front-end scene, as you've described.  If this is indeed an AC scene, temporarily try amended your Engine: Manage systems Action so that the Menu system is not disabled
  • I was hoping to avoid upgrading as I am 99% done now...

    Oh well I guess I might have to bite the bullet

    I just tried re-enabling the menus in frontend and I still get the same crashes when the gameplay scene loads (and the UI gameobjects are missing). I also have the pause menu in the bottom left which can't be there in the frontend and intro.
  • Without upgrading, we won't know if this is an issue that has already been fixed.

    Menus can still be turned off even if the Menu system itself is active - just use the Menu: Change state Action to lock them.
  • Ah yes of course, forgot about that (embarrassingly, as I am already using it elsewhere)

    I am in the process of upgrading already... currently trying to track down changes I made to any Adventure Creator specific stuff so I can reinstate them. Fun times!

    I am hopeful though as I am getting different error messages now... Will report back once the upgrade's completed.
  • Issue persists after upgrade to 1.50d

    Trying various things now to see if I can circumvent it somehow...

    I noticed my custom (unity ui) menu game objects get spawned in the frontend scene (interestingly they get spawned regardless of whether I have the menu system disabled or enabled) and then once I load the next scene (intro cutscene scene), they're not there anymore. So that's likely where the problem first occurs. I've made that scene an AC scene now too so really not sure what would cause the menus to get destroyed in that scene.

    Another interesting thing is that when I load from the frontend straight into a gameplay scene (using the "Continue Game" option which loads the last autosave), everything works fine. The menus are there and work as expected.

    So it must be that Intro Cutscene scene that's causing things to fail... just need to figure out why...
  • Disabling the Menu system should indeed have no effect on whether or not the UIs are loaded - this way they'll be there when you re-enable it.

    If you're getting error messages in the Console, you'll have to re-post them with the new line references.

    So long as the Menu's properties in the Menu Manager have Source set to Unity Ui Prefab then it should survive a scene change, regardless of whether or not you move to an AC scene.

    If you suspect the Intro Cutscene is to blame, try instead moving to a new empty scene to see if the UIs survive.
  • Sorry, I forgot to say there were no error messages this time, that's why I didn't post anything. The ones I mentioned earlier went away once I revived the stuff specific to my game after the upgrade (basically I've added some components to the PersistentEngine prefab so I had to hook those up again - the errors were about those components missing)

    The Source property of the UIs in question is still correctly set to Unity Ui Prefab so that's fine...

    Good suggestion about loading an empty scene. I've done that and it looks like the UIs don't make it across to the test scene either. Does that mean it's the Frontend scene after all? Destroying the UIs just before the scene load somehow?
  • If both the Frontend and Intro scenes are AC scenes, are you usine Engine: Change scene to load the latter?

    To test if it's Frontend, try the opposite: load the Intro scene from a new (but otherwise empty) AC scene.
  • Oh man... that was it... I was doing the scene change via code!

    I replaced the call with a call to 


    and my custom UIs come across fine.

    Looking into the Engine: Change scene code it seems to be doing quite a bit more than just an Application.LoadLevel() (which is what I was doing) so I suppose it makes sense why it wasn't working :)

    Massive thanks for helping me debug this Chris!
  • Semi random aside: I just noticed after the update the character dialogue backgrounds auto expand to fully encompass any dialogue lines that are overly long (previously dialogue that was > 2 lines would get cut off)

    Nice! I was afraid to upgrade at first, but it was worth it JUST for this change
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.