Vgui movie display: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎Entity description: Website no longer exists (Broken Link))
(General updates and P2CE info)
Line 1: Line 1:
{{portal2 point|vgui_movie_display}}
{{toc-right}}


==Entity description==
{{portal2 point|vgui_movie_display}} This entity is used to display videos in the world. Portal 2 uses the Bink format for videos, while {{game link|Portal 2: Community Edition}} uses the WebM format.
This entity is used to display Bink (.BIK) videos on a wall. See [[List of Portal 2 Movies]].


A movie screen is typically a brush face textured with elevator/elevator_screen or one of its variants. Make sure you click "Fit" in the [[Texture Application Tool]].
{{todo|This entity is also in CS:GO's FGD. Is it implemented in-game, and does it work? Test it with WebMs in csgo/panorama/videos}}


The usual setup involves one vgui_movie_display with "_master" at the end of its [[target name]], which then controls a group of slave vgui_movie_displays that have "Forced Slave" enabled and the same "Group Name" as the master entity.  
A movie screen is typically a brush face textured with elevator/elevator_screen or one of its variants. Make sure you click "Fit" in the Texture Application Tool.


Place a slave vgui_movie_display for each screen at the lower-left corner of the face. (This is so you can parent the entity to a panel.) Change the width and height to match each panel.
{{note|If the video has sound, it will be heard at full volume everywhere in the map.}}
{{bug|The video restarts when pausing and unpausing the game.}}
{{bug|The movie display does not fade into [[fog]], and rarely is visible through walls.}}
 
=== Stretching movies across multiple screens ===
 
The master/slave keyvalues and U/V inputs on the entity can be used to stretch a movie across multiple displays. The usual setup for this involves one vgui_movie_display with "_master" at the end of its [[targetname]], which then controls a group of slave vgui_movie_displays that have "Forced Slave" enabled and the same "Group Name" as the master entity.
 
Place a slave vgui_movie_display for each screen at the lower-left corner of the face. Change the width and height to match each panel. The U/V inputs can be used to set which part of the image is displayed on each screen.


To start the movie, fire an "Enable" [[input]] at all vgui_movie_display entities; wildcards are useful for this.
To start the movie, fire an "Enable" [[input]] at all vgui_movie_display entities; wildcards are useful for this.


You can also display movies in your Arrival or Departure Elevators by replacing the values present in the [[func_instance]], '''instances/transitions/arrival_departure_transition_ents.vmf''' found in an already generated map, or by creating your own.  
=== Elevator videos ===
 
Valve includes a system for selecting elevator videos in custom maps. The <code>arrival_departure_transition_ents</code> [[instance]] includes a pair of instance parameters which can be used to set the arrival and departure videos respectively. The <code>video_splitter.nut</code> [[VScript]] will automatically handle setting the correct U/Vs.
 
{{todo|No longer works since the Perpetual Testing Initiative update. Are there any good community-made alternatives?}}


::{| class=standard-table
::{| class=standard-table
Line 26: Line 37:
|}
|}


While not recommended for custom maps, Valve used a [[VScript]] ([['''videos/video_splitter.nut''']]) to split the movies across 46 elevator room panels. It uses an embedded list of movies to control playback; you must add your own map name as a new entry to use it, though again, that's not recommended for custom maps.
The video_splitter script also contains a list of all singleplayer campaign maps and which videos each map should play. For mods, it is recommended to add the mod's maps to this list. Single maps should continue to use the method above.


==Keyvalues==
==Keyvalues==
{{KV|Display Text|string}}
{{KV|Display Text|string|Unknown use, appears non-functional.}}
{{KV|Movie Filename|string|Path to the Bink video file, located in '''media/''' see [[List of Portal 2 Movies]] or import your own.}}
{{KV|Movie Filename|string|Path to the video file, located in '''media/'''. Portal 2 uses Bink (.bik) videos, while [[Portal 2: Community Edition|P2CE]] uses WebM (.webm) videos. See [[List of Portal 2 Movies]] for a list of default videos in Portal 2 (P2CE also includes WebM versions of these).}}
{{KV|Group Name|string|What group of vgui_movie_display entities it belongs to.}}
{{KV|Group Name|string|What group of vgui_movie_display entities it belongs to.}}
{{KV|Loop Movie|boolean|If true, the movie will be played in an endless loop.}}
{{KV|Loop Movie|boolean|If true, the movie will be played in an endless loop.}}
{{KV|Stretch to Fill|boolean|If true, will resize the movie to fill the wall screen.}}
{{KV|Stretch to Fill|boolean|If true, will resize the movie to fill the screen.}}
{{KV|Forced slave|boolean|Whether this is a "slave" vgui_movie_display that takes command from the master.}}
{{KV|Forced slave|boolean|Whether this is a "slave" vgui_movie_display that takes command from the master.}}
{{KV|Force precache|boolean|Precache the movie referred to by Movie Filename on entity spawn.}}
{{KV|Force precache|boolean|Precache the movie referred to by Movie Filename on entity spawn.}}
{{KV|Panel width|integer|Width of the panel in units. (Default: 2)}}
{{KV|Panel width|integer|Width of the panel in units.}}
{{KV|Panel height|integer|Height of the panel in units. (Default: 2)}}
{{KV|Panel height|integer|Height of the panel in units.}}
{{KV Targetname}}
{{KV BaseEntity|base=1|l4d2=1|csgo=1}}
{{KV Angles}}
{{KV Parentname}}


==Inputs==
==Inputs==
{{IO|Enable|Make movie visible.}}
{{IO|Enable|Make movie visible.}}
{{IO|Disable|Make movie invisible.}}
{{IO|Disable|Make movie invisible.}}
{{IO|SetDisplayText|Sets the display text.|param=string}}
{{IO|SetDisplayText|Sets the display text. Appears non-functional.|param=string}}
{{IO|SetMovie|Sets the movie to display.|param=string}}
{{IO|SetMovie|Sets the movie to display.|param=string}}
{{IO|SetUseCustomUVs|Use custom UVs.|param=bool}}
{{IO|SetUseCustomUVs|Use custom UVs.|param=bool}}
Line 53: Line 62:
{{IO|SetVMin|Set the minimum V.|param=float}}
{{IO|SetVMin|Set the minimum V.|param=float}}
{{IO|SetVMax|Set the maximum V.|param=float}}
{{IO|SetVMax|Set the maximum V.|param=float}}
{{I Targetname}}
{{I BaseEntity|base=1|l4d2=1|portal2=1}}
{{I Parentname}}


==Outputs==
==Outputs==
{{O Targetname}}
{{O BaseEntity}}

Revision as of 15:55, 21 November 2020

Template:Portal2 point This entity is used to display videos in the world. Portal 2 uses the Bink format for videos, while Portal 2: Community Edition Portal 2: Community Edition uses the WebM format.

Todo: This entity is also in CS:GO's FGD. Is it implemented in-game, and does it work? Test it with WebMs in csgo/panorama/videos

A movie screen is typically a brush face textured with elevator/elevator_screen or one of its variants. Make sure you click "Fit" in the Texture Application Tool.

Note.pngNote:If the video has sound, it will be heard at full volume everywhere in the map.
Icon-Bug.pngBug:The video restarts when pausing and unpausing the game.  [todo tested in ?]
Icon-Bug.pngBug:The movie display does not fade into fog, and rarely is visible through walls.  [todo tested in ?]

Stretching movies across multiple screens

The master/slave keyvalues and U/V inputs on the entity can be used to stretch a movie across multiple displays. The usual setup for this involves one vgui_movie_display with "_master" at the end of its targetname, which then controls a group of slave vgui_movie_displays that have "Forced Slave" enabled and the same "Group Name" as the master entity.

Place a slave vgui_movie_display for each screen at the lower-left corner of the face. Change the width and height to match each panel. The U/V inputs can be used to set which part of the image is displayed on each screen.

To start the movie, fire an "Enable" input at all vgui_movie_display entities; wildcards are useful for this.

Elevator videos

Valve includes a system for selecting elevator videos in custom maps. The arrival_departure_transition_ents instance includes a pair of instance parameters which can be used to set the arrival and departure videos respectively. The video_splitter.nut VScript will automatically handle setting the correct U/Vs.

Todo: No longer works since the Perpetual Testing Initiative update. Are there any good community-made alternatives?
Property Name Value
Fix up Name
VMF Filename instances/transitions/arrival_departure_transition_ents.vmf
Replace $arrival_video media/faithplate.bik
Replace $departure_video media/animalking.bik

The video_splitter script also contains a list of all singleplayer campaign maps and which videos each map should play. For mods, it is recommended to add the mod's maps to this list. Single maps should continue to use the method above.

Keyvalues

Display Text ([todo internal name (i)]) <string>
Unknown use, appears non-functional.
Movie Filename ([todo internal name (i)]) <string>
Path to the video file, located in media/. Portal 2 uses Bink (.bik) videos, while P2CE uses WebM (.webm) videos. See List of Portal 2 Movies for a list of default videos in Portal 2 (P2CE also includes WebM versions of these).
Group Name ([todo internal name (i)]) <string>
What group of vgui_movie_display entities it belongs to.
Loop Movie ([todo internal name (i)]) <boolean>
If true, the movie will be played in an endless loop.
Stretch to Fill ([todo internal name (i)]) <boolean>
If true, will resize the movie to fill the screen.
Forced slave ([todo internal name (i)]) <boolean>
Whether this is a "slave" vgui_movie_display that takes command from the master.
Force precache ([todo internal name (i)]) <boolean>
Precache the movie referred to by Movie Filename on entity spawn.
Panel width ([todo internal name (i)]) <integer>
Width of the panel in units.
Panel height ([todo internal name (i)]) <integer>
Height of the panel in units.


Inputs

Enable
Make movie visible.
Disable
Make movie invisible.
SetDisplayText <stringRedirectInput/string>
Sets the display text. Appears non-functional.
SetMovie <stringRedirectInput/string>
Sets the movie to display.
SetUseCustomUVs <booleanRedirectInput/boolean>
Use custom UVs.
TakeOverAsMaster
Start using this video as the master of it's group.
SetUMin <floatRedirectInput/float>
Set the minimum U.
SetUMax <floatRedirectInput/float>
Set the maximum U.
SetVMin <floatRedirectInput/float>
Set the minimum V.
SetVMax <floatRedirectInput/float>
Set the maximum V.


Outputs