Tutorial: Doors Last edited 23 years ago2000-11-22 05:00:00 UTC

You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date. Click here to see the current revision of this page.

This article was converted from a previous version of TWHL and may need to be reviewed

  1. The formatting may be incorrect due to differences in the WikiCode processing engine, it needs to be revised and reformatted
  2. Some information may be out of date
  3. After the article is re-formatted and updated, remove this notice and the Review Required category.
  4. Some older tutorials are no longer useful, or they duplicate information from other tutorials and entity guides. In this case, delete the page after merging any relevant information into other pages. Contact an admin to delete a page.

Download attachment

Doors have been around since the days of Wolfenstein 3D. I mean, they're great things. There are two basic types you can create in WorldCraft, using two different entities. I will go over both in this tutorial.

The First Door Brush, the Sliding door

Firstly, the door on the left in the map (the metal one), is a func_door. To create the brush, simply find the texture that you want and size it. You might want to align the texture as well. There are a few frame textures that you can use as borders to your doors (as I have here). Create the frame first, then place the door inside it. Make the door slightly narrower than the frame, so that it looks more realistic. A good thing to do as well is to carve a bit out of the frame on the side that the door is going to slide, and then stretching the door brush a little less than that into the gap. This prevents that ugly mix of textures that can result from two brushes merging on the same line when the door opens.

Making it Work

You then need to attach the door brush to an entity - choose func_door. There are several attributes that you might want to set. Most importantly is the direction - use the little compass in the top-right to point the movement in the right direction. This will move the door in that direction on the Z axis (moving along the top view). You might want to assign a sound to the door's movement and stopping - you can try these out until you find one you like. Don't worry about the locked and unlocked sounds for this door. Speed can be changed if you want, and delay before close can be set to stays open. In flags, Use only and toggle are useful
ones to set. Use only allows you to open the door only by going up to it and hitting your use key. Toggle allows the door to be opened and closed, instead of just staying open (or automatically shutting after the delay before close time). That's all you'll need for this door. It should now slide open into the wall when you press your use key near it.

Origin brush & Getting the door to swing open

Now for the second door. This one uses a func_door_rotating and is slightly more complicated. Create the brush as before, perhaps making this one narrower, because the door rotates open (like the sort of door you have in your house), and can look very bulky if it's too thick. This time you will need to attach an origin brush to the axis of the door. The origin brush is just a normal brush using 'origin' as its texture (a green picture of someone's face). The game looks for the centre of this brush, and treats it as the axis for rotation, so for this door, place it on the edge.

Setting up Rotation

Group the origin brush with the door brush (Ctrl-G) and then make them into a func_door_rotating entity. To do this click on the door so it is highlighted press Ctrl and click on the Origin Brush. Now use the Tie to Entity button to assign the group to a func_door_rotating. The attributes for this entity are similar to the other door. The direction doesn't count though. There are also two other attributes - Distance and Pitch, yaw, roll. Distance is the number of degrees that the door rotates through. 90? is fine. Ignore the second attribute - it's for creating more advanced rotations that aren't much use for a normal door. Flags are also similar, added ones are the reverse direction (pretty obvious), one way (door can only swing one direction), and X, Y axis options. The axis options can be confusing. You need to give an axis that the door rotates around the origin brush in. The default is Z, which is top-view movement (what we are using). To work out what axis you want, take the name of the view window you want it to make a visible movement in, and the axis is the letter not in the name (i.e. If you are looking at the XZ view, then the axis is Y). It can be hard to visualize the available axes at first.

Buttons

I've made this door slightly different to the first one, in that this one won't open unless you press the button to the left (not shown in the picture because I added it later). To create a button-triggered door, give the door a name value, and make sure the door is not use only, because that prevents triggering. Then assign a locked sound if you want. Unlocked sound isn't neccessary if you assign a sound to the button. Create the button brush however you want, with whatever textures, and then tie it to the func_button entity. Give the button a sound if you want and make the target attribute the name of your door. The button's delay before reset is quite important. If you make it 0, then the button stays active until you press it again. If you choose stays pressed then you aren't able to reset the button. Anything in between is the number of seconds until the button returns to 'off' position. In flags, set toggle on so that the button's texture turns 'on' and 'off', and turn do not move on as well, so that the brush doesn't move (that's for plunger-type buttons etc.)

Final Word

Anyway, you should now find that the door opens and closes only when you press the button, and that when you attempt to open it by walking up to it, you get a locked sound. In the map I've provided, the delay before close is also set, and because there is no button on the other side of the wall, this is an effective way to trap players (not that you'd ever want to do that). Doors can also be used as elevators - just set the direction in the normal func_door to up (from the drop-down menu) and create some kind of pole so that it moves the desired distance. Doors aren't supposed to be used as elevators, and you'll probably run into problems if you try, but I'm just saying that you can. The rotating door entity can also create the kind of doors that you find at large shops and airports - the ones with the central axis and the wings that turn around.
A completed set of doors, each with the respective opening functionsA completed set of doors, each with the respective opening functions

5 Comments

Commented 15 years ago2009-02-10 09:51:18 UTC Comment #100477
Had trouble figuring out the sliding door - tried all the wrong things. Finding and opening this file I now can make sliding doors with absolutely no problem 5*!
Commented 8 years ago2015-11-29 11:19:42 UTC Comment #100479
Where do I put the origin brush? There's no image on where to put it.
Commented 7 years ago2016-05-27 09:09:42 UTC Comment #100480
when i put the origin brush, the map is having bugs when i load it in game, how do i fix it?
Commented 3 years ago2021-03-05 15:39:12 UTC Comment #103372
I would be screwed without this tutorial tbh
Commented 1 year ago2022-09-26 07:11:57 UTC Comment #104802
For peoples which having problem with the "origin" brush: This brush have to be tied to your door as entity (func_door or func_door_rotating).

About the place to put it, the door will slide / rotate around it, usually I put it somewhere inside the door according to my needs. Just try it :).

You must log in to post a comment. You can login or register a new account.