Pause and unpause Timer

MazeCrazeGameMazeCrazeGame Member Posts: 56
edited January 2012 in Tech Support
In your Tshirtbooth videos, he says that using the pause and unpause button paused the ENTIRE scene. Well, if you notice on his video, the timer freezes and never resumes. In my game, the game pauses, but actually keeps running in the background. When I press the unpause button, what was once 5secs now becomes the time between pause and unpause. So, if a person paused the game at 5secs (then leaves for 20secs) the game resumes at 25 secs. How do I fix this? If the pause game feature doesn't pause the entire scene simply to skip to a "pause" scene, that's CHEAP! Please help.

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    edited January 2012
    Like tshirt i could have sworn when i played around with pause when it was first introduced that it did indeed pause the time, so i did a test and your right its not pausing the time.

    So then i got to thinking, the game time is supposed to tell you the time your in the game, so even if its pause that doesnt change how long your actually in the game so maybe thats why. So i did another test, made my own attribute, had a timer every 1 second change attribute to attribute +1 and put a button to pause the game that also displayed that attribute i was adding to. And after pausing the game that attribute still kept adding as well, so there might be issues with the pause behavior currently.

    What tshirt kindly made for you will get you going though

    cheers
  • MazeCrazeGameMazeCrazeGame Member Posts: 56
    Thank you all very much. I'll get back to u letting u know if it works
  • simo103simo103 Member, PRO Posts: 1,331
    Would this have been reported as a bug as of yet? I also have an issue I think is a bug with the Pause function ( http://forums.gamesalad.com/discussion/37595/issue-when-un-pausing ) and have reported it with a project file. Unfortunately it seems I won't get a response so I won't know if it is a bug and when its fixed, or if it's bad logic on my part. Since there appears to be a bigger issue with pause any chance you Sous could take it up will GS and perhaps get some feedback? If not could you advise jrsi2010 to report the bug?
  • MazeCrazeGameMazeCrazeGame Member Posts: 56
    No, it's still not working.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    This may be related to bugs in the Pause Game behavior. If not, I'd appreciate some help with it. I am trying to make a "Level Completed" overlay scene with a continue button. The continue button has when touch is inside --> unpause game. My Control actor on Level 1 has the following behaviors (in order):

    Pause Game (Go to Scene: Level Completed)
    Log debugging statement "after pause game"
    Change Scene (Go to Scene: Next scene)
    Log debugging statement "after change scene"

    *Inline images appear to be disabled on this area of the forums, but here's the screen capture: http://img197.imageshack.us/img197/7462/screenshot20120123at344.jpg.

    I expect that when Level 1 is over, the Level Completed scene will appear with the continue button and then when I click the continue button, it should unpause the game and immediately go to Level 2. But instead, it just unpauses the game (so if I completed level 1, I am still on level 1 after it unpauses).

    The log shows the two debugging statements immediately (either exactly with or right before the Level Completed scene appears). When the game is paused and I haven't yet clicked the continue button, both debugging statements have already appeared in the debugger window. So basically, it is running the behaviors after the pause game behavior before I unpause the game, but it is skipping the change scene behavior both before and after unpausing the game. Why is this?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Okay, I think I may have misunderstood the parallel processing of rules in GameSalad. This must be the reason that my behaviors that follow the Pause Game behavior are executing before I issue an Unpause Game behavior. My colleague suggested that I add a timer after the Pause Game and move the other behaviors (e.g. Change Scene: Next Scene) to inside the timer. I tried this with an after 0.1 seconds timer and it did work.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • GLGAMESGLGAMES SingaporeMember Posts: 988
    i usually use customer timer=timer+1 every 1 sec.
    so i will create a game boolean call pause.
    i add this in the timer rule>
    every 1 sec if pause is false timer = timer+1
    so when i use the scene pause rule i will also change game.pause to true when pause is pressed.
    This will stop timer from continuing to count when game is paused.
  • ellucoelluco Member Posts: 7
    Reviving this thread for a variation of the problem, how do you do the pause for a custom image timer? I get the template but unsure on how to implement it onto a custom image timer that i'm working on.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @elluco Why would it be any different than what GLGAMES suggested way back when?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ellucoelluco Member Posts: 7
    @tatiang sorry am new to GS, i just can't seem to get my custom image timer to work. I have no problems if it's a display text timer, but i'm doing a game with custom images to my timer, which counts separately on each digit based on the game time. So i'm wondering how to implement the current game time = game time - pause time formula. Sorry if i cause unnecessary trouble. :(
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    It's fine to ask questions, I'm just not understanding why it's not the same process.

    If you have When game.pause is false --> timer every 0.1 seconds change game.theTime to game.theTime+0.1 and you use either a DisplayText actor or a custom actor based on game.theTime, I would think it would be the same general set up for both.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ellucoelluco Member Posts: 7
    Alright, after your explanation i kinda see things a bit clearer now. Will try it. Thanks! Hopefully it works.
Sign In or Register to comment.