How do I freeze time completely? [SOLVED]

Get help using Construct 2

Post » Fri Feb 24, 2017 4:41 pm

Trying to replicate Game Maker's "sleep" function, which stops the game for X seconds

Potential uses:
-Game feel
-Camera "focus", which emphasizes importance (enemy death for example) by putting the camera there for an instant

https://www.dropbox.com/s/cxsgjukbdo3lk ... .capx?dl=1

First try:
" On freeze (0.5):
- set timescale to 0
- wait (function.param(0))*dt
- set timescale to 1 "
(doesn't work)

Second take:
" On freeze (0.5):
- set timescale to 0.01
- wait (function.param(0)*dt)
- set timescale to 1 "
(works, but time is not really 100% "frozen"!

I'm not asking for a miracle here, just curious if there is a really obvious solution I'm missing
Thanks in advance!
Last edited by CloveltOc on Fri Feb 24, 2017 7:59 pm, edited 1 time in total.
B
9
S
3
Posts: 150
Reputation: 1,264

Post » Fri Feb 24, 2017 5:09 pm

I don't think it can be set to zero because other functions like sounds depend on that time scale but you couldprobably make it so insignificant it would be impossible to tell any time passed. Try 0.0000000001?
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Fri Feb 24, 2017 5:12 pm

Yeah, but I'd have to scale the function's parameter too or it would freeze for a waaaay bigger amount of time.
Would like to find a way to set it to 0!
B
9
S
3
Posts: 150
Reputation: 1,264

Post » Fri Feb 24, 2017 5:41 pm

Use a GLOBAL VARIABLE. Can be BOolean or even a multiplier for all speeds....
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Fri Feb 24, 2017 5:53 pm

MPPlantOfficial wrote:Use a GLOBAL VARIABLE. Can be BOolean or even a multiplier for all speeds....


What? Where? Not sure about what you mean...
B
9
S
3
Posts: 150
Reputation: 1,264

Post » Fri Feb 24, 2017 7:48 pm

Wait is dt dependent so it won't work when timescale is 0. You could set the timescale of objects individually. Or you could use the wallclocktime expression to measure the time passed since it's not affected by timescale. Use wait signal instead of wait:
Image
B
91
S
31
G
103
Posts: 5,238
Reputation: 67,762

Post » Fri Feb 24, 2017 7:59 pm

Sweet, thanks!
B
9
S
3
Posts: 150
Reputation: 1,264


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest