Zwischen Menü und Kulisse wechseln

  • #1, by GreenLightDevelopmentTuesday, 22. April 2014, 18:36 7 years ago
    Ich versuche gerade, zw. dem Menü und dem Spiel zu wechseln.

    Aktuell habe ich die ESC-Taste angegeben, um vom Spiel ins Menü zu kommen. Weiterhin habe ich einen Dummy angelegt, zum anklicken (hier im Screenshot "Spiel starten"), der mich wieder ins Spiel zurück bringen soll.
    Die Sache mit der ESC-Taste funktioniert und ich lande auch im Menü. Jedoch wenn ich den Dummy anklicke, wird das Spiel restetet und startet von Anfang an.

    Hier zwei Screenshots, wie ich es eingestellt habe:

    Forum Fan

    134 Posts


  • #2, by afrlmeTuesday, 22. April 2014, 19:25 7 years ago
    Hmm it just changes to scene of current character. If you have an at begin of scene action in the scene & it hasn't been wrapped in an if query to make sure the actions inside of the at begin of scene should be activated or not, then it will play them again.

    Everytime you switch to menu & back to a scene you are triggering any at begin of scene & at end of scene actions associated with the current scene.

    The only way to truly restart the game from the beginning is to use the autosave system & have it create an autosave on the very first scene after the game menu which can then be loaded in the new game button of the menu.

    I have explained this loads of times in various threads as of late & I'm not going to type it out again, so here: http://www.visionaire-studio.net/forum/thread/reset-conditio...

    Imperator

    6846 Posts

  • #3, by GreenLightDevelopmentTuesday, 22. April 2014, 19:29 7 years ago
    So, how to make it possible, to switch between the menu and the game, w/o losing the gameprogress? I want to "hit esc" to get to the menu and "resume game" (clickable), to resume, whereever i stopped playing...

    Forum Fan

    134 Posts

  • #4, by afrlmeTuesday, 22. April 2014, 19:43 7 years ago
    in the key input you need to add an if query.

    first you need to create a condition "menu_active" or something like that. So when you change to menu you set condition to true & when you exit menu you set condition to false.
    -- inside of escape (released)
    if condition "menu_active" is false
    change to menu scene
    set condition "menu_active" to true
    else
    change to scene of current character
    set condition "menu_active" to false
    end if
    1
    2
    3
    4
    5
    6
    7
    8
    9

    in the resume game button you would just add change to scene of current character. But if you want an actual resume game then you should consider using autosave system in same way I mentioned for new game except you need to add execute autosave to at begin of scene & at end of scene actions for all playable scenes.

    Imperator

    6846 Posts

  • #5, by HellVanSingTuesday, 22. April 2014, 19:43 7 years ago
    Probier es mal mit "Menü anzeigen" und "Zu Kulisse von Person "Aktuelle Person" wechseln"

    Newbie

    67 Posts

  • #6, by GreenLightDevelopmentTuesday, 22. April 2014, 20:11 7 years ago
    @HellVanSing
    Also "Menü anzeigen" gibt es nicht ;-) Was dem änlich kommt, habe ich bereits so eingebunden.

    @AFRLme
    That Code you just posted... No idea, what to do with it, sorry ;-)

    Achja, kleiner Nachtrag:
    Ansich habe ich es genau so gemacht, wie es hier beschrieben wurde:
    http://www2.visionaire2d.net/glenfx/
    Natürlich habe ich die Speicheroptionen usw nicht eingebaut, sondern nur die Funktion nachgebaut, um vom Spiel in das Menü/und zurück zu gelangen.

    Forum Fan

    134 Posts

  • #7, by afrlmeTuesday, 22. April 2014, 20:36 7 years ago
    it's not code it was a list of action parts. I don't know the German text of the action parts off the top of my head which is why I wrote out the English ones.

    See attachments.

    Imperator

    6846 Posts

  • #8, by GreenLightDevelopmentTuesday, 22. April 2014, 20:56 7 years ago
    Ok, works like before (used your example). But still the same happens, when i try to switch back to the game. still keeps resetting. Anything to setup in the gamescreen, to make sure, the scene stay is the memory, w/o losing the infos?

    Forum Fan

    134 Posts

  • #9, by afrlmeTuesday, 22. April 2014, 21:00 7 years ago
    have you created an at begin of scene action? what exactly is resetting? I need a bit more information please.

    * my example was just to demonstrate a toggle button for showing the menu & switching back to scene of current character *

    Imperator

    6846 Posts

  • #10, by AlexWednesday, 23. April 2014, 11:00 7 years ago
    what is resetting? afaik only endless animations are reset to save memory. Endless animations are usually background animations where it does not make sense to keep them in memory. So if you want to keep endless animations you have to preload them (and don't forget to unload them at some point).

    Great Poster

    378 Posts

  • #11, by afrlmeWednesday, 23. April 2014, 12:09 7 years ago
    it was because he didn't wrap the at begin of scene action in an if query & condition. Everytime he opened the menu & then back to the scene it triggered the at begin of scene action again. He sent me the .ved yesterday & I looked over, edited it, sent it back & explained what I had done.

    Imperator

    6846 Posts

Write post