Frictional Games Forum (read-only)

Full Version: How to make a door open ajar?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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.
AddPropForce
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
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: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.
(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: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,
PHP Code:
void MakeDoorAJar()
{
     
SetEntityActive("door"false);
     
CreateEntityAtArea("A_Jar""Jar.ent""doorarea"true);

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");
}
(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)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 Wink
Pages: 1 2