How do I Pause game for x Seconds

0 favourites
  • 10 posts
From the Asset Store
This is a Dungeon Master tool & the 1st of 12 Combat Engines from the Building Combat Engines for Browser Games workshop
  • I want to pause the game for a second or so, such as when a player picks up an item or some other quick event:

    function pause (setting timeframe to 0 and disabling events/groups)

    something else

    wait 1 second

    function unpause

    Problem is that with a timescale 0 the 1 second will never pass.

    I guess I could set timescale to zero then set a specific object with a timer to timescale 1 and start the timer...but I feel like there should be a simpler solution without creating unnecessary objects...

  • I suppose you can use wait for signal instead?

  • I suppose you can use wait for signal instead?

    I don't see how that would help as you would still have the same issues just in a different event.

  • without using the timescale. On my project I simply did it via animation and waiting for a signal + states.

  • You could also maybe not *completely* pause the game... just set timescale to a very low amount (like 0.001 - or something) and have a wait time there to suit. It would be such slow motion it would appear paused, but not really be paused. Maybe?

    ~Sol

  • Have you use tag before ?

    I dont have C2 with me now...So maybe I kinda miss something but.

    Set a " tag" to pause

    then wait for a signal = the " tag"

  • Have you use tag before ?

    I dont have C2 with me now...So maybe I kinda miss something but.

    Set a " tag" to pause

    then wait for a signal = the " tag"

    I'm familiar with wait for signal but I'm not sure what solution you are suggesting.

  • You could also maybe not *completely* pause the game... just set timescale to a very low amount (like 0.001 - or something) and have a wait time there to suit. It would be such slow motion it would appear paused, but not really be paused. Maybe?

    ~Sol

    This makes sense and will give it a try. Don't even have to do the math myself, just times it my timescale (wait 2 seconds: 2*timescale).

    Thank you

    I guess the only concern I can think of is I have my gameplay events disabled (all in a group that is deactivated while paused) and one of my timers does happen to hit in that microsecond. Seems low percentage but still possible. The event for the timer would be disabled. Is there a way to pause all timers? Or would you have pause each individual objects timer? A for loop for each active timer would be good if that's possible to do.

  • also...

    wallclocktime

    The number of seconds since the game started, not taking in to account the time scale (i.e. the real-world time).

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • korbaach yes, that sounds like the simple straightforward solution that I thought I must have been missing

    I'm not at home to try it out right now but I am pretty confident that is the best solution and won't cause any issues. Thanks!

    Side note: I'm surprised that googling "Construct 2 wallclocktime/wall clocktime" doesn't have any helpful top results such as the System Expression page. If you didn't note there that it was from the system expressions page I would not have found it. I find it very difficult to find the desired material whether it be from Scirras internal search or external/google search.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)