User login

Navigation

Poll

I downloaded the ETQW demo and....
...I'm too busy playing for polls.
14%
...it's awesome.
43%
...it's okay, I expected better.
14%
...I'm lost in the valley, anyone have a map?
0%
...my machine won't run it. :-(
29%
Total votes: 7

Who's online

There are currently 0 users and 33 guests online.

Welcome to RUST | Gamedesign.net

Doors in HL2: The prop_door_rotating Entity

Submitted by yesukai on Sun, 2005-03-27 04:23.

dev_doorBelieve it or not, most doors in HL2 are not func_door or even func_door_rotating. They came up with a better way to do the common door, and that is the prop_door_rotating. This is a much more versatile entity then a func_door_rotating, as it provides better physics and generally just acts more like a door.

In order to make our door, we first need to make our doorway. To do this, we are going to use the /dev/dev_measuredoor01 texture. This texture, when properly scaled to .25 for X and Y, shows use the size of a door, and even where the knob will be. Go ahead and make a bush where you want your doorway, 128 units tall and 64 units wide. Fit the texture if you have to, and have a look. The gray area is where you should build the walls around the door, the orange area is what you leave open.

Now for the door. Using the Entity Tool (Shift-E), place a prop_door_rotating in the doorway. The model to use for doors is models/props_c17/door01_left.mdl. This model is great for doors, its standard size, and has many, many skins (more on that later). After you have the door model in, hit apply. Now you have to position the door in the door way, by rotating and moving it. A little tip: hold down Shift while you rotate if you want the door to rotate in 15 unit increments, which helps keep the door flush with the walls around it.

After you have your door in place, there are all sorts of keyvalues to play with. Some of the important ones are:

  • World Model: The model you are using for the door. Most of the time, you will be using models/props_c17/door01_left.mdl.
  • Skin: Changes the appearance of the door. Takes a number from 0-13, giving you 14 different doors to choose from.
  • Ajar Angles: Lets you have the door start partway open. Uses Pitch Yaw Roll (YZX), for most doors, you only want to change the middle number, Yaw (Z).
  • Spawn Position: Paired with the above, lets you choose closed, open forward, open backward, and ajar. The ajar value uses the angle you entered in "ajar angles".
  • Hinge Axis: tells the door what invisible line to turn on. Takes a value of two YZX numbers. You can either use the Hammer "helper", the purple ball, to define this by dragging it upward, or you can just make the third number of the second YZX triplicate larger then the third number of the first YZX triplicate. Either way, the end result is that the doors rotates around where its hinges would be.
  • Rotation Distance: How for the door should swing either way. Default is 90, which means the door can open 90 degrees to the back, or 90 degrees to the front.
  • Speed: how fast the door swings. Higher number means a more well oiled door, while lower numbers make for rusty hinges. :)
  • Fully Open Sound: The sound you want to play when the door opens all the way. Like a "clang" or something.
  • Fully Closed Sound: Same as above, but for closed. Perhaps a nice "slam" sound.
  • Moving Sound: Here is where you can make the door squeak.
  • Delay Before Close: How long before the door closes itself. If you are scared of ghosts, set this to -1, that will keep the door open till Gordon decides to close it.
  • Damage Inflicted When Blocked: The amount of damage any creature unlucky enough to get his fingers caught in the door takes. Set from the low (jump around swearing) to the high (gets gibed). Just like when you were a kid, right?
  • Health: Leave at 0 for invincible doors. Give it a value to be able to bust the door in S.W.A.T. style.
  • Locked Sound: Sound to play if you try to open a locked door (see the flags). Something like a rattle sound or "access denied".
  • Unlock Sound: Sound to play if the door isn't locked, like a door handle sound.
  • Force Closed: Nothing will stop the door from closing. Similar to setting the "damage when blocked" to 4000, but not as messy.

And then there are the oh-so-important flags:

  • Starts Open: No brainier here.
  • Starts Locked: The door will not open. It will play the Locked Sound if one is defined. To unlock the door, have an IO send to the "Unlock" input of the door.
  • Door Silent: Another no brainier.
  • Use Closes: When you +use the door, it closes. Assuming its open.
  • Door Silent to NPCs: You can here the door, and so can they. Check this to make them oblivious to the sound of an opening door, as most minions are.
  • Ignore Player +USE: When poor little Gordon comes up to use the door, ignore him!

That about wraps up the prop_door_rotating. At the bottom of the document I have a image of the different skins you can use and the corresponding number to enter into "skin". As usual, if you have any questions or comments regarding this article, post here or email me at jeffca51 at yahoo dot com.

Door skins and thier number to use for the skin atribute:

doors

RUST | Gamedesign.net is your source for all the latest game-editing news and tutorials. If you are seeing this message, this means that you are using a browser that does not support CSS. Please upgrade your browser and enjoy your stay at RUST and if you have any questions, comments, or suggestions, please contact a site administrator.