这篇条目有关 Source引擎。如需详情,点击这里。

Zh/Vgui movie display: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
(Created page with "{{LanguageBar}} {{toc-right}} {{CD|CMovieDisplay|file1=1}} {{this is a|point entity|name=vgui_movie_display|since=Alien Swarm}} {{also|{{mapbase}}}} 320px|thumb|right|{{code|[[vgui_movie_display}} on elevator screens in {{p2|4}}. The video shown on the screen are located in {{path|portal2\media\exercises_horiz|bik}}.]] This entity is used to display videos in the world. {{Portal2|4}} uses the Bink format fo...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{LanguageBar}}
{{LanguageBar|vgui_movie_display|title=VGUI电影显示实体}}
{{toc-right}}
{{toc-right}}
{{CD|CMovieDisplay|file1=1}}
{{CD|CMovieDisplay|file1=1}}
{{this is a|point entity|name=vgui_movie_display|since=Alien Swarm}} {{also|{{mapbase}}}}
{{this is a|点实体|name=vgui_movie_display|since=Alien Swarm}} {{also|{{mapbase}}}}


[[File:Screenshot - Portal 2 - vgui movie display.png|320px|thumb|right|{{code|[[vgui_movie_display]]}} on elevator screens in {{p2|4}}. The video shown on the screen are located in {{path|portal2\media\exercises_horiz|bik}}.]]
[[File:Screenshot - Portal 2 - vgui movie display.png|320px|thumb|right|{{code|{{L|vgui_movie_display}}}} 在 {{p2|4}} 电梯屏幕上的显示效果。屏幕上显示的视频位于 {{path|portal2\media\exercises_horiz|bik}}]]
This entity is used to display videos in the world. {{Portal2|4}} uses the [[BIK|Bink]] format for videos, while {{p2ce|4}} (along with all {{strata|3}} games) uses the [[WEBM|WebM]] format.
此实体用于在游戏世界中显示视频。{{Portal2|4}} 使用 {{L|BIK|Bink}} 格式的视频,而 {{p2ce|4}}(以及所有 {{strata|3}} 游戏)使用 {{L|WEBM|WebM}} 格式。


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.
电影屏幕通常是一个使用 elevator/elevator_screen 或其变体纹理的笔刷面。请确保在纹理应用工具中点击"Fit"


{{bug|{{clr}}
{{bug|{{clr}}
* Non-functional in {{as}}{{csgo}}.
* {{as}}{{csgo}} 中无法使用。
* If the video has sound, it will be heard at full volume everywhere in the map.
* 如果视频有声音,它将在地图中的所有位置以最大音量播放。
* The video restarts when pausing and unpausing the game.
* 暂停和取消暂停游戏时视频会重新开始播放。
* The movie display does not fade into [[fog]], and rarely is visible through walls.}}
* 电影显示不会淡入{{L|fog|雾效}},且偶尔会穿墙可见。}}


=== 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.
实体上的主/从键值和U/V输入可用于将电影跨多个显示器拉伸。通常的设置包括一个在其{{L|targetname|目标名称}}末尾带有"_master"的vgui_movie_display,然后控制一组启用了"Forced Slave""Group Name"与主实体相同的从属vgui_movie_display。


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.
在每个屏幕的左下角放置一个从属vgui_movie_display。更改宽度和高度以匹配每个面板。U/V输入可用于设置图像的哪部分显示在每个屏幕上。


To start the movie, fire an "Enable" [[input]] at all vgui_movie_display entities; wildcards are useful for this.
要开始播放电影,请向所有vgui_movie_display实体触发"Enable"{{L|input|输入}};通配符对此很有用。


=== 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.
Valve包含一个用于在自定义地图中选择电梯视频的系统。<code>arrival_departure_transition_ents</code> {{L|instance|实例}}包含一对实例参数,可用于分别设置到达和离开视频。<code>video_splitter.nut</code> {{L|VScript}}将自动处理设置正确的U/V。


Unfortunately, the default instances included in Portal 2 have broken elevator videos since the Perpetual Testing Initiative update. To fix, visit [https://steamcommunity.com/sharedfiles/filedetails/?id=2483618590 this steam guide].
不幸的是,自Perpetual Testing Initiative更新以来,Portal 2中包含的默认实例中的电梯视频已损坏。要修复,请访问[https://steamcommunity.com/sharedfiles/filedetails/?id=2483618590 此Steam指南]


::{| class=standard-table
::{| class=standard-table
Property Name || Value
属性名称 ||
|-
|-
| Fix up Name ||  
| Fix up Name ||  
Line 41: Line 41:
|}
|}


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.
video_splitter脚本还包含所有单人战役地图的列表以及每个地图应播放的视频。对于模组,建议将模组的地图添加到此列表中。单个地图应继续使用上述方法。


==Keyvalues==
==键值==
{{KV Targetname}}
{{KV Targetname}}
{{KV|Display Text|intn=displaytext|string|Unknown use, appears non-functional.}}
{{KV|Display Text|intn=displaytext|string|未知用途,似乎无法使用。}}
{{KV|Movie Filename|intn=moviefilename|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|Movie Filename|intn=moviefilename|string|视频文件的路径,位于'''media/'''目录下。Portal 2使用Bink (.bik)视频,而{{L|Portal 2: Community Edition|P2CE}}使用WebM (.webm)视频。有关Portal 2中默认视频的列表,请参见{{L|List of Portal 2 Movies|Portal 2电影列表}}(P2CE也包含这些视频的WebM版本)。}}
{{KV|Group Name|intn=groupname|string|What group of vgui_movie_display entities it belongs to.}}
{{KV|Group Name|intn=groupname|string|所属的vgui_movie_display实体组。}}
{{KV|Loop Movie|intn=looping|boolean|If true, the movie will be played in an endless loop.}}
{{KV|Loop Movie|intn=looping|boolean|如果为true,电影将无限循环播放。}}
{{KV|Mute Movie|boolean|If true, it will mute the movie.|only={{mapbase}}}}
{{KV|Mute Movie|boolean|如果为true,将静音电影。|only={{mapbase}}}}
{{KV|Stretch to Fill|intn=stretch|boolean|If true, will resize the movie to fill the screen.|since={{portal2}}}}
{{KV|Stretch to Fill|intn=stretch|boolean|如果为true,将调整电影大小以填充屏幕。|since={{portal2}}}}
{{KV|Forced slave|intn=forcedslave|boolean|Whether this is a "slave" vgui_movie_display that takes command from the master.|since={{portal2}}}}
{{KV|Forced slave|intn=forcedslave|boolean|是否是一个"从属"vgui_movie_display,接受主控器的命令。|since={{portal2}}}}
{{KV|Force precache|intn=forceprecache|boolean|Precache the movie referred to by Movie Filename on entity spawn.|only={{portal2}}}}
{{KV|Force precache|intn=forceprecache|boolean|在实体生成时预缓存Movie Filename所引用的电影。|only={{portal2}}}}
{{KV|Panel width|intn=width|integer|Width of the panel in units.}}
{{KV|Panel width|intn=width|integer|面板的宽度(单位)。}}
{{KV|Panel height|intn=height|integer|Height of the panel in units.}}
{{KV|Panel height|intn=height|integer|面板的高度(单位)。}}
{{KV|Disable Scanline Overlay|intn=noscanline|boolean|Enables/Disables the scanline overlay.|only={{P2CE}}}}
{{KV|Disable Scanline Overlay|intn=noscanline|boolean|启用/禁用扫描线覆盖。|only={{P2CE}}}}
{{KV|Use Custom UVs|intn=custom_uv|boolean|Same as SetUseCustomUVs input, just as a keyvalue|only={{P2CE}}}}
{{KV|Use Custom UVs|intn=custom_uv|boolean|与SetUseCustomUVs输入相同,仅作为键值|only={{P2CE}}}}
{{KV|U Min|intn=u_min|float|U (horizontal) minimum (0-1)|only={{P2CE}}}}
{{KV|U Min|intn=u_min|float|U(水平)最小值(0-1)|only={{P2CE}}}}
{{KV|U Max|intn=u_max|float|U (horizontal) maximum (0-1)|only={{P2CE}}}}
{{KV|U Max|intn=u_max|float|U(水平)最大值(0-1)|only={{P2CE}}}}
{{KV|V Min|intn=v_min|float|V (vertical) minimum (0-1)|only={{P2CE}}}}
{{KV|V Min|intn=v_min|float|V(垂直)最小值(0-1)|only={{P2CE}}}}
{{KV|V Max|intn=v_max|float|V (vertical) maximum (0-1)|only={{P2CE}}}}
{{KV|V Max|intn=v_max|float|V(垂直)最大值(0-1)|only={{P2CE}}}}
{{KV|Audio Volume|intn=volume|int|Audio volume to use for video playback (0-10)|only={{P2CE}}}}
{{KV|Audio Volume|intn=volume|int|用于视频播放的音频音量(0-10)|only={{P2CE}}}}


==Inputs==
==输入==
{{I|Enable|Make movie visible.}}
{{I|Enable|使电影可见。}}
{{I|Disable|Make movie invisible.}}
{{I|Disable|使电影不可见。}}
{{I|SetDisplayText|Sets the display text. Appears non-functional.|param=string}}
{{I|SetDisplayText|设置显示文本。似乎无法使用。|param=字符串}}
{{I|SetMovie|Sets the movie to display.|param=string|since={{portal2}}}}
{{I|SetMovie|设置要显示的电影。|param=字符串|since={{portal2}}}}
{{I|SetUseCustomUVs|Use custom UVs.|param=bool|since={{portal2}}}}
{{I|SetUseCustomUVs|使用自定义UV。|param=布尔值|since={{portal2}}}}
{{I|TakeOverAsMaster|Start using this video as the master of it's group.|since={{portal2}}}}
{{I|TakeOverAsMaster|开始使用此视频作为其组的主控器。|since={{portal2}}}}
{{I|SetUMin|Set the minimum U.|param=float|since={{portal2}}}}
{{I|SetUMin|设置最小U值。|param=float|since={{portal2}}}}
{{I|SetUMax|Set the maximum U.|param=float|since={{portal2}}}}
{{I|SetUMax|设置最大U值。|param=float|since={{portal2}}}}
{{I|SetVMin|Set the minimum V.|param=float|since={{portal2}}}}
{{I|SetVMin|设置最小V值。|param=float|since={{portal2}}}}
{{I|SetVMax|Set the maximum V.|param=float|since={{portal2}}}}
{{I|SetVMax|设置最大V值。|param=float|since={{portal2}}}}


== See also ==
== 另见 ==
* [[List of Portal 2 Movies]]
* {{L|List of Portal 2 Movies|Portal 2电影列表}}
[[Category:Portal 2 entities]]
{{ACategory|Portal 2 entities}}

Latest revision as of 06:13, 8 November 2025

English (en)中文 (zh)Translate (Translate)
C++ 类层级
CMovieDisplay
CBaseEntity
C++ movie_display.cpp

vgui_movie_display是一个点实体,可在所有的 起源 起源 游戏,自从 异形丛生 异形丛生 以来中使用。 (也存在于 Mapbase 之中)

vgui_movie_display(en)传送门2 传送门2 电梯屏幕上的显示效果。屏幕上显示的视频位于 🖿portal2\media\exercises_horiz.bik

此实体用于在游戏世界中显示视频。传送门2 传送门2 使用 Bink(en) 格式的视频,而 传送门 2:社区特供版 传送门 2:社区特供版(以及所有 地层起源 游戏)使用 WebM(en) 格式。

电影屏幕通常是一个使用 elevator/elevator_screen 或其变体纹理的笔刷面。请确保在纹理应用工具中点击"Fit"。

Icon-Bug.png错误:
  • 异形丛生反恐精英:全球攻势 中无法使用。
  • 如果视频有声音,它将在地图中的所有位置以最大音量播放。
  • 暂停和取消暂停游戏时视频会重新开始播放。
  • 电影显示不会淡入雾效(en),且偶尔会穿墙可见。  [todo tested in ?]

跨多个屏幕拉伸电影

实体上的主/从键值和U/V输入可用于将电影跨多个显示器拉伸。通常的设置包括一个在其目标名称(en)末尾带有"_master"的vgui_movie_display,然后控制一组启用了"Forced Slave"且"Group Name"与主实体相同的从属vgui_movie_display。

在每个屏幕的左下角放置一个从属vgui_movie_display。更改宽度和高度以匹配每个面板。U/V输入可用于设置图像的哪部分显示在每个屏幕上。

要开始播放电影,请向所有vgui_movie_display实体触发"Enable"输入(en);通配符对此很有用。

电梯视频

Valve包含一个用于在自定义地图中选择电梯视频的系统。arrival_departure_transition_ents 实例(en)包含一对实例参数,可用于分别设置到达和离开视频。video_splitter.nut VScript(en)将自动处理设置正确的U/V。

不幸的是,自Perpetual Testing Initiative更新以来,Portal 2中包含的默认实例中的电梯视频已损坏。要修复,请访问此Steam指南

属性名称
Fix up Name
VMF Filename instances/transitions/arrival_departure_transition_ents.vmf
Replace $arrival_video media/faithplate.bik
Replace $departure_video media/animalking.bik

video_splitter脚本还包含所有单人战役地图的列表以及每个地图应播放的视频。对于模组,建议将模组的地图添加到此列表中。单个地图应继续使用上述方法。

键值

Name(en) (targetname) <target_source>[ Edit ]
这个名称是其他实体通过 输入/输出(en) 或其他 关键值(en)(如 parentnametarget) 来引用该实体时使用的标识符。
该名称也会显示在 Hammer 编辑器的 2D 视图和 实体报告(en) 中。
参见: 所有实体均可使用的 通用键值、输入与输出(en)
Display Text (displaytext) <字符串(en)>
未知用途,似乎无法使用。
Movie Filename (moviefilename) <字符串(en)>
视频文件的路径,位于media/目录下。Portal 2使用Bink (.bik)视频,而P2CE(en)使用WebM (.webm)视频。有关Portal 2中默认视频的列表,请参见Portal 2电影列表(en)(P2CE也包含这些视频的WebM版本)。
Group Name (groupname) <字符串(en)>
所属的vgui_movie_display实体组。
Loop Movie (looping) <布尔值(en)>
如果为true,电影将无限循环播放。
Mute Movie ([todo internal name (i)]) <布尔值(en)> (存在于 Mapbase 之中)
如果为true,将静音电影。
Stretch to Fill (stretch) <布尔值(en)> (存在于自 传送门2 以来)
如果为true,将调整电影大小以填充屏幕。
Forced slave (forcedslave) <布尔值(en)> (存在于自 传送门2 以来)
是否是一个"从属"vgui_movie_display,接受主控器的命令。
Force precache (forceprecache) <布尔值(en)> (存在于 传送门2 之中)
在实体生成时预缓存Movie Filename所引用的电影。
Panel width (width) <整数(en)>
面板的宽度(单位)。
Panel height (height) <整数(en)>
面板的高度(单位)。
Disable Scanline Overlay (noscanline) <布尔值(en)> (存在于 传送门 2:社区特供版 之中)
启用/禁用扫描线覆盖。
Use Custom UVs (custom_uv) <布尔值(en)> (存在于 传送门 2:社区特供版 之中)
与SetUseCustomUVs输入相同,仅作为键值
U Min (u_min) <浮点型(en)> (存在于 传送门 2:社区特供版 之中)
U(水平)最小值(0-1)
U Max (u_max) <浮点型(en)> (存在于 传送门 2:社区特供版 之中)
U(水平)最大值(0-1)
V Min (v_min) <浮点型(en)> (存在于 传送门 2:社区特供版 之中)
V(垂直)最小值(0-1)
V Max (v_max) <浮点型(en)> (存在于 传送门 2:社区特供版 之中)
V(垂直)最大值(0-1)
Audio Volume (volume) <整数(en)> (存在于 传送门 2:社区特供版 之中)
用于视频播放的音频音量(0-10)

输入

Enable
使电影可见。
Disable
使电影不可见。
SetDisplayText <字符串(en)>
设置显示文本。似乎无法使用。
SetMovie <字符串(en)> (存在于自 传送门2 以来)
设置要显示的电影。
SetUseCustomUVs <布尔值(en)> (存在于自 传送门2 以来)
使用自定义UV。
TakeOverAsMaster  (存在于自 传送门2 以来)
开始使用此视频作为其组的主控器。
SetUMin <浮点型(en)> (存在于自 传送门2 以来)
设置最小U值。
SetUMax <浮点型(en)> (存在于自 传送门2 以来)
设置最大U值。
SetVMin <浮点型(en)> (存在于自 传送门2 以来)
设置最小V值。
SetVMax <浮点型(en)> (存在于自 传送门2 以来)
设置最大V值。

另见