Func monitor: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎top: clean up, replaced: {{Source| → {{src|)
(-added class hierarchy, cleanup, nofgd)
Line 1: Line 1:
{{Ent not in fgd}}
{{CD2|CFuncMonitor|file1=Func_Monitor.cpp}}
{{this is a|name=func_monitor|e2|except=Left 4 Dead series|engine=2|engine1=3}} It displays a real-time scene captured from a [[point_camera]] somewhere else in the world.
{{this is a|name=func_monitor|e2|except=Left 4 Dead series|engine=2|engine1=3}} It displays a real-time scene captured from a [[point_camera]] somewhere else in the world.


Line 14: Line 16:


==Keyvalues==
==Keyvalues==
{{KV func_brush}}
{{KV Targetname}}
{{KV|Camera name|targetname|The camera to render.}}
{{KV|Camera name|intn=target|targetname|The camera to render.}}


==Inputs==
==Inputs==
{{I func_brush}}
{{IO|SetCamera|Sets the camera to use for this monitor. Takes the name of a {{ent|point_camera}} entity in the map.|param=targetname}}
{{IO|SetCamera|targetname|The [[point_camera]] to render.}}
 
{{IO|Toggle|Enables the entity if it is disabled, and disables if it is enabled.}}
{{IO|Toggle|Enables the entity if it is disabled, and disables if it is enabled.}}
{{IO|Enable|Make the entity visible and solid.}}
{{IO|Enable|Make the entity visible and solid.}}
{{IO|Disable|Make the entity invisible and non-solid.}}
{{IO|Disable|Make the entity invisible and non-solid.}}


==Outputs==
{{O Targetname}}
==See also==
==See also==
* [[info_camera_link]] - For rendering point_cameras on [[model]]s.
* {{ent|info_camera_link}} - For rendering point_cameras on [[model]]s.
* [[point_camera]]
* {{ent|point_camera}}
[[Category:Camera]]
[[Category:Camera]]

Revision as of 08:45, 19 February 2024

Icon-NotInFGD.png
This entity is not in the Counter-Strike: Source FGD by default.
See below for instructions on making it available.
C++ class hierarchy
CFuncMonitor defined in C++ Func_Monitor.cpp
CFuncBrush
CBaseEntity

func_monitor is an e2 available in all Template:2 and Template:3 games except Left 4 Dead seriesLeft 4 Dead series Left 4 Dead series.Template:2 topiconTemplate:3 topicon

Warning.pngWarning:
  • The {{{engine}}} parameter is inconsistent with the name defined by the {{2}} template.
  • The {{{engine1}}} parameter is inconsistent with the name defined by the {{3}} template.
    If a parameter is consistent but you're still seeing this warning, it may be an issue with the template itself. Please discuss it on the template's talk page.

It displays a real-time scene captured from a point_camera somewhere else in the world.

In Source 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*.

A broadcast from Dr. Breen.
Icon-Bug.pngBug:Cameras may fail to network properly in multiplayer. See below for a code fix. Fixed in Team Fortress 2  [todo tested in ?]
Note.pngNote: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.
Cpp.pngCode: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_MONITORS at the top of \client\viewrender.cpp and \client\view.cpp.
  • Fix a multiplayer bug in CPointCamera::CPointCamera() by setting m_bActive to true.

Keyvalues

Name (targetname) <string>[ Edit ]
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

Camera name (target) <targetname>
The camera to render.

Inputs

SetCamera <targetnameRedirectInput/string>
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