Basic Doors

Reference: Func_door

Doors can get quite complicated, but the basic door is pretty simple. In later tutorials we'll combine them with other entities to produce more complicated effects. Remember also that as far as the game engine is concerned, a func_door is just a brush with certain possibilities for controlling its movement; you can do all sorts of things with it in a map, with some imagination.

A door, any door, consists basically of two things; an `entity' that describes how the door behaves, and one or more brushes that are `grouped with', `owned by' or `tied to' the entity (different editors use different terminology), and provide its visible and touchable shape in the map. One entity can own lots of brushes (so a door can have a very complex shape, that of a grating, for example), but each brush can have only one owner.

Turning to the entity, this is made up of a number of `keys', often called `specifics' or sometimes `fields', which provide the actual information about how the entity behaves. Each key has a name (kind of information) and a value (the actual information provided). The one key that always appears is classname, whose value says what kind of entity it is. All map-editors will provide some kind of menu whereby the entities are listed by their names (classname-values), so you can do something like double-click on the name in order to insert the entity into the map, complete with its classname, and hopefully some other keys to fill in.

For a basic door, the entity you want is func_door (many but not all of the entities that are `active' and actually do something have names starting with `func_'), and there's only one additional key you need to produce a basic, functioning door. This is angle, and what it does is tell the door which way to move when it opens. The angle is specified in degrees counterclockwise from East (righwards on you screen). E.g., if the angle-value is 90, the door will move Northwards when opened). If you don't specify anything, zero will be filled in by default, and your door will move Eastward to open.

So now would be a good time to make a little map, consisting of a room with a func_door entity, with the entity's brush sitting in the middle of the room When you've made all this, start your map and walk up to your door. It ought to move in whatever direction you've specified in the angle-key, and then move back after about three seconds (unless you're standing in the way blocking it).

So now that you've got that working, there is one more thing to learn about the angle key, which is that you can also specify it as -1 to make the door open by going up (just the thing for a porticullis), and -2 to make it open by going down (a bit odd for a door, but but remember that a door can also be used as an elevator or crushing ceiling). So you should try both of these out now.

There are quite a number of additional keys you can add to the basic door. Two that you should try right now are wait, how long (in seconds) the door stays open before closing (with a value of -1 meaning it stays open), and sounds, the noise it makes. The sounds values are, numbers, coding different noises, which your editor ought to make it reasonably easy to find and specify. They are also listed on the func_door reference.

There's quite a number of additional keys listed in the HereticEd manual and the reference (which is based on the manual and mostly identical to it), which you should try experimenting with. For example if a door has an angle-value of -1 (down) or -2 (up), it will move the distance of its height-key. Thus a door can function as an elevator-platform. Or if it has a health-value, it is opened by being hit until it's got no health left. In addition to keys, entities also have spawnflags. spawnflags is a special key whose bit-positions, the `flags', are interpreted as yes/no indications for various properties. For example if the motion of an ordinary door is blocked, it will do a bit of damage, as determined by the dmg key, but if the CRUSHER spawnflag (2) is checked, the door will keep pressing & destroy or kill an obstructor rather promptly. Another simple door spawnflag is NO_MONSTER, if this one is set, monsters can't open the door.

That's it for simple doors, in later tutorials we'll consider opening doors by triggering and with buttons, and rotating doors.


Return to the Tutorials.