Time control mechanic (Help!)

Avatar
StimichPortals
30 Posts
Posted Feb 23, 2013
Hello!
I'm working on a time control mechanic which allows the player to pause or slow down time to complete puzzles. However, I do have two problems - one worse than the other:

1.(The worst, I guess) If I have a radio playing some music in a pause control map and then pause time, is there a way to pause the sound playing? Like when you hit ESC. I know you can use StopSound, but when time restarts you'd think that the sound would play from where it got paused, but this is not the case if I use PlaySound when it restarts.

  1. This isn't that much of a problem, but more nit-picking on my part. When you slow down time you slow down everything, but I've put a player_speedmod to speed up the player, it doesn't feel quite the same as normal speed. Maybe there is a way to fix that, I'm not sure.

I've recorded a video that shows this (Though the sound didn't want to stop for some reason, but you get the point. It did restart however.):

http://www.youtube.com/watch?v=gP7GRcatK2g&feature=youtu.be

Also, people have been complaining that the water doesn't stop animating when time is paused. Is there a way to fix that? Like, make a non-animated water texture? I'm not sure how to do that myself, but maybe some of you guys could help.

Advertisement
Registered users don’t see ads! Register now!
Avatar
CamBen
973 Posts
Posted Feb 23, 2013
Replied 24 minutes later
You could try setting the volume to zero, and then setting the volume back afterwards.
Avatar
protoborg
288 Posts
Posted Feb 23, 2013
Replied 10 minutes later

CamBen wrote:
You could try setting the volume to zero, and then setting the volume back afterwards.

That wouldn't pause the sound. It would only mute it.

StimichPortals wrote:
Hello!
I'm working on a time control mechanic which allows the player to pause or slow down time to complete puzzles. However, I do have two problems - one worse than the other:

1.(The worst, I guess) If I have a radio playing some music in a pause control map and then pause time, is there a way to pause the sound playing? Like when you hit ESC. I know you can use StopSound, but when time restarts you'd think that the sound would play from where it got paused, but this is not the case if I use PlaySound when it restarts.

I think you can use PauseSound, but don't quote me on that.

StimichPortals wrote:
2. This isn't that much of a problem, but more nit-picking on my part. When you slow down time you slow down everything, but I've put a player_speedmod to speed up the player, it doesn't feel quite the same as normal speed. Maybe there is a way to fix that, I'm not sure.

I think there is a way to determine the player's exact speed. If not, you could always set a switch to not effect the player.

Avatar
StimichPortals
30 Posts
Posted Feb 23, 2013
Replied 20 minutes later

protoborg wrote:

I think you can use PauseSound, but don't quote me on that.

This does not work.

protoborg wrote:
I think there is a way to determine the player's exact speed. If not, you could always set a switch to not effect the player.

Then I guess the slowmo sound effect wouldn't work.

Avatar
Lpfreaky90
2,842 Posts
Posted Feb 23, 2013
Replied 21 minutes later
it is possible. to adjust the speed except for the player. I've seen it before somewhere. I will see if I can see how it's done. :smile:
Avatar
FelixGriffin
2,680 Posts
Posted Feb 23, 2013
Replied 8 minutes later
There's a server convar (also a cheat) called phys_timescale or some such that only slows it down for the physics engine. I don't think it changes sound, but it might. It doesn't blend nicely like the logic_timescale entity does, though.
Avatar
StimichPortals
30 Posts
Posted Feb 23, 2013
Replied 7 minutes later

Lpfreaky90 wrote:
it is possible. to adjust the speed except for the player. I've seen it before somewhere. I will see if I can see how it's done. :smile:

I see. Would be nice if you would reveal the secrets if you find out! Thanks. :smile:

Avatar
Lpfreaky90
2,842 Posts
Posted Feb 25, 2013
Replied 2 days later
I'm sorry, it is apparently a specific for the educational version of portal 2.
It's hard coded, the engine is somewhat different to the normal portal 2. The speed things there are not available in our portal 2 :sad:
Avatar
FelixGriffin
2,680 Posts
Posted Feb 25, 2013
Replied 2 hours later
I think phys_timescale still works, though, it's aprt of the HL2 base.
Avatar
StimichPortals
30 Posts
Posted Feb 25, 2013
Replied 1 hour later

Lpfreaky90 wrote:
I'm sorry, it is apparently a specific for the educational version of portal 2.
It's hard coded, the engine is somewhat different to the normal portal 2. The speed things there are not available in our portal 2 :sad:

Oh damn. Oh well, guess I'll just work with what I have. Thanks anyways! :smile:

FelixGriffin wrote:
I think phys_timescale still works, though, it's aprt of the HL2 base.

It does work. You don't need sv_cheats to change it either.

Avatar
FelixGriffin
2,680 Posts
Posted Feb 26, 2013
Replied 8 hours later
Seriously? That's awesome. But I'll need to test if it's a cheat in Co-op and the Workshop, since those seem to have different rules (for example ent_anything is a cheat).
Avatar
StimichPortals
30 Posts
Posted Feb 26, 2013
Replied 5 hours later

FelixGriffin wrote:
Seriously? That's awesome. But I'll need to test if it's a cheat in Co-op and the Workshop, since those seem to have different rules (for example ent_anything is a cheat).

It does work in co-op, without sv_cheats enabled that is.

Avatar
StimichPortals
30 Posts
Posted Mar 02, 2013
Replied 3 days later
Yay. Time resistant stuff:

http://www.youtube.com/watch?v=DyxXPh8s41A&feature=youtu.be

Avatar
iWork925
1,080 Posts
Posted Mar 02, 2013
Replied 1 hour later

StimichPortals wrote:
Yay. Time resistant stuff:

Do want. :notworthy:

Avatar
StimichPortals
30 Posts
Posted Mar 02, 2013
Replied 1 hour later

iWork925 wrote:
StimichPortals wrote:

Yay. Time resistant stuff:

Do want. :notworthy:

Don't worry. It won't take too long until a map with that is released. Maybe next week, or the week after that.

Avatar
FelixGriffin
2,680 Posts
Posted Mar 02, 2013
Replied 1 hour later
Did you use a constraint on the normal cube?
Avatar
StimichPortals
30 Posts
Posted Mar 02, 2013
Replied 1 hour later

FelixGriffin wrote:
Did you use a constraint on the normal cube?

I disabled its motion, yes. If flung and time is paused it won't maintain its momentum though, as I'm not using phys_timescale 0. But for this little puzzle you don't need that, so it's all good I guess.

Avatar
StimichPortals
30 Posts
Posted Mar 04, 2013
Replied 1 day later
Also, people have been complaining that the water doesn't stop animating when time is paused. Is there a way to fix that? Like, make a non-animated water texture? I'm not sure how to do that myself, but maybe some of you guys could help. (Adding this to the OP aswell.)
Avatar
FelixGriffin
2,680 Posts
Posted Mar 04, 2013
Replied 6 hours later
Which texture are you using? I can make a non-animating version of it.
Advertisement
Registered users don’t see ads! Register now!
Avatar
StimichPortals
30 Posts
Posted Mar 05, 2013
Replied 17 hours later

FelixGriffin wrote:
Which texture are you using? I can make a non-animating version of it.

I'll check once I got Portal 2 installed on my laptop. My main pc needs a repair. Also thanks. You will be credited!