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 Creating a distant sound
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#5
RE: Creating a distant sound

//The sound will be called when you enter the area "Area_Sound". I will have it play the sound and set a Timer that calls back onto itself every 4 seconds.
void OnStart()
{
  AddEntityCollideCallback("Player", "Area_Sound", "Script_Sound", true, 1);
}

//This is the callback
void Script_Sound(string &in asParent, string &in asChild, int alState)
{
  PlaySoundAtEntity("Sound_Grunt01", "amb_alert.snt", "Area_Sound01", 0, false);

  AddTimer("Sound01", 4, "Script_Sound");
}

//This part will be called when the player interacts with your "Door". I'm assuming you know how to have a callback function work on a Entity. (On the Door's properties)
void DoorTouch(string &in entity, string &in type)
{
  RemoveTimer("Sound01");
  StopSound("Sound_Grunt01", 1);
}

Does anyone else have problems with the frictional forums text editor... I'm spending more time trying to fix up all the text it screwes up, as opposed to helping someone.
05-19-2012, 06:10 PM
Find


Messages In This Thread
Creating a distant sound - by bagobonez - 05-19-2012, 04:33 PM
RE: Creating a distant sound - by SilentStriker - 05-19-2012, 04:35 PM
RE: Creating a distant sound - by Rapture - 05-19-2012, 04:36 PM
RE: Creating a distant sound - by bagobonez - 05-19-2012, 04:48 PM
RE: Creating a distant sound - by Rapture - 05-19-2012, 06:10 PM
RE: Creating a distant sound - by bagobonez - 05-19-2012, 08:26 PM
RE: Creating a distant sound - by bagobonez - 05-19-2012, 11:28 PM
RE: Creating a distant sound - by Rapture - 05-20-2012, 12:01 AM



Users browsing this thread: 2 Guest(s)