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.
Comments
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
scene.
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.
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.
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.
- In my Frontend scene's OnStart cutscene I have an Engine: Manage Systems action disabling pretty much everything (other than the Save system)
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.
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?
- The intro cutscene scene then loads the first gameplay scene via an animation event at the end of the cutscene
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
Menus can still be turned off even if the Menu system itself is active - just use the Menu: Change state Action to lock them.
I am hopeful though as I am getting different error messages now... Will report back once the upgrade's completed.
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.
The Source property of the UIs in question is still correctly set to Unity Ui Prefab so that's fine...
To test if it's Frontend, try the opposite: load the Intro scene from a new (but otherwise empty) AC scene.
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!