edited May 2015 in ORK Support
Greetings,

I'm trying to use the startEvent to load the AutoSave if the save file exists. What's the best way to go about that?

I haven't been able to find a check step to see if an Auto Save file exists so I've been working with setting a global variable a couple ways (e.g. in the start event if the variable doesn't exist or via an event in the first scene player loads on start up).

An issue I'm running into is the game appears to briefly load a new game, reload the scene with the saved game. So I know I'm coming at this from the wrong angle.

Thanks
Post edited by gamingislove on
  • edited May 2015
    You can make a button in your Overview menu--see the tutorial about that--to load and save files.

    Then set up via the Scene Wizard a spot to autosave when a player enters a new scene. I have it attached to my area name component at each spawn point in my scenes--trigger enter.

    You have to set up the gui box for it. I can't help you more right now because I'm on windows computer--my mac is currently doing stuff so I can't get to my game file.

    It's really easy to set this up as part of your save file button as part of your Overview menu--I'd say the way you're trying to do it is a little bit hard.

    It works very smoothly for me. Look at the tutorial again for setting up an overview menu and a save menu. Again sadly I can't check right now.

    I can try to help you further but not right now as my mac which has my game is busy.
    Post edited by Catacomber on
  • There's the Auto Load Game step to load the auto save slot. Also, there's the Continue button, that optionally be added to the main menu to load the last save game that was used (i.e. the last that has been saved or loaded).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • @Catacomber Thanks man, I'll look into adding it to my Overview menu.

    @GiL Thank you. i was working with the Auto Load Game step in my startEvent and it did work but I was getting the 'reload' effect that I mentioned above. Is there something I can do about that?
  • Loading a save game will always load the scene it was saved in (or a defined scene) - no way around that. If you're working with going through new game (which also loads a scene), you should probably work with hiding that fact, e.g. not fading in the screen for new game.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Great! Thank you :)
  • Sorry to open this up again. I guess I just need some direction on the start event should work. I would also like circumvent a start menu as well if that's possible? So essentially, look for a saved game, load it, else, create new one and autosave. I've done some iterations of this in a start event but it's not quite working out.

    Thanks!
  • Hm, probably best to work with 2 separate events.

    One event uses an Auto Load Game step to load the auto save. If no auto save game is available, it wont be able to load, but the event will end after that step.

    The other event (e.g. started with a delay of 1 second) will auto save and start a new game.

    If an auto save game is available, the first event (started immediately) will load it, preventing the 2nd event from starting. If not, the 2nd event will create an auto save game and start a new game.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Alright, yeah, that makes sense. I'm just not sure how to carry that out. I tried two start events in the the main scene. One with the Auto Load Game step only. And another with a basic start event and an Auto Save step added at the end after the Spawn Player step is called. That event is also in the scene and set Start After(s) to a 1 sec delay (the one directly below the Start Type in the Event Settings).

    The main issue I'm having with the above set up is that a player is not spawning and the variable playerAdded is not being set.

    I added an ORK Game Starter (with Start Game enabled as per the tutorial) to the scene as well. Though I did not add the a start event to the Main Menu > New Game Setting > Start Event since the events are in the scene already.

    I'm not sure if that's the correct way to set this up. Am I close or am I completely off base here? :D
  • Make sure both are Autostart start types and both aren't blocking events. Maybe add a dummy dialogue to the events to see if they're started :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Hmm, well somewhere I'm having a huge disconnect and not having any luck with it. I sent an email that will hopefully explain what we're trying to do :)
  • edited May 2015
    Greetings,

    ---------------
    EDIT: I apologize for the wall of text below. In a nutshell, it seems that an autosaved game, when called using an autosave step in an event, doesn't seem to be able to preform item notifications. I hope that helps.
    ---------------

    Since we now have the new Check step for a save game, what would be best way to utilize this so that:

    1.) Can start a new game or load a saved game without the need for a start menu.

    2.) Can use a separate scene from the first game scene.

    3.) When the new game is created, the UI and all other components load correctly. I'm still have this issue when I call a Load Scene step.

    To briefly breakdown how I'm attempting to do this:
    a.) I have an auto start scene then just runs a event to see if there's a saved game. If so, it loads fine. If not, it calls a Load Scene step, which is the first game scene.

    b.) The first game scene has a standard startEvent (E.g. Join Active Group > Spawn Player. ) that is autostarted when the scene loads. I also call an autosave event 5 seconds after the new game is created. The problem at this point is that there aren't any menus or UI of any kind. If I restart the game, but do not delete the autosave, it loads the game that was autosaved, but now with a UI but it's not complete. That's when I noticed last week and posted that notifications weren't working. Fruit from the same tree as far as I can tell. So I know I'm missing something here :)

    What's the best way to accomplish this :) And, in the Menus > Main Menu, should I have my AutoStartCheck scene in the Main Menu Scene? Or is that even relevant in this scenario? Sorry for the lengthy post, I really need to get this working :)

    Thanks again!

    EDIT: I was able to get a NEW game to load with UI etc. in tact by having a start event in a separate scene from the first scene:
    Event nodes: Event Settings > Has Auto Save Game > Success > Auto Load Game; Failed > Load Scene (SceneName and SpawnID -1). The first scene has the startEvent mentioned above.

    The new issue now is that when I autoload a saved game, the UI is there but notifications do not work (E.g. items added / removed). The notifications DO work in the new game now.

    Same issue if I go through the start menu. The save game is not showing notifications. Maybe my autosave is somehow messing things up? No idea :)
    Post edited by Squeaker on
  • The problem is most likely that the game over causes the running game to stop - usually you'd go back to the main menu and start a new game or load a game, which will set the game to running again.

    The Game Starter only does that the first time it's loaded somewhere - after ORK has been initialized, it wont start again.
    You'll probably need a small custom script in your start scene that always starts the game using this code:

    ORK.Game.NewGame(false);
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Well, it's really essentially just this:

    1.) Start a new game, loaded in standard tutorial fashion. E.g. Start Menu > first scene with startEvent and spawnpoint 0, The notifications work great.

    2.) Do an autosave.

    3.) Hit play in Unity to stop playing.

    4.) Start again, which goes to the start menu. Click Continue, which I presume loads the autosave.

    5.) Game loads at the autosave location. At this point, if I consume an item, pick up an item, buy something in a shop etc. there are not any item notifications to tell me that x item was added / removed from inventory.

    I'm not sure what's happening to cause it :)
  • Damn - you're correct, after loading, inventory notifications aren't displayed.
    Will fix it in the next update :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited May 2015
    Sweet! I'm glad to know I'm not crazy! :D Thank you so much.

    EDIT: BTW - I didn't mean that it was 'sweet' in the sense that it was broken. I know that means more work for you. Just glad you could see what was going on :)
    Post edited by Squeaker on
Sign In or Register to comment.