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
Event Sound - Trigger Area Script [HELP !]
Plazmater Offline
Member

Posts: 122
Threads: 24
Joined: Aug 2013
Reputation: 1
#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
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Event Sound - Trigger Area Script [HELP !]

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

Trying is the first step to success.
(This post was last modified: 10-13-2013, 10:09 PM by FlawlessHappiness.)
10-13-2013, 10:09 PM
Find
Plazmater Offline
Member

Posts: 122
Threads: 24
Joined: Aug 2013
Reputation: 1
#3
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

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
10-14-2013, 03:35 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#4
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
Find




Users browsing this thread: 2 Guest(s)