This article's documentation is for anything that uses the Source engine. Click here for more information.

func_door_rotating

From Valve Developer Community
Jump to navigation Jump to search
English (en)Translate (Translate)
Class hierarchy
CRotDoor
CBaseDoor
CBaseToggle
CBaseEntity
doors.cpp
This article is about the brush entity. For the point entity, see prop_door_rotating.

func_door_rotating is a brush entity available in all Source Source games. It is a rotating brush that can be "opened" by players or NPCs.

Notes

Axis

A visual guide showing the axis in each viewport (Click to enlarge)

The func_door_rotating entity can only rotate around either the x, y or z axis and no combination of the two other than x and y. By default, the entity is set to rotate on the Z-axis and can be changed through altering the flags section of the object properties.

Tip.pngTip:The axis can be changed to a different one by changing the angles keyvalue to set the door to a preferred rotation (result is only visible in-game). This does not work inside instances.

Setting the Origin

The point of rotation can be changed through the alteration of the entities origin. The origin sets which point on the plane of movement the object will rotate through, think of it as a hinge for a door. With the show helpers option enabled in Hammer, the origin will appear as a small white circle in the center of the entity that can be dragged to a new location.

Example

Here in the 3D view we have a brush we selected, 1, that is tied to the func_door_rotating entity. We want it to rotate downward to land in position 2, bridging the gap between the two ledges. To do this we need to alter the door's origin to sit at point 3. Door rotate 1.jpg
First thing to do is to find the axis we want the brush to rotate on. A good way to do this is to look through the grid views and find the view which shows exactly where we want to place the origin. Once found, drag the cursor to the upper left hand side of the view port to reveal which view port it is, 1. This view only shows two of the three axes, the missing one is the one we want, which in this case would be the Y axis. Go to the flag section of the door's object properties, and check the Y Axis box. The other thing to keep in mind is by default, a func_door_rotating moves clockwise around the point of rotation in the 2D view, we want it to move the other way, so we also need to check the Reverse Dir box as well in the flags tab of the object properties. Now move the cursor over the door's origin, 2. Door rotate 2.jpg
We want to rotate around the bottom right corner or the door, A, so we need to drag the origin there. When the mouse is over the origin it should change into a plus sign (B) meaning it is ready to be moved, click on it and drag in down to point A, you should notice a red dotted line that follows it as you move it. Once the origin is in point A we're done setting the origin. Now when the door is opened, it should rotate around point A. Door rotate 3.jpg

