Func lookdoor: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
 
 Note:The
Note:The 
 Bug:There are bugs that may arise when parenting this entity to any of these: func_movelinear, func_lookdoor, func_water_analog. A func_door (or for func_water_analog, func_water) can be used as a workaround. (see here for a code fix)[
Bug:There are bugs that may arise when parenting this entity to any of these: func_movelinear, func_lookdoor, func_water_analog. A func_door (or for func_water_analog, func_water) can be used as a workaround. (see here for a code fix)[ Code Fix]
 Code Fix]
 Confirm:Might be fixed in Portal 2? Parented movelinears are used extensively for this game's piston platforms.
 Confirm:Might be fixed in Portal 2? Parented movelinears are used extensively for this game's piston platforms.
 Bug:Physics objects cannot be constrained to this entity when this flag is enabled.  [todo tested in ?]
Bug:Physics objects cannot be constrained to this entity when this flag is enabled.  [todo tested in ?]
 Note:For Keyvalues and Inputs affecting brush rendering, see Brush entity/Rendering related keyvalues and inputs
Note:For Keyvalues and Inputs affecting brush rendering, see Brush entity/Rendering related keyvalues and inputs
 Bug:Block damage doesn't function on players who passed through a trigger_teleport using noclip, though it will have effect again if the the player goes through a trigger_teleport without noclip.  [todo tested in ?]
