func_door_rotating

From Valve Developer Community

Jump to: navigation, search

Contents

func_door_rotating is a brush entity available in all Source games.

Entity description

It creates a rotating brush that can be "opened" by players or NPCs.

Note:This entity exists to handle unusual shapes and sizes of door. For everyday doors, use prop_door_rotating.
Tip:It's possible to use nodraw to make the brush invisible and then parent a prop_dynamic of your choice to it.

Notes

Axis

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.

Rotation Direction: A func_door_rotating opens clockwise by default.

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

Keyvalues

Distance <int>
Degrees the door should rotate. It will rotate away from the player
Solid Type <choices>
How to calculate collisions. To do: What is best when?

Origin:

Origin (X Y Z) <origin>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.

Angles:

Pitch Yaw Roll (Y Z X) <angle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.

Door:

Speed <int>
Speed that the door moves, in units (sliding door) or degrees (rotating door) per second.
Start Sound <string>
Stop Sound <string>
Overrides for the sound played when the door starts/stops moving.
Start Close Sound <string>
Stop Close Sound <string>
Optional sound override used when the door is closing.
Delay Before Reset <int>
Time until the door returns to the closed position. A value of -1 means the door never auto-closes.
Lip <int>
The amount, in inches, of the button to leave sticking out of the wall it recedes into when pressed. Negative values make the button recede even further into the wall. (Not deprecated)
Blocking Damage <int>
Amount of damage done to entities that block the movement of this door, per frame.
Force Closed <bool>
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 <bool>
Changes the door's collision group to one that ignore collisions with debris objects. Not compatible with the non-solid-to-player spawnflag.
Health <int>
Message If Triggered <string>
Deprecated.
Locked Sound <string>
Unlocked Sound <string>
Sounds played when the player tries to use the door.
Spawn Position <choices>
State the door should begin in; open or closed.
Locked Sentence <choices>
Unlocked Sentence <choices>
Deprecated. Were used in HL1 to play Black Mesa's "access denied" voice.
Minimum Light Level <int>
The minimum level of ambient light that hits this brush.
Loop Moving Sound? <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.

Shadow:

Disable shadows <boolean>
Prevent the entity from creating cheap render-to-texture shadows. Does not affect shadow mapping.
Disable ShadowDepth <boolean> (New with Portal 2)
Used to disable rendering into shadow depth (for projected textures) for this entity.
Projected Texture Cache <choices> (New with Portal 2)
Used to hint projected texture system whether it is sufficient to cache shadow volume of this entity or to force render it every frame instead.
  • 0 : Default
  • 1 : No cache - render every frame
  • 2 : Cache it - render only once
Disable flashlight <boolean> (New with Portal 2)
Used to disable projected texture lighting and shadows on this entity.

Global:

Global Entity Name <string>
Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.

RenderFields:

Render Mode <choices>
Set a non-standard rendering mode on this entity. See Render Modes for details.
FX Amount (0 - 255) <int>
Intensity of the selected render mode.
FX Color (R G B) <color255>
Color used by the selected render mode (if applicable).
Disable Receiving Shadows <bool>
Prevents the entity from receiving shadows.

RenderFXChoices:

Render FX <choices>
Several GoldSrc-era visibility modes which change the way the entity is rendered, typically by fading it in and out.

Parentname:

Parent <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent.

Targetname:

Name <string>
The targetname that other entities refer to this entity by.
Entity Scripts <scriptlist> (New with Left 4 Dead 2)
Name(s) of script files that are executed after all entities have spawned.
Script think function <string> (New with Left 4 Dead 2)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior.
Note:Try to avoid expensive operations in this function, as it may cause performance problems.

Flags

  • Starts Open - This door spawns open.
  • Reverse Dir - This door opens in the opposite direction.
  • Non-solid to Player - This door does not collide with the player or NPCs.
  • Passable - This door does not collide with anything.
  • One-way - This door only opens in one direction.
  • Toggle - This door switches between open and closed on each input.
  • X Axis - This door rotates on the X axis.
  • Y Axis - This door rotates on the Y axis.
  • Use Opens - The +use key triggers this door.
  • NPCs Can't - NPCs can't use this door.
  • Touch Opens - Collision with the door triggers it.
  • Starts locked - This door spawns locked to the player or NPCs (though an input can still trigger it).
  • Door Silent - This door makes no noise.

Inputs

Door:

Open
Close
Toggle
Control the state of the door.
Lock
Unlock
Lock or unlock the door.
SetSpeed <float>
Set the door's movement speed.

Shadow:

DisableShadow
Turn shadow off.
EnableShadow
Turn shadow on.
DisableReceivingFlashlight  (New with Portal 2)
This object will not receive light or shadows from projected textures.
EnableReceivingFlashlight  (New with Portal 2)
This object may receive light or shadows from projected textures.

RenderFields:

Alpha  <integer>
Set the sprite's alpha (0 - 255).
Color  <color255>
Set the sprite's color (R G B).

Parentname:

SetParent  <string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment  <string>
Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset  <string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
ClearParent
Removes this entity from the the movement hierarchy, leaving it free to move independently.

Targetname:

Kill
Removes this entity from the world.
KillHierarchy
Removes this entity and all its children from the world.
AddOutput  <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
Use  !FGD
Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input.
This input is not included in Valve's FGDs.
RunScriptFile  <script> (New with Left 4 Dead 2)
Execute a game script file from disk.
RunScriptCode  <string> (New with Left 4 Dead 2)
Execute a string of script source code. String quotation may be needed when fired via console.
Warning:Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.
CallScriptFunction  <string> (New with Left 4 Dead 2)
Execute a game script function.

Outputs

Door:

OnClose
OnOpen
Fired when the door starts to to open or close.
OnFullyClosed
OnFullyOpen
Fired when the door finishes opening or closing. Reversed if 'Start Open' flag is set.
OnBlockedClosing
OnBlockedOpening
Fired when the door has been blocked from closing or opening. (activator is the blocking entity)
OnUnblockedClosing
OnUnblockedOpening
Fired when the door is no longer blocked from closing or opening.
OnLockedUse
Fired when the player uses the door, but it is locked.
OnUser1 to OnUser4
These Outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
OnKilled  

(New with Left 4 Dead)

This Output fires when the entity is killed and removed from the game.
OnUser1 to OnUser4
These Outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
OnKilled  

(New with Left 4 Dead)

This Output fires when the entity is killed and removed from the game.


See also

Personal tools
Namespaces
Variants
Actions