Bugs

  • Sometimes there are situations when for unknown reason lighting just doesn't show correctly on door model and all is "black" and you can't do anything with it (move brushes around the door to avoid clipping, check material model shader of it (it's fine), disable shadows, etc). There is a simple and effective way to fix it: just select all your level and move it! Vrad sometimes can make mistakes like this on static and dynamic objects and when you adjust position of your whole level, it will change this calculations and coordinates for lighting.
  • If the speed of the door is changed by the SetSpeed input while it is opening or closing, the speed remains the same until the door is opened or closed again.
Icon-Bug.pngBug:In Left 4 Dead and Left 4 Dead 2, survivors cannot hang off of this when falling off of this entity.  [todo tested in?]
PlacementTip.pngWorkaround:Parent a clip brush with the same proportions as the entity to simulate the same physics, as well as ensuring that the survivors can hang off of it

Keyvalues

Note.pngNote:For Keyvalues and Inputs affecting brush rendering, see Brush entity/Rendering related keyvalues and inputs


Name (targetname) <string>
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Distance (distance) <float>
Degrees the door should rotate. It will rotate away from the player if +used. Otherwise, direction is determined by if the value is negative or positive.
Solid Type (solidbsp) <choices>
How to calculate collisions. Set this to BSP if the player seems to rotate oddly relative to the surface.

BaseDoor:

Linked Door (chainstodoor) <targetname> !FGD
Passes the door's +use inputs and touch events onto a different door, so it also is activated.
Block Filter Name (filtername) <targetname>
(For Half-Life: Source) Filter to use to determine entities that can block the door.
Speed (speed) <float>
Speed that the door moves, in units (sliding door) or degrees (rotating door) per second.
Start Sound (noise1) <sound>
Sound to play when the door starts opening. Also plays when door starts closing if startclosesound is absent.
Stop Sound (noise2) <sound>
Sound to play when the door stops opening. Also plays when door stops closing if closesound is absent.
Start Close Sound (startclosesound) <sound>
Sound to play when the door starts closing.
Stop Close Sound (closesound) <sound>
Sound to play when the door stops closing.
Delay Before Reset (wait) <float>
Time until the door returns to the closed position. A value of -1 means the door never auto-closes.
Lip (lip) <float>
When the door opens, it will move its full length minus this many units. Negative values will make the door move that many more than its length.
Blocking Damage (dmg) <float>
Amount of damage done to entities that block the movement of this door, per frame.
Icon-Bug.pngBug:Normally a door will damage things blocking it, however if the player is teleported by a trigger_teleport while using noclip, they will not be damaged.  [todo tested in?]
Force Closed (forceclosed) <boolean>
Makes the door close no matter what. Useful for doors that have to close even if the player tries to block them with objects.
Ignore Debris (ignoredebris) <boolean>
Changes the door's collision group to COLLISION_GROUP_INTERACTIVE, which ignores debris objects. Not compatible with the Non-solid to Player spawnflag as it also sets a collision group.
Health (shoot open) (health) <integer> Obsolete
Deprecated.
In Quake Quake and GoldSrc GoldSrc, if this was set, the door would open when it took this much damage. Nonfunctional in most Source Source games; can be emulated by parenting an invisible func_button with spawnflag 512 set, and having the button target this door.
Message If Triggered (message) <string> Obsolete
Deprecated.
In Quake Quake and GoldSrc GoldSrc, if this was set, a message would appear on the the player's hud when the door is locked and they attempt to open the door. Nonfunctional in most Source Source games; can be emulated by calling an env_message with the door's OnLockedUse output.
Locked Sound (locked_sound) <sound>
Sound played when the player tries to open the door, and fails because it's locked.
Unlocked Sound (unlocked_sound) <sound>
Sound played when door is unlocked.
Spawn Position (spawnpos) <choices>
State the door should begin in.
  • 0: Closed
  • 1: Open
Locked Sentence (locked_sentence) <choices> (only in Half-Life: Source Half-Life Deathmatch: Source)
Intercom voiceline for when the player tries to use the door, but it's locked.
Unlocked Sentence (unlocked_sentence) <choices> (only in Half-Life: Source Half-Life Deathmatch: Source)
Intercom voiceline for when the door is unlocked.
Loop Moving Sound? (loopmovesound) <boolean>
Makes the door's Start Sound loop until the door finishes moving.
Icon-Bug.pngBug:If an already-looping sound is played with this enabled, it can continue forever. Further attempts to open or close the door will only add another looping sample to the noise.  [todo tested in?]

Flags

Reverse Dir : [2]

This door opens in the opposite direction

One-way : [16]

This door only opens in one direction.

X Axis : [64]

This door rotates on the X axis.

Y Axis : [128]

This door rotates on the Y axis.

BaseDoor: Starts Open : [1] Obsolete

Deprecated.
Door behaves more like the doors in Half-Life Half-Life. Some outputs don't work.

Non-solid to Player : [4]

Sets the collision group to COLLISION_GROUP_PASSABLE_DOOR, so the player cannot collide with it while other things can. This is not compatible with Ignore Debris as that also sets a collision group.

Passable : [8]

This door is solid to nothing at all.

Toggle : [32]

Inputs are interpreted as to open if the door is closed and to close if open, instead of the default behavior where inputs are always interpreted as to open. This sets the delay before reset to -1 (overriding wait), i.e., the door will never reset.

Use Opens : [256]
NPCs Can't : [512]

NPCs can't open this door.

Touch Opens : [1024]

When a player or NPC touches the door, it will count as an attempt to open it.
Icon-Bug.pngBug:The door will play it's Locked Sound when touched, even if Touch Opens is disabled  [todo tested in?]

Starts locked : [2048]

This door spawns locked and cannot be opened by the player or NPCs (but buttons can still trigger it).

Door Silent : [4096]

This door makes no noise.

New Use rules : [65536] !FGD

Door can only be used if it's not moving, is closing, or when it's open.

Inputs

Door:

Open
Opens door.
Close
Closes door.
Toggle
Opens door if closed, closes door if opened.
Lock
Prevent door from opening, but can still close.
Unlock
Allow door to operate as normal.
SetSpeed <float>
Sets Speed.

Outputs

BaseDoor:

OnClose
Fired when the door starts to close.
OnOpen
Fired when the door starts to open.
OnFullyClosed
Fired when the door finishes closing. Reversed if Start Open flag is set.
OnFullyOpen
Fired when the door finishes opening. Reversed if Start Open flag is set.
OnBlockedClosing
Fired when the door has been blocked from closing. !activator is whatever blocks the door.
OnBlockedOpening
Fired when the door has been blocked from opening. !activator is whatever blocks the door.
OnUnblockedClosing
Fired when the door is no longer blocked from closing.
OnUnblockedOpening
Fired when the door is no longer blocked from opening.
OnLockedUse
Fired when the player tries to open the door but fails because it is locked.

See also