Non-TimeScaled TimeDelta Expression

New releases and general discussions.

Post » Tue Jul 28, 2009 12:21 am

I'm pretty sure this would be possible to implement, but correct me if I'm wrong. I think it would be pretty sweet if we could get a TimeDelta expression that isn't affected by the TimeScale. This could be helpful for pause screens with moving elements.

Maybe it doesn't even have to be a separate expression, maybe you could just put TimeDelta(1) and it would deliver a non-TimeScaled value. That could keep people looking through the expressions list from getting confused between the two.

Possible? Yes? No? Chickens?
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Tue Jul 28, 2009 8:58 am

it's early in the morn' so I'd double check and test it
but
timedelta/timescale
should work
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue Jul 28, 2009 4:00 pm

I thought about that, but if you're timescale is set to 0, then you'd be dividing by zero. ;)
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Tue Jul 28, 2009 4:27 pm

[quote="linkman2004":33h326g2]Possible? Yes? No? Chickens?[/quote:33h326g2]
Chickens. Save the timescale, set the timescale to 1, and immediately timedelta begins returning non-scaled values, which you can then use on some custom movement events (for example). Set the timescale back to its old value at the end of the events, and then you have a loaf of events inbetween which use an unscaled timedelta.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Tue Jul 28, 2009 5:32 pm

[quote="Ashley":1zqxyjcj]Chickens. Save the timescale, set the timescale to 1, and immediately timedelta begins returning non-scaled values, which you can then use on some custom movement events (for example). Set the timescale back to its old value at the end of the events, and then you have a loaf of events inbetween which use an unscaled timedelta.[/quote:1zqxyjcj]

Ah, nifty. I hadn't even considered doing that. Thanks for the tip. :)
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Wed Jul 29, 2009 12:43 am

I'm not entirely sure if this is what you wanted, but for the 'bullet time/super speed' demo I made ages ago, I just used (1 / timescale) to make something look as though it wasn't affected by timedelta and slowing down and all that.

For example:
global TimeFix = (1 / timescale)

.x = (.x + MovementOffset * timedelta) * global('TimeFix')

Something along those lines. I'll post the cap
http://files.getdropbox.com/u/1289341/SuperSpeed.cap

(I'm also experimenting with that listbox replay method I believe Linkman made up ages ago too, I just wanted a way to do everything in slow mo, then replay it in realtime)
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Wed Jul 29, 2009 12:59 am

[quote="linkman2004":2c1qzvi4]I thought about that, but if you're timescale is set to 0, then you'd be dividing by zero. ;)[/quote:2c1qzvi4]

so why not if timescale = 0
then 0
else
the expression
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed Jul 29, 2009 3:55 am

[quote="lucid":1buxqt9g]
so why not if timescale = 0
then 0
else
the expression[/quote:1buxqt9g]
because 0 is not the original unscaled timedelta
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Wed Jul 29, 2009 5:17 pm

If the timescale is 0, then timedelta is 0 and it's impossible to retrieve the unscaled timedelta - unless you use my method ;)
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Sun Aug 02, 2009 11:50 pm

[quote="Ashley":3q2ve31s][quote="linkman2004":3q2ve31s]Possible? Yes? No? Chickens?[/quote:3q2ve31s]
Chickens. Save the timescale, set the timescale to 1, and immediately timedelta begins returning non-scaled values, which you can then use on some custom movement events (for example). Set the timescale back to its old value at the end of the events, and then you have a loaf of events inbetween which use an unscaled timedelta.[/quote:3q2ve31s]

I was wondering about the same as the thread starter today to have timedelta'd actions while the game is paused and this solved my problems easily. I just put "set timescale to 1.0" to the beginning of the actions, did all my timedelta stuff in the middle, and in the end I just set the timescale to 0 and voila, timedelta stuff working like it should while the game is paused!
B
16
S
8
G
4
Posts: 136
Reputation: 3,144

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests