serbusfish
Member
Posts: 211
Threads: 75
Joined: Aug 2012
Reputation:
0
|
How to make a door open ajar?
Ive got a setup where a lever opens a locked door, however I want to make the door open slightly ajar once the lever is pulled so the player can see what the lever in question has done (the lever is in a different room). I tried using 'SetMoveObjectState' but it doesnt work, I have used a script to unlock the door which works, its just moving it im having trouble with.
|
|
02-13-2013, 03:42 AM |
|
MulleDK19
Senior Member
Posts: 545
Threads: 21
Joined: Jun 2009
Reputation:
10
|
RE: How to make a door open ajar?
AddPropForce
|
|
02-13-2013, 03:43 AM |
|
Adrianis
Senior Member
Posts: 620
Threads: 6
Joined: Feb 2012
Reputation:
27
|
RE: How to make a door open ajar?
You'll need to use SetSwingDoorDisableAutoClose and SetSwingDoorClosed in addition to AddPropForce.
Check out this tutorial
http://wiki.frictionalgames.com/hpl2/tut...hdoorsopen
Thats pushing the door open a lot, but its the same principal - you just need to use a lot less force
|
|
02-13-2013, 11:19 AM |
|
Kreekakon
Pick a god and pray!
Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation:
124
|
RE: How to make a door open ajar?
Rip the door off its hinges, and whack it against the jar.
In all seriousness though, pay attention to the other guys in this thread.
|
|
02-13-2013, 11:27 AM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: How to make a door open ajar?
(02-13-2013, 11:19 AM)Adrianis Wrote: You'll need to use SetSwingDoorDisableAutoClose and SetSwingDoorClosed in addition to AddPropForce.
Instead of doing this, you can just set the open amount to 0.1 or maybe even smaller.
Trying is the first step to success.
|
|
02-13-2013, 11:50 AM |
|
Kreekakon
Pick a god and pray!
Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation:
124
|
RE: How to make a door open ajar?
(02-13-2013, 11:50 AM)BeeKayK Wrote: Instead of doing this, you can just set the open amount to 0.1 or maybe even smaller.
Won't really work for this guy's case as the door will open after the level has already begun.
|
|
02-13-2013, 11:56 AM |
|
Adrianis
Senior Member
Posts: 620
Threads: 6
Joined: Feb 2012
Reputation:
27
|
RE: How to make a door open ajar?
(02-13-2013, 11:50 AM)BeeKayK Wrote: (02-13-2013, 11:19 AM)Adrianis Wrote: You'll need to use SetSwingDoorDisableAutoClose and SetSwingDoorClosed in addition to AddPropForce.
Instead of doing this, you can just set the open amount to 0.1 or maybe even smaller.
.... uhh yeh, do that! Although if the value is too small it may just auto-close again.
Alternatively,
void MakeDoorAJar() { SetEntityActive("door", false); CreateEntityAtArea("A_Jar", "Jar.ent", "doorarea", true); }
|
|
02-13-2013, 12:03 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: How to make a door open ajar?
Oh i used a script like this once.
What happened in the script was basically a timer that kept pushing the door a little bit, a certain amount of time. Like this:
void TimerPushDoor(string &in asTimer)
{
if(GetLocalVarInt("PushDoorVar") == 10)
{
return;
}
AddLocalVarInt("PushDoorVar", 1);
AddPropImpulse("Door", 0, 0, 0.5f, "World");
AddTimer("TimerPushDoor", 0.2, "TimerPushDoor");
}
Trying is the first step to success.
|
|
02-13-2013, 12:41 PM |
|
NaxEla
Senior Member
Posts: 415
Threads: 5
Joined: Dec 2012
Reputation:
28
|
RE: How to make a door open ajar?
(02-13-2013, 12:41 PM)BeeKayK Wrote: Oh i used a script like this once.
What happened in the script was basically a timer that kept pushing the door a little bit, a certain amount of time. Like this:
void TimerPushDoor(string &in asTimer)
{
if(GetLocalVarInt("PushDoorVar") == 10)
{
return;
}
AddLocalVarInt("PushDoorVar", 1);
AddPropImpulse("Door", 0, 0, 0.5f, "World");
AddTimer("TimerPushDoor", 0.2, "TimerPushDoor");
}
This is what I've used, too. It's actually how Frictional Games does it in the first map of TDD.
|
|
02-13-2013, 05:02 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: How to make a door open ajar?
(02-13-2013, 05:02 PM)NaxEla Wrote: (02-13-2013, 12:41 PM)BeeKayK Wrote: Oh i used a script like this once.
What happened in the script was basically a timer that kept pushing the door a little bit, a certain amount of time. Like this:
void TimerPushDoor(string &in asTimer)
{
if(GetLocalVarInt("PushDoorVar") == 10)
{
return;
}
AddLocalVarInt("PushDoorVar", 1);
AddPropImpulse("Door", 0, 0, 0.5f, "World");
AddTimer("TimerPushDoor", 0.2, "TimerPushDoor");
}
This is what I've used, too. It's actually how Frictional Games does it in the first map of TDD.
Exactly
Trying is the first step to success.
|
|
02-13-2013, 05:16 PM |
|
|