CBasePropDoor

From Source Entities
Jump to navigation Jump to search

CBasePropDoor is a class shared by model-based door entities.

Bug: NPCs are supposed to be able to hear doors opening and closing, but they don't visibly react to it.

Flags[edit | edit source]

  • 2048: Starts locked - Cannot be opened or closed until Unlocked.
  • 4096: Door silent - Door does not play sounds. All sounds can be controlled with the keyvalues below.
  • 8192: Use closes
  • 16384: Door silent to NPCs - No effect.
  • 32768: Ignore player +use

Keyvalues[edit | edit source]

Speed (speed) <float>
How fast the door moves, in world units per second (or degrees per second, if the door rotates).
Hardware Type (hardware) <integer>
Sets the model's $bodygroup. The opening/closing sounds may also change.
  • 0: None
  • 1: Lever (door knob)
  • 2: Push bar
  • 3: Keypad
Delay Before close (returndelay) <float>
Amount of time, in seconds, after the door has opened before it closes. If the value is set to -1, the door never closes itself.
Moving Sound (soundmoveoverride) <sound>
Sound to play when the door starts to close or open. Doors may have default sounds which play depending on the model.
Fully Open Sound (soundopenoverride) <sound>
Sound to play when the door finishes opening.
Fully Closed Sound (soundcloseoverride) <sound>
Sound to play when the door finishes closing.
Locked Sound (soundlockedoverride) <sound>
Sound played when the player tries to open the door, and fails because it's locked.
Unlocked Sound (soundunlockedoverride) <sound>
Sound to play when the door is used while not currently moving.
Slave Name (slavename) <target_destination>
Targetname of another door that should open and close whenever this one does.
Force Closed (forceclosed) <boolean>
If set, this door will close even if something is blocking it. The door will attempt to break or shove the object out of the way.
Damage Inflicted When Blocked (dmg) <float>
Disabled in code.
Set Locked Sound (Not in FGD) (soundsetlockedoverride) <sound> (only available in L4d.pngL4d2-small.png)
No effect.
Set Unlocked Sound (Not in FGD) (soundsetunlockedoverride) <sound> (only available in L4d.pngL4d2-small.png)
No effect.

Inputs[edit | edit source]

Open
If not already open, opens the door.
OpenAwayFrom <target_destination>
If not already open, opens the door away from the specified entity (to avoid hitting that entity).
Close
If not already open, closes the door.
Toggle
If open, close. If closed, open.
Use (Not in FGD)
Like Toggle, opens or closes the door. The difference is that this input will behave more like it was opened by a real person (special sounds, lever animation, etc). OnLockedUse will fire if applicable.
Lock
Makes the door unable to be opened or closed.
Unlock
Makes the door openable and closable.
PlayerOpen (Not in FGD)  (only available in L4d.pngL4d2-small.png)
Like Use, act as if a player opened the door.
PlayerClose (Not in FGD)  (only available in L4d.pngL4d2-small.png)
Like Use, act as if a player closed the door.

Outputs[edit | edit source]

OnOpen
Fires when the door begins to open. (This does not include attempts made to open the door while it is locked.)
OnClose
Fires when the door begins to close.
OnFullyOpen
Fires when the door is finished opening.
OnFullyClosed
Fires when the door is finished closing.
OnBlockedOpening
Fires when the door is blocked while opening. activator is whatever blocks the door.
OnBlockedClosing
Fires when the door is blocked while closing. activator is whatever blocks the door.
OnUnblockedOpening
Fires when the door is no longer being blocked while opening.
OnUnblockedClosing
Fires when the door is no longer being blocked while closing.
OnLockedUse
Fires when the player attempts to open or close the door, but fails because it's locked.