Frictional Games Forum (read-only)
Event Sound - Trigger Area Script [HELP !] - 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 - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Event Sound - Trigger Area Script [HELP !] (/thread-23587.html)



Event Sound - Trigger Area Script [HELP !] - Plazmater - 10-13-2013

Well, all i want to do is activate little scary event sound (2-4 sec long) by passing through Area.

But my script for it doesn´t work , i hoped that it would work but no.

Here is my script:

void OnStart()
{
AddEntityCollideCallback("Player", "SoundTrigger1", "SoundCollide", true, 1);
}

void SoundCollide(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound)
{
PlaySoundAtEntity("Whisper1", "afx_spooky_stereo_whisper1", "Player", 1.0, false);
}


RE: Event Sound - Trigger Area Script [HELP !] - FlawlessHappiness - 10-13-2013

You're using the wrong parameters for the Collide callback.

When it's a Collide callback it should be:
(string &in asParent, string &in asChild, int alState)

Maybe this helps: http://www.frictionalgames.com/forum/thread-18368.html

Smile

Also this should be in Development Support
http://www.frictionalgames.com/forum/forum-39.html
Just put it there next time you have trouble. Smile


RE: Event Sound - Trigger Area Script [HELP !] - Plazmater - 10-14-2013

(10-13-2013, 10:09 PM)FlawlessHair Wrote: You're using the wrong parameters for the Collide callback.

When it's a Collide callback it should be:
(string &in asParent, string &in asChild, int alState)

Maybe this helps: http://www.frictionalgames.com/forum/thread-18368.html

Smile

Also this should be in Development Support
http://www.frictionalgames.com/forum/forum-39.html
Just put it there next time you have trouble. Smile

Well could you repair my script completely ?

I dont understand it at all.

And sound file have extension .ogg


RE: Event Sound - Trigger Area Script [HELP !] - PutraenusAlivius - 10-14-2013

void OnStart()

{

AddEntityCollideCallback("Player", "SoundTrigger1", "SoundCollide", true, 1);

}



void SoundCollide(string &in asParent, string &in asChild, int alState)

{

PlaySoundAtEntity("Whisper1", "afx_spooky_stereo_whisper1", "Player", 1.0, false);

}

There's your script.