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
delay in scares
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#3
RE: delay in scares

This is what I do, It is probably the easiest way to do this, because you don't have to create a unique function for each react sound.

Stick this bit of code at the bottom of your .hps file
PHP Code: (Select All)
// Player React Function
void React(string &in asTimer){
    
PlayGuiSound("react_"+asTimer+".snt" 1.0f);


This function can be called at any part of your script with "AddTimer("scare" , 0.5f , "React");"
"scare" can be any of the react sounds, such as "breath" "breath_slow" "sigh" etc. I'll give a complete example below:

PHP Code: (Select All)
void Collide(string &in asParent string &in asChilc int alState// Player Hits area
{
   
// Scary stuff happens
   
AddTimer("scare" 0.4f "React"); // Player is scared
   
AddTimer("breath" 1.0f "React"); // Player takes a deep breath
}


// Player React Function
void React(string &in asTimer){
    
PlayGuiSound("react_"+asTimer+".snt" 1.0f);


(This post was last modified: 04-20-2012, 07:19 PM by DRedshot.)
04-20-2012, 07:16 PM
Find


Messages In This Thread
delay in scares - by lllDash - 04-20-2012, 07:04 PM
RE: delay in scares - by Datguy5 - 04-20-2012, 07:14 PM
RE: delay in scares - by DRedshot - 04-20-2012, 07:16 PM
RE: delay in scares - by lllDash - 04-20-2012, 08:00 PM
RE: delay in scares - by lllDash - 04-24-2012, 03:45 PM
RE: delay in scares - by Prelauncher - 04-24-2012, 07:06 PM
RE: delay in scares - by lllDash - 04-25-2012, 06:56 PM
RE: delay in scares - by lllDash - 04-29-2012, 03:01 PM



Users browsing this thread: 1 Guest(s)