Jump Scares:
Door:
void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "doorclose" , true , 1);
}
void doorclose(string &in asParent, string &in asChild, int alState)
{
AddPropForce("door1", 0, 0, 0, "world");
}
That should work, when your adding a prop force, the first 0 stands for X, next 0 stand for Y, next 0 stands for Z. go into your level editor and check which way you want your door to open. (also, in the door entity settings tab, make sure that the door is open a little bit, like 0.1) <----------Actually, i checked and it didn't work for me, sorry :/
Monster sounds:
void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_2" , "MonsterSound" , true , 1);
}
void MonsterSound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "the monster of your choice's sound", "Player", 0, false);
}
Bodies/objects flying at you
void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_3" , "BodyThrow" , true , 1);
}
void BodyThrow(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse_male_1", true);
AddPropImpulse("corpse_male_1", 0, 0, 0, "world");
}
Same deal as the door when it comes to the 0's, and I've added the SetEntityActive so that it doesn't stay there until you collide with the scriptarea. Make sure the guy is inactive.
Sanity Effects:
To the best of my knowledge:
void OnStart()
{
SetEntityPlayerLookAtCallback("internal name", "ScriptArea_4, bool abRemoveWhenLookedAt);
}
void InsanityScare(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(70);
}
Note: Don't add too much sanity as it can crash people's computers.
Monster coming towards you and dissapearing:
No script involved really, just go to the enemy in the editor, then once that is done; go to his Entity tab, and check "Hallucination"
Change your spawn location:
For this is pretty hard.
You need to add checkpoints for this, I have never done it personally so I got this from the script functions page:
void CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);Sets a checkpoint at which the player will respawn in case he dies.Callback syntax: void MyFunc(string &in asName, int alCount) Count is 0 on the first checkpoint load!
asName - the internal nameasStartPos - the name of the StartPos in the editorasCallback - the function to call when the player dies/respawnsasDeathHintCat - the category of the death hint message to be used in the .lang fileasDeathHintEntry - the entry in the .lang file
You're not stupid, you need experience before you can get into these things and do it without thought.
All this was found in the
http://wiki.frictionalgames.com/hpl2/amn..._functions page. Sorry I didn't go all out and explain what they all do. It's very late XD. If you need any more help just reply or PM me