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
Getting a door to open using scripts
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#7
RE: Getting a door to open using scripts

The syntax was incorrect. This should work:

void OnStart()

{

AddEntityCollideCallback("Player", "area_opendoor1", "opendoor1", true, 1);

}

void opendoor1(string &in asParent, string &in asChild, int alState)

{

SetSwingDoorDisableAutoClose("1_mansion", true);

SetSwingDoorClosed("1_mansion", false, false);

for (int i = 0; i < 10; i++)

{

AddTimer("1_mansion", i * 0.1, "OpenDoorSlightly");

}



}

void OpenDoorSlightly(string &in door_name)

{

AddPropForce(door_name, 1000, 1000, 1000, "world");

}


But, why you use force in every coordinate? Just put force in the X axis or in the Z axis and if it doesn't work, go trying.
this is a tutorial that you may like:

http://wiki.frictionalgames.com/hpl2/tut...hdoorsopen (opening doors with force)
http://wiki.frictionalgames.com/hpl2/tut...ipt/events (slam)

Also, why do you use a "for"?

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
09-21-2012, 04:55 PM
Find


Messages In This Thread
Getting a door to open using scripts - by go.go - 09-21-2012, 02:54 PM
RE: Getting a door to open using scripts - by The chaser - 09-21-2012, 04:55 PM



Users browsing this thread: 2 Guest(s)