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
Sound Question
Devil Dogs SF Offline
Junior Member

Posts: 4
Threads: 2
Joined: Jan 2011
Reputation: 0
#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
Andross Offline
Junior Member

Posts: 38
Threads: 1
Joined: Oct 2010
Reputation: 0
#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




Users browsing this thread: 2 Guest(s)