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
Random Events
Dalroc Offline
Member

Posts: 57
Threads: 2
Joined: Mar 2011
Reputation: 0
#2
RE: Random Events

Some more specific info would be nice..
But to make a random screen shake at random intervals you could do something like this

PHP Code: (Select All)
void funcName(string &in asTimer)
{
    
int shakeTime = RandInt(60, 90);
    
int shake = RandInt(0, 9);
    if(
shake == 0)
    {
        
StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime); //decided too give no example values here as I have never tried it :P
    
}
    
AddTimer ("", shakeTime, "funcName");
} 

This would make it so there's a 10 percent chance every 60-90 seconds that there will be a screen shake. Just make sure you call "funcName" in the OnStart as well.
You can use whatever values you want though.
04-28-2011, 10:09 PM
Find


Messages In This Thread
Random Events - by Henriksen - 04-28-2011, 09:41 PM
RE: Random Events - by Dalroc - 04-28-2011, 10:09 PM
RE: Random Events - by Henriksen - 04-28-2011, 10:11 PM



Users browsing this thread: 1 Guest(s)