This article's documentation is for anything that uses the Source engine. Click here for more information.

Point commentary node: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Classifying as model entity)
 
(19 intermediate revisions by 10 users not shown)
Line 1: Line 1:
[[Image:Commentary bubble.jpg|thumb|150px|right|Commentary bubble]]
{{ent not in fgd|nolink=1|because=you can add it with [[Commentary Editor]]|except={{TeamSpen}}}}
{{ep1 point|point_commentary_node}}
{{Preserved entity}}
== Entity description ==
[[File:Commentary bubble.jpg|thumb|200px|right|Commentary bubble]]
The core entity used in the [[Commentary System]]. It appears as a floating speech bubble for the player to +USE, which then starts the commentary playing. This entity is typically placed with the [[Commentary Editor]].
{{CD|CPointCommentaryNode|file1=CommentarySystem.cpp}}
{{this is a|model entity|name=point_commentary_node|since=Source 2006}}
 
The core entity used in the [[Commentary System]]. It appears as a floating speech bubble for the player, which can be interact with {{code|+USE}} (Default: {{key|E}}) to play the commentary. This entity is typically placed with the [[Commentary Editor]].


Unlike most entities, the point_commentary_node is often hand-edited into the [[Commentary System|commentary files]], and as a result, there are some extra keys listed here that [[Hammer]] would normally fill in automatically for you.
Unlike most entities, the point_commentary_node is often hand-edited into the [[Commentary System|commentary files]], and as a result, there are some extra keys listed here that [[Hammer]] would normally fill in automatically for you.


