Check out Half-Life Re-imagined competition results!
Check out Skewing textures in Hammer, our newest tutorial!
Say hello to Jongmeister, our newest member!

Azure

21

Cobalt

37

Turquoise

11

Cyan

17

Royal

11

Teal

3

30 secs

potatis_invalid

2 mins

Penguinboy

7 mins

UrbaNebula

12 mins

Strider

13 mins

rufee

15 mins

ciba43

21 mins

Dr. Orange

# Perfect Timing with Doors

Page: 1 [2]

## Tutorials > Half-Life > Intermediate > Perfect Timing with Doors

By Instant Mix (More from this user)
28th December, 2011
Intermediate
distance , speed , doors , trains

# Perfect Timing with Doors - Page 2

### Example

In this example I've created an "odd door" , that being that the whole door compromises of two separate doors with different lengths.

Sweet and simple.

The geometry is as shown :

The dominant door , blue , and recessive , red , as shown.

Now as the lengths of the top section and bottom section are different , when both doors open , the bottom door will close before the top door closes. Unless you have a complex entity setup with the doors set to toggle , they won't open and close at the same time ( or arrive at the same time , for that matter ).

This is shown at the bottom right corner of the Hammer editor ; it displays the dimensions of the selected object.

From the editor , we can see that our first door is 96 units high. To complicate this further , we have set the lip of this door to 16.
The bottom door is 48 units high , with no lip.
NOTE : It isn't always the height used , It's only because this doors moves vertically. The distance measured is relative to the direction.

We want our chunky door to take a nice 2 seconds to open up , so here we input these values into our two equations
BLUE DOOR
D = 96
LIP = 16
T = 2
S = (D-LIP)/T
S = (96-16)/2
S = 80/2
S = 40

RED DOOR
D = 48
LIP = 0
T = 2
S = (D-LIP)/T
S = 48/2
S = 24

When I plug in 40 as the speed of the blue door , and 24 as the speed of the red door , the two will now open and shut at the exact same time. Piece of cake!

Daubster says: 28th December 2011, 14:51 PM
I like how you've included a detailed example on how it all works, good stuff!
DiscoStu says: 28th December 2011, 22:56 PM
Nice. Simple and to the point. Didn't learn anything new, though :P
Tetsu0 says: 28th December 2011, 23:52 PM
Horray for math!
Nice Tut - Simple, easy to follow.
I used to not care about door timings, but now that i dont have to think for myself, i'm gonna apply it :)
Captain Terror says: 29th December 2011, 02:45 AM
this is really well done, and way faster than trial and error trying to match up the door speeds! Great work sir!
SpaG says: 31st December 2011, 08:50 AM
Now the only problem that remains, is calculating door height relative to the direction it will move, when doors move on a plane, or two axis (say, diagonally). Add more complex door shapes and you're better off guessing the timing :-D
Anyway, god work.
Instant Mix says: 8th January 2012, 14:25 PM
I was going to add that in Spag but then I thought nobody would need it. Now that you've brought it up , I might just.
Stojke says: 22nd February 2012, 21:50 PM
Awesome! Really nice tutorial, 5 stars mate.
ciba43 says: 17th May 2013, 20:59 PM
Greatd tutorial :D
BshiftCalhoun says: 26th May 2016, 23:24 PM
a more simplier way is putting a trigger_multiple next to the doors and make them big enough so the player doesnt reach the doors before it start opening (thats if you dont want to block on the doors when youre running)
BshiftCalhoun says: 29th May 2016, 21:52 PM
nvm what i just said it has nothing to do with the tutorial my bad
You must be logged in to comment.