Time control mechanic (Help!)
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.
- 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.
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.
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.
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.
I see. Would be nice if you would reveal the secrets if you find out! Thanks. 
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
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
Oh damn. Oh well, guess I'll just work with what I have. Thanks anyways! 
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.
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.
StimichPortals wrote:
Yay. Time resistant stuff:
Do want. 
iWork925 wrote:
StimichPortals wrote:Yay. Time resistant stuff:
Do want.
Don't worry. It won't take too long until a map with that is released. Maybe next week, or the week after that.
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.
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!