Mapbase/Docs/Commentary

From Valve Developer Community
< Mapbase‎ | Docs
Jump to navigation Jump to search

Mapbase Mapbase makes several unique changes to the Commentary System, although most of them rely on manually editing commentary files instead of using the Commentary Editor since the commentary editor is not available in the SDK code.

Todo: Show images from Mapbase v7.0 content article

New node UI

Normally, when subtitles are disabled, developer commentary displays a unique HUD element showing the current speaker, a progress bar for the audio file, and which commentary node it is relative to others in the level. All of this information is hidden when subtitles are enabled.

In order to convey this information during commentary without sacrificing subtitles, Mapbase overhauls the UI to display both the commentary UI and subtitles at the same time. The commentary UI becomes as wide as the subtitles box and is re-positioned to where the subtitles box normally is, moving the subtitles box itself to be directly above it.

This behavior can be toggled using the commentary_audio_element_below_cc cvar.

In addition to this, Mapbase also restores an unused keyvalue (printname) and adds a new keyvalue (footnote) which display additional information on the HUD element.

printname is displayed alongside any specified speaker(s) with a ‘~’ to separate them. footnote is displayed as a set of automatically bulleted footnotes below the progress bar.

The printname combination behavior can be toggled using the commentary_combine_speaker_and_printname cvar.

Note.pngNote:Multiple footnote bullets requires newline characters (\n). This is currently only possible through localization tokens.

New node types

Mapbase includes 3 new types of commentary nodes which behave differently when the player interacts with them. While the default commentary nodes play audio files, these new nodes can display text, display images, or play VCD files respectively. They serve as new mediums for providing commentary and allow different types of information to be conveyed to the player.

This includes the following new node types:

  • Text node - Displays a body of text.
  • Image node - Displays an image.
  • Scene node - Plays a VCD file.

The type of node is set using a new type keyvalue. 0 is the default audio node, 1 is the text node, 2 is the image node, and 3 is the scene node. Models are selected automatically, although they can still be overridden with the model keyvalue. The new models can be found in models/extras, just like the original commentary node model.

New I/O

point_commentary_node now has additional inputs. The new inputs mainly involve editing keyvalues mid-game:

SetViewTarget <targetname>
SetViewTargetSpeed <float>
SetViewPosition <targetname>
SetViewPositionSpeed <float>
SetReturnSpeed <float>

VScript access

VScript access to commentary nodes has been expanded on the server as well as the client, with both ends able to modify most variables (including what audio file plays/what content displays) and add on to the behavior of a node using a new PreStartCommentary hook. This hook can be used to make the commentary change based on a specific condition, like how much health the player has or whether or not the player did something earlier in the map.

For more information, see Mapbase/Scripting/Script Functions#CPointCommentaryNode.