For a commentary node to be able to be activated by a player ([[+use]] while looking at the node), the player must have <code>commentary</code> set to 1 and the map ''must'' have a <code><map name>_commentary.txt</code> file in the same directory as the BSP [https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/server/CommentarySystem.cpp#L272-L292]. This file may be empty and/or embedded in the BSP.
To enable Commentary, the player must have {{code|commentary}} [[cvar]] set to {{code|1}} and the map ''must'' have a {{code|<map name>_commentary.txt}} file in the same directory as the BSP [https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/server/CommentarySystem.cpp#L272-L292] while also having content inside the file to spawn the entity.


If a map with a point_commentary_node is being played in multiplayer only the first player to join will be considered the 'commentary player'. As such only their view will be ray traced to determine the active commentary node [https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/server/CommentarySystem.cpp#L225-L240]
If a map with a point_commentary_node is being played in multiplayer only the first player to join will be considered the 'commentary player'. As such only their view will be ray traced to determine the active commentary node [https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/server/CommentarySystem.cpp#L225-L240]


Although not explicitly stated, this entity may use fields from the [[Template:KV_RenderFields|RenderFields]] base class, the render options selected will affect the speech bubble model of the node.
Although not explicitly stated, this entity may use fields from the [[Template:KV_RenderFields|RenderFields]] base class. The render options selected will affect the speech bubble model of the node.
{{clr}}
 
{{note|In {{tf2|2}}, if this entity is spawned without any properties, the following side effects will apply as long as the entity exists:
* Player join, team change and disconnect messages are not shown in chat
* [[Convar]]s with <code>FCVAR_NOTIFY</code> will not print changes to chat
* The scoreboard is blocked from appearing
* Some objective panels, such as the CTF/PD panel, will not appear
}}


__NOTOC__
== Keyvalues ==
== Keyvalues ==
{{KV|start_disabled|boolean|Start disabled.}}
{{KV Targetname}}
{{KV|origin|vector|The origin of this entity within the map.}}
{{KV|Start Disabled|intn=start_disabled|boolean|Should it be disabled or not?}}
{{KV|angles|angles|The orientation of this entity within the map.}}
{{KV|Origin|intn=origin|vector|The origin of this entity within the map.}}
{{KV|commentaryfile|sound|The commentary sound file that should be played when this node is used by the player.}}
{{KV|Angles|intn=angles|angles|The orientation of this entity within the map.}}
{{KV|commentaryfile_nohdr|sound|The commentary sound file that should be played when this node is used by the player. If the player has HDR turned off, this file will be used instead of the '''commentaryfile'''. If this entry is not specified, the base '''commentaryfile''' entry will still be used.}}
{{KV|Commentary File|intn=commentaryfile|sound|Play the selected sound file when the player interact with the node.}}
{{KV|speakers|string|The name of the speakers of the commentary sound file(s). Will be displayed in the HUD while the commentary sound file is playing.}}
{{KV|Commentary File (no HDR)|intn=commentaryfile_nohdr|sound|Play the selected sound file when the player interact with the node. If the player has HDR turned off, this file will be used instead of the '''commentaryfile'''. If this entry is not specified, the base '''commentaryfile''' entry will still be used.}}
{{KV|synopsis|string|A short synopsis of the contents of the commentary.}}
{{KV|Prevent movement|intn=prevent_movement|boolean|If true, the player will not be able to move while the commentary sound file is playing.}}
{{KV|precommands|string|A semi-colon delimited list of commands that should entered into the console when the commentary file starts playing. e.g. <code>ai_disable 1;mat_wireframe 1</code>}}
{{KV|Pre-command(s)|intn=precommands|string|Command that will fire when the player interact with the node and the sound file is played. Use semicolons to delimit multiple commands. ({{code|ai_disable 1;mat_wireframe 1}})}}
{{KV|postcommands|string|A semi-colon delimited list of commands that should entered into the console when the commentary file finishes playing. e.g. <code>ai_disable 0;mat_wireframe 0</code>}}
{{KV|Post-command(s)|intn=postcommands|string|Command that will fire after the commentary has ended. Also accepts semicolons. (e.g {{code|ai_disable 0;mat_wireframe 0}})}}
{{KV|viewposition|string|The [[targetname]] of an entity to which the players view should move while the commentary file is playing. When the commentary file finishes, the players view will move back to the place it was when the commentary started.}}
{{KV|Speaker(s)|intn=speakers|string|The name of the speakers of the commentary sound file(s). Will be displayed in the HUD (if [[Closed Captions|subtitles/close captions]] is disabled) while the commentary sound file is playing.}}
{{KV|viewtarget|string|The [[targetname]] of an entity that the players view should track while the commentary file is playing. The player will not be able to control their view while the commentary file plays.}}
{{KV|Synopsis|intn=synopsis|string|A short synopsis of the contents of the commentary.}}
{{KV|prevent_movement|boolean|If true, the player will not be able to move while the commentary sound file is playing.}}
{{KV|View Position|intn=viewposition|string|The [[targetname]] of an entity to which the players view should move while the commentary file is playing. When the commentary file finishes, the players view will move back to the place it was when the commentary started.}}
* {{KV Targetname}}
{{KV|View Target|intn=viewtarget|string|The [[targetname]] of an entity that the players view should track while the commentary file is playing. The player will not be able to control their view while the commentary file plays.}}
* {{KV Parentname}}
* {{KV Origin}}
* {{KV Angles}}


== Inputs ==
== Inputs ==
* '''StartCommentary'''
{{I|StartCommentary|Force the commentary node to start.}}
: Force the commentary node to start.
{{I|StartUnstoppableCommentary|Force the commentary node to start, and don't allow the player to stop it in any way.}}
* '''StartUnstoppableCommentary'''
{{I EnableDisable}}
: Force the commentary node to start, and don't allow the player to stop it in any way.
* {{I Targetname}}
* {{I Parentname}}
* {{I EnableDisable}}


== Outputs ==
== Outputs ==
{{IO|OnCommentaryStarted|Fires when this commentary starts playing.}}
{{O|OnCommentaryStarted|Fires when this commentary starts playing.}}
{{IO|OnCommentaryStopped|Fires when this commentary stops playing. May be caused by the commentary file finishing, or by the player stopping it manually (if the node wasn't started with the <code>StartUnstoppableCommentary</code> input). If the node controls the players view with the <code>viewposition</code> key, then this input will be fired when the players view has finished returning to its original position.}}
{{O|OnCommentaryStopped|Fires when this commentary stops playing. May be caused by the commentary file finishing, or by the player stopping it manually (if the node wasn't started with the <code>StartUnstoppableCommentary</code> input). If the node controls the players view with the <code>viewposition</code> key, then this input will be fired when the players view has finished returning to its original position.}}
* {{O Targetname}}


==See also==
==See also==
* [[Commentary System]]
* [[Commentary System]]
* [[Commentary_Editor]]
* [[Commentary Editor]]


[[Category:Half-Life 2: Episode One Entities]]
[[Category:Commentary System]]

Latest revision as of 04:33, 19 May 2025

Icon-NotInFGD.png
This entity is not in the FGD by default, except in TeamSpen's Hammer Addons.
It should not be put directly in a map because you can add it with Commentary Editor.
Recycle-warning.png
This is a preserved entity in Day of Defeat: SourceTeam Fortress 2
If the game has round restart mechanics this entity may not behave as expected.
Commentary bubble
C++ Class hierarchy
CPointCommentaryNode
CBaseAnimating
CBaseEntity
C++ CommentarySystem.cpp

point_commentary_node is a model entity available in all Source Source games since Source 2006 Source 2006.

The core entity used in the Commentary System. It appears as a floating speech bubble for the player, which can be interact with +USE (Default: E) to play the commentary. This entity is typically placed with the Commentary Editor.

Unlike most entities, the point_commentary_node is often hand-edited into the commentary files, and as a result, there are some extra keys listed here that Hammer would normally fill in automatically for you.

To enable Commentary, the player must have commentary cvar set to 1 and the map must have a <map name>_commentary.txt file in the same directory as the BSP [1] while also having content inside the file to spawn the entity.

If a map with a point_commentary_node is being played in multiplayer only the first player to join will be considered the 'commentary player'. As such only their view will be ray traced to determine the active commentary node [2]

Although not explicitly stated, this entity may use fields from the RenderFields base class. The render options selected will affect the speech bubble model of the node.

Note.pngNote:In Team Fortress 2 Team Fortress 2, if this entity is spawned without any properties, the following side effects will apply as long as the entity exists:
  • Player join, team change and disconnect messages are not shown in chat
  • Convars with FCVAR_NOTIFY will not print changes to chat
  • The scoreboard is blocked from appearing
  • Some objective panels, such as the CTF/PD panel, will not appear


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

Start Disabled (start_disabled) <boolean>
Should it be disabled or not?
Origin (origin) <vector>
The origin of this entity within the map.
Angles (angles) <angles>
The orientation of this entity within the map.
Commentary File (commentaryfile) <sound>
Play the selected sound file when the player interact with the node.
Commentary File (no HDR) (commentaryfile_nohdr) <sound>
Play the selected sound file when the player interact with the node. If the player has HDR turned off, this file will be used instead of the commentaryfile. If this entry is not specified, the base commentaryfile entry will still be used.
Prevent movement (prevent_movement) <boolean>
If true, the player will not be able to move while the commentary sound file is playing.
Pre-command(s) (precommands) <string>
Command that will fire when the player interact with the node and the sound file is played. Use semicolons to delimit multiple commands. (ai_disable 1;mat_wireframe 1)
Post-command(s) (postcommands) <string>
Command that will fire after the commentary has ended. Also accepts semicolons. (e.g ai_disable 0;mat_wireframe 0)
Speaker(s) (speakers) <string>
The name of the speakers of the commentary sound file(s). Will be displayed in the HUD (if subtitles/close captions is disabled) while the commentary sound file is playing.
Synopsis (synopsis) <string>
A short synopsis of the contents of the commentary.
View Position (viewposition) <string>
The targetname of an entity to which the players view should move while the commentary file is playing. When the commentary file finishes, the players view will move back to the place it was when the commentary started.
View Target (viewtarget) <string>
The targetname of an entity that the players view should track while the commentary file is playing. The player will not be able to control their view while the commentary file plays.

Inputs

StartCommentary
Force the commentary node to start.
StartUnstoppableCommentary
Force the commentary node to start, and don't allow the player to stop it in any way.

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.

Outputs

OnCommentaryStarted
Fires when this commentary starts playing.
OnCommentaryStopped
Fires when this commentary stops playing. May be caused by the commentary file finishing, or by the player stopping it manually (if the node wasn't started with the StartUnstoppableCommentary input). If the node controls the players view with the viewposition key, then this input will be fired when the players view has finished returning to its original position.

See also