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
johnbanana Offline
Junior Member

Posts: 9
Threads: 4
Joined: Oct 2011
Reputation: 0
#3
RE: HPL2 sound and add entitles, on area. //script need help

(10-20-2011, 06:47 PM)Obliviator27 Wrote: 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);
}
have alredy try the second one.
and it work! thanks alot. still its silly that i didnt mange to get none of these simple scripts to work...
(when im work on it alone)
i wonder where did i go wrong. :/

10-20-2011, 07:03 PM
Find


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



Users browsing this thread: 1 Guest(s)