Doors

Doors

Classname: func_door
Purpose: Access granted/denied.
H2 Code: doors.hc
Doors are pretty complicated. Many aspects of their motions can be controlled (direction, distance, speed, wait); they can require keys & puzzle-pieces, display various kinds of messages, and be remotely triggered by buttons, etc. Door-keys are puzzle-pieces.

If doors touch, they will be `linked' and open and close together (whether by touch or triggering), but otherwise behave as specified by their individual fields (w.r.t. messages, for example). Use REVERSE spawnflag for automatic 180-degree angle offset of movement.

In Siege, doors have some additional fields, which I don't actually list here, but describe the use of in the tutorial section on Siege doors.

Fields

angle Value is an angle (in degrees counterclockwise from East=0=default); door goes that way when activated. -1 for up, -2 for down.
wait Value is a number, amount of time before closing; 3 = default, -1 = never return. Doors requiring puzzle-pieces to open never return.
soundtype Value is a number, indicating a sound type.
speed Value is a number, opening and closing speed; 100 = default.
dmg Value is a number, damage inflicted when door movement is actually blocked, e.g. player is caught between door and a wall (different from rotating doors, which inflict damage when they merely move player).
abslight Value is a number between 0 and 1, specifying an amount of brightness that the door has regardless of the surrouding light-level. If your door looks too dark and shadowy, try using this (the H2 lighting model doesn't take into account ambient light reflected off surfaces, so things are sometimes implausibly dark).
lip Value is a number, the door moves its size in the direction of movement, minus this amount, 8=default.
level Value is a number, the distance door moves; default = size in direction of movement minus lip (seems redundant).
health Value is a mumber, if it's greater than 0, the default, the door opens when shot or bashed, the actual value doesn't matter. A door with a health-value won't open just from being approached. (Eutectic also says mass can activate a door with a health-value, I haven't gotten this to work).
message Value is a number, indicting the message to be displayed when the player touches a door with a targetname or health value that hasn't been opened yet (once it has opened, no more messages, even if it's shut again). A value of 267 produces the often suitable message `This door opens elsewhere'.

(QuArK users can instead use a string-valued #message-field).

targetname Value is a name, the target-value of the door's remote trigger. If this field is absent, the door will generate a (rather large) `trigger-field' that will cause it to open on approach. If it's present, no trigger-field will be created, and the door must be operated remotely, by for example a button or a trigger_once.
target Value is a name, the targetname-value of some entity that is triggered when the door opens.
close_target
(PoP)
Value is a name, the targetname-value of some entity that is triggered when the door closes.
puzzle_piece1..4 (4 fields). Value is the name of a puzzle piece (such as for example a key); these are listed here. Door won't open until player has all the required pieces. Puzzle-doors never reclose (wait is effectively -1).
no_puzzle_msg Value is a number, indicating the message to be displayed when player lacks required puzzle pieces. (QuArK users can instead use a string-valued #no_puzzle_msg field).
spawnflags Value is a number, sum up the ones below for the properties you want (hopefully your editor has a checkbox scheme or something to do the arithmetic for you):
  • 1 - START_OPEN causes the door to move to its destination when spawned, and operate in reverse. It is used to temporarily or permanently close off an area when triggered (not useful for touch or takedamage doors).
  • 2 - REVERSE: offsets door angle value by 180 degrees.
  • 4 - DOOR_DONT_LINK: normally, if two doors entities touch, they are assumed to be connected and operate as a unit. IOW, if they are used as triggered doors, only one of the two needs to be targeted. Setting this flag on each will override their default behavior.
  • 8 - TOGGLE: needs trigger for closing as well as opening.
  • 16 - SLIDE: function unknown.
  • 32 - NORMAL_MOVE: constant-rate movement rather than acceleration.
  • 64 - REMOVE_PP: for puzzle_door, puzzle pieces disappear on use.
  • 128 - NO_PP: door is blocked if player has puzzle-pieces (display of no_puzzle_msg's reversed).
So if we want the door to start open, and require a trigger to close it as well as to open it again, the spawnflags-value will be 9.

If you're using the right map editor, it will let you check properly labelled boxes for the different spawnflag components, and take care of the arithmetic for you (QuArK is one of the right editors, don't know about the other ones that support H2).


Back to the list.