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
Script Help Amnesia how to make door open itself
Putkimato Offline
Junior Member

Posts: 25
Threads: 8
Joined: Jun 2012
Reputation: 0
#1
Amnesia how to make door open itself

Yeah, i wanna know how to make door open when i go near it. Not slowly, really fast like something would explode Big Grin!
06-13-2012, 01:14 PM
Find
GrAVit Offline
Senior Member

Posts: 580
Threads: 15
Joined: Oct 2011
Reputation: 22
#2
RE: Amnesia how to make door open itself

There are multiple ways of doing that, but probably the most convinient one would be to use the Area tool in the level editor. Place an area near the door where you would want the script to active, which would make the door open itself.
Then you need to add the script, first you need to add a callback function like this for example:
void OnStart()
{
AddEntityCollideCallback("Player","THEAREANAMEYOUCREATEDINLEVELEDITOR","YOURFUNCTIONNAME",true,1);
}
YOURFUNCTIONNAME is the function that will be called when you enter the area. You can name it whatever you want.
Then the function, this is an example, it works if the door is unlocked.
void YOURFUNCTIONNAME(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorDisableAutoClose("YOURDOORNAMEHERE", true);
AddPropForce("YOURDOORNAMEHERE",x,y,z,"world");
}
The x,y,z here means which way the propforce is coming from, which will force the door open. So you will replace x,y,z, with numbers, example: 0,0,-4000, You also need to add a considerable amount of propforce in order to open it, for example, 4000 or 5000. The negative amount here does not matter since it only describes which way the force is coming from. I hope this helped.
You may also add a sound effect when the door slams, and a particle effect as well.

(This post was last modified: 06-13-2012, 01:43 PM by GrAVit.)
06-13-2012, 01:39 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#3
RE: Amnesia how to make door open itself

SetSwingDoorDisableAutoClose("DOORNAME", true);

and

AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);

http://wiki.frictionalgames.com/hpl2/amn...ions#props

"What you think is irrelevant" - A character of our time

A Christmas Hunt
06-13-2012, 01:41 PM
Find




Users browsing this thread: 1 Guest(s)