Forum rules - please read before posting.

[SOLVED] Save/Load problems

edited May 2014 in Technical Q&A
Hello everybody,
and first of all a very big Thank You to Chris. This is a wonderful Asset, I have waited for a long time.
Now my problems:

1) I made Save-Game inside my game without problems. But after loading this save I get this error:

IndexOutOfRangeException: Array index is out of range.
SaveSystem.AssignMenuElementVisibility (System.Collections.Generic.List`1 menus, System.String menuElementVisibilityData) (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:1274)
SaveSystem.ReturnMainData () (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:913)
SaveSystem.OnLevelWasLoaded () (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:241)
SaveSystem.LoadSaveGame (Int32 slot) (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:170)
SaveSystem.LoadGame (Int32 slot) (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:75)
AC.PlayerMenus.CheckClick (AC.Menu _menu, AC.MenuElement _element, Int32 _slot, Int32 _buttonPressed) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:775)
AC.PlayerMenus.OnGUI () (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:350)


I am not very firm with scripting. Maybe someone can give me an advice where to search for the problem?

2) When I load a savegame, while a cutscene is running, the save is loaded, but the game is still in pause-mode.
Cursor is still disabled.

Thanks for any advice!

Comments

  • The two are likely related.  If the loading failed, Unity probably won't continue - so let's sort out 1) first.

    Did you change your Menu Manager or alter the Menus / Elements inside after saving and before loading?  The error message sounds like it's looking for elements that no longer exist.
  • Hello Chris, thanks for answering.

    I do not change anything. I save the game, stop it and restart. Then I load the save and the error appears.
    I search for the reason since hours. Maybe it is a problem with one of my menues. I will try to deactivate one after the other.

    And sorry for the bad english sometimes. Is not my native language.
  • OMG, I found the error!
    I have 2 menues with no menu-elements inside. They have a menu-name of just a line ("-----------") for separate various menu-types. After I created a label-element inside both of them, the saves work great! Also problem number 2) is solved now.

    Thanks for your time Chris and for AC. It is a wonderful tool!
    Just one more question. Is it possible to have a "wait-action"? To make a action-list to stop for some time without pause the complete game? It would be great for show a menu like "Get new Item" for some seconds in background, without stop the game.
    Maybe I just do not find a possibility, that already exists. Any advice?
  • If you are using a Cutscene, Trigger or Interaction, you can set it's "When running" box to "Run in background".  This will cause the Engine: Pause game Action to run in the background, acting like a delay, and won't stop the game.
  • Would be great, if this option would also exist in MenuActionLists and InvActionLists.
    Thank you for your help!
  • Don't forget that - from within Menu/Inv ActionLists, you can use the Engine: Run ActionList Action to run scene-based Cutscenes by referencing an ID number (just attach a ConstantID script to the Cutscene and copy the Constant ID number).  You can then set that particular Cutscene to run in the background.
  • Sure, but this only works inside the scene the cutscene exists. Menu/Inv ActionLists work independent from scenes. I try to make a menu, that can be turned on, stay for some seconds and then turn off. All this shall work from every scene without pause the game. Just the Engine: Pause Game Action inside the MenuActionList stops the game.

  • It's a limitation for the moment, to be sure, but I'll look into improving it.
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.