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
How to script sounds
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#4
RE: How to script sounds

You really messed up your script. Try this, and then compare. Tongue

void OnStart()
{
     AddEntityCollideCallback("Player", "sound_area1", "SoundPlay", true, 1);
}
void SoundPlay(string &in asParent, string &in asChild, int alState)
{
     PlaySoundAtEntity("", "prisoner_scream.snt", "Player", 0, false);
}

The sound you want to play is "prisoner_scream.snt"? Change "Player", located in the PlaySoundAtEntity command function if you want to change the position in the editor from which the sound will play at.

You don't need to script the sound "object" that you place in the editor. It will play on the start of the level. If it isn't a repeating sound, then the player may not be able to hear it because the sound might have already ended before the player comes close enough to it.

(This post was last modified: 08-18-2011, 04:04 PM by Kyle.)
08-18-2011, 04:01 PM
Find


Messages In This Thread
How to script sounds - by Khan - 08-18-2011, 02:49 PM
RE: How to script sounds - by zeravia - 08-18-2011, 03:16 PM
RE: How to script sounds - by Khan - 08-18-2011, 03:43 PM
RE: How to script sounds - by zeravia - 08-18-2011, 04:02 PM
RE: How to script sounds - by Kyle - 08-18-2011, 04:07 PM
RE: How to script sounds - by Kyle - 08-18-2011, 04:01 PM



Users browsing this thread: 1 Guest(s)