Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Is it possible to stop a screen shake with a script?
serbusfish Offline
Member

Posts: 211
Threads: 75
Joined: Aug 2012
Reputation: 0
#1
Is it possible to stop a screen shake with a script?

I have a scenario where the screen is shaking and debris is falling, the player has to run to an elevator and ride it up, then the screen fades out and fades in once the elevator has stopped.

I want the screen shake to remain active until the screen fades out, as it is now the screen shake will end after so many seconds, but if a player decides not to get to the elevator in a prompt enough manner the shake will stop prematurely, but I see no command in the wiki to stop a screen shake?

08-04-2016, 06:12 PM
Find
Darkfire Offline
Senior Member

Posts: 371
Threads: 22
Joined: May 2014
Reputation: 15
#2
RE: Is it possible to stop a screen shake with a script?

Can't see such a command either. But you can always use looping timers!

Maybe do something like this: Set up a beginning shake with a fade in

StartScreenShake(float afAmount, float afTime, 3.0f, 0.0f);

and a timer that will loop. In the looping timer function put another screenshake, but this time instead of fading in and out have it start and stop abruptly, smth like this:
StartScreenShake(float afAmount, float afTime, 0.0f, 0.0f);

Then stop the looping timer when it is needed and perhaps add a last screenshake that will end with a fade.
StartScreenShake(float afAmount, float afTime, 0.0f, 3.0f);

I have no idea if this would look ok, but it's worth giving a shot.

08-04-2016, 06:32 PM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#3
RE: Is it possible to stop a screen shake with a script?

Setting StartScreenShake( to zero doesn't stop it?

08-04-2016, 09:54 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Is it possible to stop a screen shake with a script?

The parameters of StartScreenShake only include intensity, fade in/out time, and total duration. If you're referring to setting the intensity to 0, I'm not sure if that will override an already playing effect. I guess it's worth a shot though. Personally I always used looping timers.

(This post was last modified: 08-04-2016, 11:33 PM by Mudbill.)
08-04-2016, 11:32 PM
Find
serbusfish Offline
Member

Posts: 211
Threads: 75
Joined: Aug 2012
Reputation: 0
#5
RE: Is it possible to stop a screen shake with a script?

(08-04-2016, 06:32 PM)Darkfire Wrote: Can't see such a command either. But you can always use looping timers!

Maybe do something like this: Set up a beginning shake with a fade in

StartScreenShake(float afAmount, float afTime, 3.0f, 0.0f);

and a timer that will loop. In the looping timer function put another screenshake, but this time instead of fading in and out have it start and stop abruptly, smth like this:
StartScreenShake(float afAmount, float afTime, 0.0f, 0.0f);

Then stop the looping timer when it is needed and perhaps add a last screenshake that will end with a fade.
StartScreenShake(float afAmount, float afTime, 0.0f, 3.0f);

I have no idea if this would look ok, but it's worth giving a shot.

That is what I will have to try I think, I would think it'd work but i'll see Big Grin

08-15-2016, 02:09 PM
Find




Users browsing this thread: 3 Guest(s)