这篇条目有关 Source引擎。如需详情,点击这里。
这篇条目有关 Source 2引擎。如需详情,点击这里。

func_door

From Valve Developer Community
< Zh
Jump to: navigation, search
English (en)Русский (ru)中文 (zh)Translate (Translate)

类层级
CBaseDoor
CBaseToggle
CBaseEntity
doors.cpp

func_door是一个固体实体(en),可在所有的 起源 起源 游戏中使用。 它创建了一个简单的滑动门。参见 func_door_rotating 了解其对应功能。
移动距离始终是固体门的尺寸。 如果门的移动距离较短,可在 Lip 中使用正值,从总移动距离中减去该单位。或者,你也可以在 Lip 中加入负值,使其移动更远的距离。

PlacementTip.png示例:128个单位高的门会向上移动 128 个单位。增加一个 20 的 Lip 只会使它向上移动 108 个单位。但增加一个 -20 的 Lip 会使它向上移动 148 个单位。

关键值

Note.png注意:For Keyvalues and Inputs affecting brush rendering, see Brush entity/Rendering related keyvalues and inputs(en)


Name(en) (targetname) <string(en)>
其他实体引用该实体的目标名称。
Move Direction (movedir) <angles(en)>
门打开时的移动方向。它打开的距离将不会占据它生成时的空间。

BaseDoor:

Linked Door (chainstodoor) <targetname(en)> 不存在于FGD!
Passes the door's +use inputs and touch events onto a different door, so it also is activated.
Block Filter Name (filtername) <targetname(en)>
(For Half-Life: Source) Filter to use to determine entities that can block the door.
Speed (speed) <float(en)>
Speed that the door moves, in units (sliding door) or degrees (rotating door) per second.
Start Sound (noise1) <sound(en)>
Sound to play when the door starts opening. Also plays when door starts closing if startclosesound is absent.
Stop Sound (noise2) <sound(en)>
Sound to play when the door stops opening. Also plays when door stops closing if closesound is absent.
Start Close Sound (startclosesound) <sound(en)>
Sound to play when the door starts closing.
Stop Close Sound (closesound) <sound(en)>
Sound to play when the door stops closing.
Delay Before Reset (wait) <float(en)>
Time until the door returns to the closed position. A value of -1 means the door never auto-closes.
Lip (lip) <float(en)>
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(en)>
Amount of damage done to entities that block the movement of this door, per frame.
Icon-Bug.png错误: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(en)>
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(en)>
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(en)> Obsolete
已弃用。
In 雷神之锤 雷神之锤 and 金源 金源, if this was set, the door would open when it took this much damage. Nonfunctional in most 起源 起源 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(en)> Obsolete
已弃用。
In 雷神之锤 雷神之锤 and 金源 金源, 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 起源 起源 games; can be emulated by calling an env_message with the door's OnLockedUse output.
Locked Sound (locked_sound) <sound(en)>
Sound played when the player tries to open the door, and fails because it's locked.
Unlocked Sound (unlocked_sound) <sound(en)>
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> (存在于 半衰期:起源 半衰期死亡竞赛:起源 之中)
Intercom voiceline for when the player tries to use the door, but it's locked.
Unlocked Sentence (unlocked_sentence) <choices> (存在于 半衰期:起源 半衰期死亡竞赛:起源 之中)
Intercom voiceline for when the door is unlocked.
Loop Moving Sound? (loopmovesound) <boolean(en)>
Makes the door's Start Sound loop until the door finishes moving.
Icon-Bug.png错误: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?]

标志

BaseDoor:

  •  [1] : Starts Open Obsolete
       已弃用。
    Door behaves more like the doors in 半衰期 半衰期. Some outputs don't work.
  •  [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
       This door is solid to nothing at all.
  •  [32] : Toggle
       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.
  •  [256] : Use Opens
  •  [512] : NPCs Can't
       NPCs can't open this door.
  •  [1024] : Touch Opens
       When a player or NPC touches the door, it will count as an attempt to open it.
    Icon-Bug.png错误:The door will play it's Locked Sound when touched, even if Touch Opens is disabled  [todo tested in?]
  •  [2048] : Starts locked
       This door spawns locked and cannot be opened by the player or NPCs (but buttons can still trigger it).
  •  [4096] : Door Silent
       This door makes no noise.
  •  [65536] : New Use rules 不存在于FGD!
       Door can only be used if it's not moving, is closing, or when it's open.

输入

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(en)>
Sets Speed.

输出

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.

参见