CBaseDoor

From Source Entities
(Redirected from Func door)
Jump to navigation Jump to search

Code classes:

CBaseDoor is a base class for many brush-based door-like entities in Source.

To do: Investigate report of sound-related bugs when door starts partially inside world.

Classnames:

  • func_door - Simple sliding door.
  • func_water (Not in FGD) - In GoldSrc this entity was used to create rising and lowering water. The Source equivalent of this entity is func_water_analog.

Flags[edit | edit source]

  • 1: Start Open - "Old broken way of spawning open that has been deprecated". Use Spawn Position.
  • 4: Non-solid to Player - 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.
  • 8: Passable - Door is solid to nothing at all.
  • 32: Toggle - Door can be closed by +use even if Delay Before Reset is not over.
  • 256: Use Opens
  • 512: NPCs can't open. Does not stop hostages in Css.png.
  • 1024: Touch Opens - When a player or NPC touches the door, it will count as an attempt to open it.
  • 2048: Starts locked
  • 4096: Door Silent
  • 65536 (Not in FGD): If the door is closing, Use will reopen it.
  • 131072: Block Infected nav when closed (only available in L4d.pngL4d2-small.png)
  • 262144: Block Survivor nav when closed (only available in L4d.pngL4d2-small.png)

Keyvalues[edit | edit source]

Speed (speed) <integer>
The speed that the door moves, in units per second or degrees per second if rotating.
Lip (lip) <integer>
The amount, in units, of the door to leave inside its original space when pressed. Negative values make the door move even farther.
Move Direction (movedir) <angle>
The direction in which the door will move when it opens. It will open far enough that it does not occupy the space it spawned in.
Start Sound (noise1) <sound>
Sound to play when the door starts moving. If Start Close Sound is specified, this sound only plays when the door starts opening.
Stop Sound (noise2) <sound>
Sound to play when the door stops moving. If Stop Close Sound is specified, this sound only plays when the door starts closing.
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.
Linked Door (Not in FGD) (chainstodoor) <target_destination>
Passes the door's +use inputs and touch events onto a different door, so it also is activated.
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 pressed and unlocked.
Force Closed (forceclosed) <bool>
Damages things that block the door. (Or attempts to push it out, if the blocker is an umdamageable physics object.) Useful for doors that have to close even if the player tries to block them with objects. Requires Blocking Damage be set to a non-zero value.
Blocking Damage (dmg) <float>
Amount of damage done to entities that block the movement of this door, per tick. Requires Force Closed to be set to Yes.
Bug: If the player is teleported by a trigger_teleport while using noclip, they will not be damaged.
Spawn Position (spawnpos) <choices>
The door will spawn in this position. Does not change what positions are considered "open" or "closed".
  • 0: Closed
  • 1: Open
Loop Moving Sound? (loopmovesound) <bool>
Makes the door's Start Sound loop until the door finishes moving.
Bug: 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.
Ignore Debris (ignoredebris) <bool>
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.
Block Filter Name (filtername) <target_destination> (only available in Hl1.pngHalf-Life: Source)
Filter to use to determine entities that can block the door.
Locked Sentence (locked_sentence) <choices> (only available in Hl1.pngHalf-Life: Source)
Intercom voiceline for when the player tries to use the door, but it's locked.
Unlocked Sentence (unlocked_sentence) <choices> (only available in Hl1.pngHalf-Life: Source)
Intercom voiceline for when the door is unlocked.
Shadows (Not in FGD) (vrad_brush_cast_shadows) <choices>
Determines if this entity will cast lightmap shadows.
  • 0: No shadows
  • 1: Cast shadows
Render Mode (rendermode) <choices>
A special rendering mode to use on this entity.
Render Amount/Transparency (renderamt) <integer>
Transparency amount, requires a Render Mode (rendermode) other than Normal. 0 is invisible, 255 is fully visible.
Render Color (R G B) (rendercolor) <color255>
Color channel filter to add to this entity's texture(s). Bug: P2.pngCsgo-small.pngBroken for brush entities.
Render FX (renderfx) <choices>
Preset appearance effects. Partially supported in Asw.png, completely non-functional in P2.pngCsgo-small.png. Bug: Sometimes functions incorrectly if changed with AddOutput, but is the only way to change effects other than making multiple versions of the object.
Minimum Light (_minlight) <float>
Minimum amount of light to hit this brush. 0 is none, 1 is "fullbright". Useful because the lightmaps will not update as the entity moves.
Render in Fast Reflections (drawinfastreflection) <boolean> (available in all games since P2.png)
Makes the entity be rendered in reflections from water materials using $reflectonlymarkedentities.

Inputs[edit | edit source]

Open
Opens door.
Close
Closes door.
Toggle
Opens door if closed, closes door if open.
Lock
Prevents door from opening or closing.
Unlock
Allows door to operate as normal.
SetSpeed <float>
Sets Speed.
Use (Not in FGD)
Simulates a player using the door (acts mostly the same as the other inputs).
Alpha <integer>
Sets Render Amount/Transparency (renderamt).
Color <color255>
Sets the Render Color (rendercolor).
EnableDrawInFastReflection  (available in all games since P2.png)
Sets Render in Fast Reflections to true.
DisableDrawInFastReflection  (available in all games since P2.png)
Sets Render in Fast Reflections to false.

Outputs[edit | edit source]

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

See Also[edit | edit source]