Frictional Games Forum (read-only)

Full Version: Event Sound - Trigger Area Script [HELP !]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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);
}
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
(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
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.