Reset Conditionals

  • #1, by BenmirathSunday, 05. January 2014, 18:34 7 years ago
    Hello,
    I'm trying to wrap my head around how saving and new games work. My game uses a lot of conditionals, which causes problems the way I've implemented starting a new game. The way I've set up my menus, I can return to the main menu during gameplay, which then lets me select a new game. Yet any conditionals that were changed carry through, which causes problems. Is there a way to trigger all conditionals to reset, or any specialized function for new games that does something similar?
    And relatedly, how are conditionals stored between game sessions? Do they get reset when you close the program, and loading a saved game restore the previous values?
    Thanks for any assistance,
    Ben

    Newbie

    31 Posts


  • #2, by afrlmeSunday, 05. January 2014, 18:49 7 years ago
    the simplest method for new game is for it to save to an designated quick save slot on new game launch - beginning of first non-menu scene.

    The idea is that when you start a new game (first time) or resume a game by loading from a previous save is that you set a condition "game_initialized" to true to tell the engine that a game is currently in session. Inside of your "new game" object you add a query if game init is true, if quicksave x exists then load x quicksave else go to scene of current character (or whatever you normally do) end.

    hope this helps...

    *edit: sorry just skimmed over your message so didn't end up reading the end of it... conditions & values are stored into both regular game saves & quick saves.

    Imperator

    6815 Posts

  • #3, by BenmirathMonday, 06. January 2014, 02:07 7 years ago
    Hmmm, I think I understand what you're getting at. I haven't really directly messed around with saving yet, so I guess thats next on the agenda. Thanks a lot for the explanation!

    Newbie

    31 Posts

  • #4, by afrlmeMonday, 06. January 2014, 04:15 7 years ago
    yeah I know I didn't exactly type up the most easy to understand replies.

    1. decide on a quicksave # value to use for launching a new game
    2a. create an object for the new game button...
    2b. inside of this create a "left click executed" action...
    2c. inside of the action create an if query something along the lines of...
    if quicksave # exists
    load quicksave #
    else
    change to scene of current character
    end if
    1
    2
    3
    4
    5
    6

    3. inside of an at begin of scene action in the very first scene launched after the player clicks new game add an if query...
    if quicksave # exists
    else
    pause for 500ms
    execute quicksave #
    end if
    1
    2
    3
    4
    5
    6


    I think that about covers it.

    P.S: you can pretty much use the same method for creating a resume game button by having it save to an assigned quicksave slot at begin & end of each scene via the at begin of scene & at end of scene actions.

    Imperator

    6815 Posts

  • #5, by lefooshSunday, 25. January 2015, 22:20 6 years ago
    hey All, I've been following this and the other threads and why I can see it SHOULD work for me it doesnt.

    As soon as I click on new game it restarts the game but any items collected are still in my inventory / removed from the scene.

    Am I missing something vital but obvious...?

    Newbie

    77 Posts

  • #6, by afrlmeMonday, 26. January 2015, 01:09 6 years ago
    You need to a single instance of the autosave on the first time you launch new game. My recommendation would be to create an empty scene (menu) which is displayed before swapping to your initial scene. Inside of this add an at begin of scene action. Then add these action parts into it.
    pause 500ms
    if autosave #0 exists
    else
    execute autosave #0
    end if
    pause 500ms
    change to scene x (whatever your initial scene was supposed to be)
    1
    2
    3
    4
    5
    6
    7
    8


    So in your new game button you should include these action parts...
    if autosave #0 exists
    load autosave #0
    else
    change to scene (the one I mentioned above)
    end if
    1
    2
    3
    4
    5
    6

    This way it will load your autosave if it exists but will create one if not. It will only create the autosave once which means that it should reset the entire game. You should use autosave #1 for the resume game.

    Imperator

    6815 Posts

  • #7, by lefooshMonday, 26. January 2015, 17:02 6 years ago
    Awesome, thanks - I'll give it a crack!

    Thank you!

    Newbie

    77 Posts

  • #8, by afrlmeMonday, 26. January 2015, 17:10 6 years ago
    Forgot to mention that you should probably add a plain black background to that scene I mentioned. It should be size of your default game resolution.

    Imperator

    6815 Posts

  • #9, by lefooshTuesday, 27. January 2015, 22:54 6 years ago
    OK, clearly I'm missing something vital as this isnt working for me.

    Before I create the autosave it works but then when you retry you are taken instead to the first scene of the game you are taken to the first scene in the file order that - in this case - is an intro scene.

    I dont get it, it should work, so weird!

    Newbie

    77 Posts

  • #10, by afrlmeTuesday, 27. January 2015, 23:08 6 years ago
    Would you be willing to send me the .ved & resource files? If you don't want to do that, then maybe a 1080p private video via youtube or screenshots etc?

    Imperator

    6815 Posts

  • #11, by lefooshTuesday, 27. January 2015, 23:12 6 years ago
    Course, lemme PM you

    Newbie

    77 Posts

Write post