func_elevator

From Valve Developer Community
Jump to navigation Jump to search
English (en)Translate (Translate)

func_elevator is a brush entity available in Left 4 Dead series Left 4 Dead series.

Class hierarchy
CFuncElevator
CBaseToggle
CBaseEntity
func_elevator.cpp

It is an elevator that can only move vertically between its "Top" and "Bottom" floor values, or any amount of info_elevator_floor entities.
If you want an elevator to move horizontally at all, you may want to use a func_door as a child of the elevator, to handle the horizontal movement.

The elevators positioning is relative to the elevator brushes origin. The elevator will move until its origin aligns with the location of the Top/Bottom values, or with the location of the info_elevator_floor.
This would also allow you to place the elevator anywhere, while having the top and bottom floors be outside of the initial location of the elevator, so that it moves from its initial spot, and never moves back.

Icon-Bug.pngBug:The elevator may sometimes jump the last few units to its final spot, instead of cleanly transitioning. Making a func_door a suitable alternative, should your elevator only move between two stops.  (tested in: Left 4 Dead 2)
PlacementTip.pngExample:sdk_content\mapsrc\No Mercy\l4d_hospital04_interior.vmf.

Keyvalues

Top floor position (top) <vector>
The position of this brush while at the top floor.
Bottom floor position (bottom) <vector>
The position of this brush while at the bottom floor.
Speed (speed) <integer>
The speed that the elevator moves, in inches per second.
Acceleration (acceleration) <integer>
The acceleration at which the elevator approaches its target speed, in inches per second per second.
Block Damage (blockdamage) <float>
The amount of damage to do to any entity that blocks the elevator, per frame.
Sound played when the elevator starts moving. (startsound) <sound>
Sound played when the elevator stops moving. (stopsound) <sound>
Sound played when the elevator is disabled. (disablesound) <sound>
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

Inputs

MoveToFloor <string>
Start the elevator moving to the specified floor. Specifying "top" will move it to the top floor position, "bottom" will move it to the bottom floor position.
This allows you to set multiple floors using info_elevator_floor, and naming those as floors, instead of the entities innate "top" and "bottom" floor values. The elevator will correctly move to any floor, no matter which floor it is currently on.
Disable
Stops the elevator and prevents it from moving again.
SetMaxSpeed <float>
Set the max speed of the elevator.

Outputs

OnReachedTop <string>
Fired when the brush reaches the top.
OnReachedBottom <string>
Fired when the brush reaches the bottom.

See also