Plazmater
Member
Posts: 122
Threads: 24
Joined: Aug 2013
Reputation:
1
|
Event Sound - Trigger Area Script [HELP !]
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);
}
|
|
10-13-2013, 08:30 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
|
10-13-2013, 10:09 PM |
|
Plazmater
Member
Posts: 122
Threads: 24
Joined: Aug 2013
Reputation:
1
|
RE: Event Sound - Trigger Area Script [HELP !]
(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
Also this should be in Development Support
http://www.frictionalgames.com/forum/forum-39.html
Just put it there next time you have trouble.
Well could you repair my script completely ?
I dont understand it at all.
And sound file have extension .ogg
|
|
10-14-2013, 03:35 PM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: Event Sound - Trigger Area Script [HELP !]
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.
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
10-14-2013, 03:55 PM |
|
|