Make "Every X Seconds" not be affected by time scale

Get help using Construct 2

Post » Mon Oct 12, 2015 3:12 am

Basically theres a timer in my game, that goes up by 1 every 1.0 seconds, but the player also has the ability to make time scale 0.1, but this also slows down the increment of my time variable. How do i make it so time goes up by 1 every real second? so that even when time is slowed, it still counts normally. I tried making it so when time is slowed it adds 1 to time every 0.1 seconds, but if i spam the slow down ability it add basically everytime i use it, making the time incorrect.
B
6
S
1
Posts: 46
Reputation: 492

Post » Mon Oct 12, 2015 4:04 am

You could use the wallclocktime expression to get a time unaffected by time scale. Store the wallclocktime when the timer starts, and compare the current wallclocktime to the stored value to determine how much time has passed.

Alternatively you could you make a family of objects to be slowed down, and set the object time scale for that family instead of changing the global time scale.
B
12
S
4
Posts: 48
Reputation: 910

Post » Mon Oct 12, 2015 4:57 am

Valhallen wrote:You could use the wallclocktime expression to get a time unaffected by time scale. Store the wallclocktime when the timer starts, and compare the current wallclocktime to the stored value to determine how much time has passed.

Alternatively you could you make a family of objects to be slowed down, and set the object time scale for that family instead of changing the global time scale.


I can't seem to find the wallclocktime anywhere.

Also just setting the player time scale didn't seem to work, he still flies around the screen at normal speed
B
6
S
1
Posts: 46
Reputation: 492

Post » Mon Oct 12, 2015 2:35 pm

Pretty sure it's in there. It's a system value.
Image
B
42
S
14
G
3
Posts: 165
Reputation: 5,115

Post » Mon Oct 12, 2015 3:38 pm

Sumyjkl wrote:Pretty sure it's in there. It's a system value.
Image


That works quite well, thank you :)
B
6
S
1
Posts: 46
Reputation: 492


Return to How do I....?

Who is online

Users browsing this forum: Christmas, Hassan Hackmi, minigame and 4 guests