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
Need help with script
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#1
Question  Need help with script

Hey everyone.

Can someone explain me, how to make the game play the sound, when player walks into area?

Thanks.

btw - sorry for my bad eng.
12-27-2012, 04:59 PM
Find
Traggey Offline
is mildly amused

Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation: 185
#2
RE: Need help with script

Moved to development support.
12-27-2012, 05:24 PM
Find
CptLogicDev Offline
Junior Member

Posts: 24
Threads: 10
Joined: Dec 2012
Reputation: 0
#3
RE: Need help with script

(12-27-2012, 04:59 PM)lazz3r Wrote: Hey everyone.

Can someone explain me, how to make the game play the sound, when player walks into area?

Thanks.

btw - sorry for my bad eng.

PlaySoundAtEntity("", "sound file with snt", "what entity the sound plays on", i use 1 often, save the sound true or false);

:)
12-27-2012, 06:58 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#4
RE: Need help with script

In addition to what CptLogicDev said, since you want the sound to play when the player enters an area...

You need AddEntityCollideCallback in OnStart, like this

void OnStart()
{
AddEntityCollideCallback("Player", "YOUR AREA NAME HERE", "PlaySound", true, 1);
}

void PlaySound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "sound file with snt", "what entity the sound plays on", i use 1 often, save the sound true or false);
}

It's all in here... http://wiki.frictionalgames.com/hpl2/amn..._functions
12-28-2012, 01:52 PM
Find
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#5
RE: Need help with script

Thanks for help.
12-29-2012, 11:17 PM
Find




Users browsing this thread: 2 Guest(s)