12-27-2012, 04:59 PM
12-27-2012, 05:24 PM
Moved to development support.
12-27-2012, 06:58 PM
(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.
Code:
PlaySoundAtEntity("", "sound file with snt", "what entity the sound plays on", i use 1 often, save the sound true or false);
:)
12-28-2012, 01:52 PM
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
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-29-2012, 11:17 PM
Thanks for help.