Bug:Block damage doesn't function on players who passed through a trigger_teleport using noclip, though it will have effect again if the the player goes through a trigger_teleport without noclip.  [todo tested in ?]
		
	
| m (Robot: fixing template case.) |  (→Inputs) | ||
| (22 intermediate revisions by 10 users not shown) | |||
| Line 1: | Line 1: | ||
| {{ | {{LanguageBar}} | ||
| {{CD|CLookDoor|file1=look_door.cpp}} | |||
| {{this is a|brush entity|name=func_lookdoor|game=Half-Life 2 series}} It's a door that moves, either when looked by a targeted object or when a target object comes near the door.  Behavior can be either based on viewing direction or proximity alone, or on a combination of both. | |||
| {{FuncMoveLinear notes}} | |||
| {{ | |||
| == | {{stray ent|{{portal}}}} | ||
| {{in  | |||
| ==Flags== | |||
| {{not in FGD}}{{Fl FuncMoveLinear}} | |||
| {{minititle|LookDoor}} | |||
| {{fl|8192|LookDoor Threshold}} | |||
| {{fl|16384|LookDoor Invert|Make the door behave oppositely. Player has to be ''outside'' '''Proximity Distance''', and not looking at the door within '''Field of View'''.}} | |||
| {{fl|32768|LookDoor From Open}} | |||
| ==Keyvalues== | ==Keyvalues== | ||
| {{Brush rendering note}} | |||
| == | {{KV Targetname}} | ||
| {{KV|Target|intn=target|target_destination|nofgd=1|Thing (probably a {{ent|player}}) that we will check for [[LOS]] to the door.}}  | |||
| {{KV|Proximity Distance|intn=ProximityDistance|float|If non-zero, how close target must be for door to move.}} | |||
| {{KV|Proximity Offset|intn=ProximityOffset|float|Offset from the target object.}} | |||
| {{KV|Field of View|intn=FieldOfView|float|If non-zero, how far away from the door the target can look while still triggering it.}} | |||
| {{KV FuncMoveLinear}} | |||
| ==Inputs== | ==Inputs== | ||
| {{I|InvertOn|Enabled inverted behavior.}} | |||
| {{I|InvertOff|Turn door behavior back to the normal method.}} | |||
| {{I FuncMoveLinear|l4d2=0}} | |||
| ==Outputs== | ==Outputs== | ||
| {{O FuncMoveLinear}} | |||
Latest revision as of 06:43, 9 May 2025

 
|  Class hierarchy | 
|---|
| CLookDoor | 
|  look_door.cpp | 
func_lookdoor  is a   brush entity  available in  Half-Life 2 series. It's a door that moves, either when looked by a targeted object or when a target object comes near the door.  Behavior can be either based on viewing direction or proximity alone, or on a combination of both.
 Half-Life 2 series. It's a door that moves, either when looked by a targeted object or when a target object comes near the door.  Behavior can be either based on viewing direction or proximity alone, or on a combination of both.
 Note:The
Note:The SetPosition input and Start Position keyvalue do not perform any bounds checking, so values less than 0 and greater than 1 can be used. Negative values will move in the opposite direction to the movement direction, and values greater than 1 will move it in multiples of the set Move Distance. Moving past the opened/closed position does not trigger the OnFullyOpen and OnFullyClosed outputs. Bug:There are bugs that may arise when parenting this entity to any of these: func_movelinear, func_lookdoor, func_water_analog. A func_door (or for func_water_analog, func_water) can be used as a workaround. (see here for a code fix)[
Bug:There are bugs that may arise when parenting this entity to any of these: func_movelinear, func_lookdoor, func_water_analog. A func_door (or for func_water_analog, func_water) can be used as a workaround. (see here for a code fix)[ Code Fix]
 Code Fix]
 Confirm:Might be fixed in Portal 2? Parented movelinears are used extensively for this game's piston platforms.
 Confirm:Might be fixed in Portal 2? Parented movelinears are used extensively for this game's piston platforms.
Flags
!FGDFuncMoveLinear:
- Not Solid : [8]
 Bug:Physics objects cannot be constrained to this entity when this flag is enabled.  [todo tested in ?]
Bug:Physics objects cannot be constrained to this entity when this flag is enabled.  [todo tested in ?]LookDoor:
- LookDoor Threshold : [8192]
- LookDoor Invert : [16384]
- Make the door behave oppositely. Player has to be outside Proximity Distance, and not looking at the door within Field of View.
- LookDoor From Open : [32768]
Keyvalues
 Note:For Keyvalues and Inputs affecting brush rendering, see Brush entity/Rendering related keyvalues and inputs
Note:For Keyvalues and Inputs affecting brush rendering, see Brush entity/Rendering related keyvalues and inputs
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentnameortarget).
 Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Target (target) <targetname> !FGD
- Thing (probably a player) that we will check for LOS to the door.
- Proximity Distance (ProximityDistance) <float>
- If non-zero, how close target must be for door to move.
- Proximity Offset (ProximityOffset) <float>
- Offset from the target object.
- Field of View (FieldOfView) <float>
- If non-zero, how far away from the door the target can look while still triggering it.
FuncMoveLinear:
- Move Direction (Pitch Yaw Roll) (movedir) <angle>
- The direction the entity will move in.
- Start Position (startposition) <float>
- Position of brush when spawned, where 0 is the starting position and 1 is starting position + (move direction * move distance).
- Speed (speed) <integer>
- The speed that the brush moves, in inches per second.
- Move Distance (movedistance) <float>
- The distance from the starting point that the brush should move, in inches.
- Block Damage (blockdamage) <float>
- The amount of damage to do to any entity that blocks the brushes, per frame.
 Bug:Block damage doesn't function on players who passed through a trigger_teleport using noclip, though it will have effect again if the the player goes through a trigger_teleport without noclip.  [todo tested in ?]
Bug:Block damage doesn't function on players who passed through a trigger_teleport using noclip, though it will have effect again if the the player goes through a trigger_teleport without noclip.  [todo tested in ?]- Sound played when the brush starts moving. (startsound) <sound>
- The sound to play when the brush starts moving.
- Sound played when the brush stops moving. (stopsound) <sound>
- The sound to play when the brush stops moving.
Inputs
- InvertOn
- Enabled inverted behavior.
- InvertOff
- Turn door behavior back to the normal method.
FuncMoveLinear:
- Open
- Move the brush to the end position (starting position + (move direction * move distance)).
- Close
- Move the brush to the starting position.
- SetPosition <float>
- Move the brush to a specific position, where 0 is the starting position and 1 is the starting position + (move direction * move distance).
- SetSpeed <float>
- Set the speed and update immediately.
Outputs
FuncMoveLinear:
- OnFullyOpen
- !activator = !caller = this entity
 Fired when the brush reaches the end position (starting position + (move direction * move distance)).
- OnFullyClosed
- !activator = !caller = this entity
 Fired when the brush reaches the starting position.
























