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 How to make a door open ajar?
serbusfish Offline
Member

Posts: 211
Threads: 75
Joined: Aug 2012
Reputation: 0
#1
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
Find
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#2
RE: How to make a door open ajar?

AddPropForce

[Image: 16455.png]
02-13-2013, 03:43 AM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#3
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
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#4
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.

[Image: Tv0YgQb.gif]
Image by BandyGrass
02-13-2013, 11:27 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
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
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#6
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.

[Image: Tv0YgQb.gif]
Image by BandyGrass
02-13-2013, 11:56 AM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#7
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,
PHP Code: (Select All)
void MakeDoorAJar()
{
     
SetEntityActive("door"false);
     
CreateEntityAtArea("A_Jar""Jar.ent""doorarea"true);


02-13-2013, 12:03 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#8
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
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#9
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.

In Ruins [WIP]
02-13-2013, 05:02 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#10
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 Wink

Trying is the first step to success.
02-13-2013, 05:16 PM
Find




Users browsing this thread: 3 Guest(s)