Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Some questions on scripting
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Some questions on scripting

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. Smile

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 meSmile

(This post was last modified: 10-22-2011, 01:23 AM by flamez3.)
10-21-2011, 04:34 PM
Find


Messages In This Thread
Some questions on scripting - by BlueFury - 10-21-2011, 04:21 PM
RE: Some questions on scripting - by flamez3 - 10-21-2011, 04:34 PM
RE: Some questions on scripting - by BlueFury - 10-21-2011, 04:59 PM
RE: Some questions on scripting - by flamez3 - 10-21-2011, 05:02 PM
RE: Some questions on scripting - by BlueFury - 10-21-2011, 06:21 PM
RE: Some questions on scripting - by flamez3 - 10-21-2011, 07:27 PM



Users browsing this thread: 1 Guest(s)