Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sound Question
Author Message
Devil Dogs SF Offline
Junior Member

Posts: 4
Joined: Jan 2011
Reputation: 0
Post: #1
Sound Question
I am trying to set this sound up where when the player crosses a script area (ScriptArea_2) a sound plays. I'm rather sure I've gotten the script for sound correct:

Quote:PlaySoundAtEntity("running", "step_run_wood.snt", "PosNodeArea_1", 1.0f, false);

But I am clueless as to how I run that once the player enters the script area.
(This post was last modified: 01-16-2011 04:16 AM by Devil Dogs SF.)
01-16-2011 04:15 AM
Find all posts by this user Quote this message in a reply
Andross Offline
Junior Member

Posts: 38
Joined: Oct 2010
Reputation: 0
Post: #2
RE: Sound Question
You need a collision callback:

void OnStart()
{
    AddEntityCollideCallback("Player", "ScriptArea_2", "OnEnterArea2", true, 1);
}

void OnEnterArea2(string &in asParent, string &in asChild, int alState)
{
    PlaySoundAtEntity("running", "step_run_wood.snt", "PosNodeArea_1", 1.0f, false);
}
01-16-2011 04:45 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)