Func monitor: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
 Bug:Cameras may fail to network properly in multiplayer. See below for a code fix. Fixed in
Bug:Cameras may fail to network properly in multiplayer. See below for a code fix. Fixed in  [todo tested in ?]
  [todo tested in ?]
 Note:Unless you set up multiple render textures in your mod's binaries, only one point_camera can be rendered at any one time. The first camera in the map will appear on all monitors.
Note:Unless you set up multiple render textures in your mod's binaries, only one point_camera can be rendered at any one time. The first camera in the map will appear on all monitors.
 Code:To enable monitors in your non-HL2 mod, you must:
Code:To enable monitors in your non-HL2 mod, you must:
		
	
| m (Changed parameters of {{this is a}} to comply with the updated version. This action was performed by a bot.) |  (damn) | ||
| Line 1: | Line 1: | ||
| {{Ent not in fgd}} | {{Ent not in fgd}} | ||
| {{CD2|CFuncMonitor|file1=Func_Monitor.cpp}} | {{CD2|CFuncMonitor|file1=Func_Monitor.cpp}} | ||
| {{this is a|brush entity|name=func_monitor|except=Left 4 Dead series|engine=Source  | {{this is a|brush entity|name=func_monitor|except=Left 4 Dead series|engine=Source|engine1=Source 2}} It displays a real-time scene captured from a [[point_camera]] somewhere else in the world. | ||
| In {{src|4}} for the entity to work, the surface(s) on which the camera view will be displayed must have a material with <code>[[$basetexture]] _rt_Camera</code>. Stock materials that work are <code>dev\dev_combinemonitor*</code> and <code>dev\dev_tvmonitor*</code>. | In {{src|4}} for the entity to work, the surface(s) on which the camera view will be displayed must have a material with <code>[[$basetexture]] _rt_Camera</code>. Stock materials that work are <code>dev\dev_combinemonitor*</code> and <code>dev\dev_tvmonitor*</code>. | ||
Revision as of 13:42, 17 May 2024
|  class hierarchy | 
|---|
| CFuncMonitor defined in   Func_Monitor.cpp | 
func_monitor  is a   brush entity  available in all  Source and
 Source and  Source 2 games except
 Source 2 games except 
 Left 4 Dead series. It displays a real-time scene captured from a point_camera somewhere else in the world.
 Left 4 Dead series. It displays a real-time scene captured from a point_camera somewhere else in the world.
In  Source for the entity to work, the surface(s) on which the camera view will be displayed must have a material with
 Source for the entity to work, the surface(s) on which the camera view will be displayed must have a material with $basetexture _rt_Camera. Stock materials that work are dev\dev_combinemonitor* and dev\dev_tvmonitor*.
 Bug:Cameras may fail to network properly in multiplayer. See below for a code fix. Fixed in
Bug:Cameras may fail to network properly in multiplayer. See below for a code fix. Fixed in  [todo tested in ?]
  [todo tested in ?] Note:Unless you set up multiple render textures in your mod's binaries, only one point_camera can be rendered at any one time. The first camera in the map will appear on all monitors.
Note:Unless you set up multiple render textures in your mod's binaries, only one point_camera can be rendered at any one time. The first camera in the map will appear on all monitors. Code:To enable monitors in your non-HL2 mod, you must:
Code:To enable monitors in your non-HL2 mod, you must:
- Include the entity's client .cpp file (found in \client\hl2\).
- Include the entity's server .cpp and .h files (found in \server\hl2\).
- #define USE_MONITORSat the top of- \client\viewrender.cppand- \client\view.cpp.
- Fix a multiplayer bug in CPointCamera::CPointCamera()by settingm_bActiveto true.
Keyvalues
- 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
- Camera name (target) <targetname>
- The camera to render.
Inputs
- SetCamera <targetname>
- Sets the camera to use for this monitor. Takes the name of a point_camera entity in the map.
- Toggle
- Enables the entity if it is disabled, and disables if it is enabled.
- Enable
- Make the entity visible and solid.
- Disable
- Make the entity invisible and non-solid.
See also
- info_camera_link - For rendering point_cameras on models.
- point_camera




