Suspend or Freeze the game?

  • #1, by SCUD24Monday, 03. November 2014, 02:21 10 years ago
    When the player selects "exit game" from my dropdown menu, I would like to freeze everything in the game while the confirmation interface is displayed, keeping the player from moving around and NPC's from doing their routines until the player selects the "yes" or "no" button. I first tried adding "pause" commands to everything, but they seem limited to times, which would be fine for pausing for a 999 minutes if there was an "unpause" command, which there is not. Any ideas?

    Newbie

    28 Posts


  • #2, by afrlmeMonday, 03. November 2014, 05:19 10 years ago
    Yes but all methods will require a load of hassle like you described.

    1. create a condition.
    2. inside of each of your on mouse over/out & actions wrap all actions with an if query checking if condition you created above is true or false.
    3. use lua to create a table of all currently active animations & force it to lock each animation to currently active frame.

    4. to unpause you would toggle condition & restore active animation frames back to 1 & max frame value.

    This is completely theoretical & I have no clue if what I have just said is valid.

    The faster way to pause the game is to change to a menu scene. It automatically pauses all animations/stored action until you go back to the scene afterwards,

    Imperator

    7285 Posts

  • #3, by SCUD24Monday, 03. November 2014, 06:14 10 years ago
    Seems like this would be an action, as pausing a game is a feature in almost every game...

    Newbie

    28 Posts

  • #4, by ke4Tuesday, 11. November 2014, 11:20 10 years ago
    What about create a screenshot everytime when you would click on "exit game" button and set this screen as background behind your menu in menu scene and everytime you would create new screenshot it would set the same name and replace the old screen, or is this just stupid? grin

    Key Killer

    810 Posts

  • #5, by afrlmeTuesday, 11. November 2014, 12:24 10 years ago
    Well it's an idea but not sure if it's possible though, well not without testing & even then I'm not sure if you can overwrite image files inside of compiled games.

    I was going to say maybe it was possible to change sprite path for objects but the data structure says it's not scriptable & also quick note: openGL shader effects are not included in screenshots taken by vs screenshot function.

    Imperator

    7285 Posts

  • #6, by ke4Tuesday, 11. November 2014, 15:38 10 years ago
    I tested and it works. It everytime overwrite the older picture. And in menu i set in properties background.png as backgroud.
    createScreenshot("screens/backgroud. png")
    Show menu "menu"
    


    The only problem is that it takes for three seconds in my case...

    Key Killer

    810 Posts

  • #7, by afrlmeTuesday, 11. November 2014, 16:10 10 years ago
    you mean to take the screenshot? I know it freezes the engine for a little while during screenshot capture which doesn't usually last more than a couple of seconds or so.

    You have tested this in an exported/compiled game?

    Imperator

    7285 Posts

  • #8, by ke4Tuesday, 11. November 2014, 16:31 10 years ago
    Just tested, it doen't work in compiled game...

    Key Killer

    810 Posts