Frictional Games Forum (read-only)
Sound Question - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Sound Question (/thread-6231.html)



Sound Question - Devil Dogs SF - 01-16-2011

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.


RE: Sound Question - Andross - 01-16-2011

You need a collision callback:

Code:
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);
}