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
HPL2 sound and add entitles, on area. //script need help
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: HPL2 sound and add entitles, on area. //script need help

Use the area tool in the level editor, and make an area in your map. Make sure it's a script area (not slime, liquid, insanity, etc)
Then, in your OnStart function add AddEntityCollideCallback (parameters and such can be found on the wiki)
then create another function that has PlaySoundAtEntity in it (again, parameters in the wiki)

For the second one, create another AddEntityCollideCallback in your OnStart function
Then, in another function, have SetEntityActive (parameters in the wiki) For this to work right, you have to place the entity in the map, and uncheck the "active" box.

Script Examples
void OnStart()
{
       AddEntityCollideCallback("Player", "NoiseArea", "PlayNoise, true, 1);
}
void PlayNoise(string &in asParent, string &in asChild, int alState)
{
       PlaySoundAtEntity("", "00_laugh.snt", "Player", false, 0);
}
void OnStart()
{
       AddEntityCollideCallback("Player", "ScareArea", "PopUp", true, 1);
}
void PopUp(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("corpse_1", true);
}

10-20-2011, 06:47 PM
Find


Messages In This Thread
RE: HPL2 sound and add entitles, on area. //script need help - by Obliviator27 - 10-20-2011, 06:47 PM



Users browsing this thread: 1 Guest(s)