From 04bd4627d4fc29db44b266d36b1ad83986629213 Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Fri, 5 Dec 2014 00:31:32 +0100 Subject: [PATCH 1/3] Add yaml-defined FMV playback to GUI elements --- OpenRA.Game/Map/Map.cs | 24 ++- .../Widgets/Logic/Ingame/LeaveMapLogic.cs | 9 +- .../Widgets/Logic/MissionBrowserLogic.cs | 142 ++++++++++++------ mods/cnc/chrome/missionbrowser.yaml | 47 ++++-- mods/ra/chrome/missionbrowser.yaml | 43 ++++-- 5 files changed, 197 insertions(+), 68 deletions(-) diff --git a/OpenRA.Game/Map/Map.cs b/OpenRA.Game/Map/Map.cs index d2ac405aaa..ea3adcfc22 100644 --- a/OpenRA.Game/Map/Map.cs +++ b/OpenRA.Game/Map/Map.cs @@ -88,6 +88,15 @@ namespace OpenRA } } + public class MapVideos + { + public string BackgroundInfo; + public string Briefing; + public string GameStart; + public string GameWon; + public string GameLost; + } + public class Map { [FieldLoader.Ignore] public IFolder Container; @@ -102,7 +111,6 @@ namespace OpenRA public string Title; public string Type = "Conquest"; - public string PreviewVideo; public string Description; public string Author; public string Tileset; @@ -131,6 +139,19 @@ namespace OpenRA return options; } + [FieldLoader.LoadUsing("LoadVideos")] + public MapVideos Videos; + + static object LoadVideos(MiniYaml y) + { + var videos = new MapVideos(); + var nodesDict = y.ToDictionary(); + if (nodesDict.ContainsKey("Videos")) + FieldLoader.Load(videos, nodesDict["Videos"]); + + return videos; + } + [FieldLoader.Ignore] public Lazy> Actors; public int PlayerCount { get { return Players.Count(p => p.Value.Playable); } } @@ -372,7 +393,6 @@ namespace OpenRA "Title", "Description", "Author", - "PreviewVideo", "Tileset", "MapSize", "Bounds", diff --git a/OpenRA.Mods.RA/Widgets/Logic/Ingame/LeaveMapLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/Ingame/LeaveMapLogic.cs index d030dd697c..5bd38258a6 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/Ingame/LeaveMapLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/Ingame/LeaveMapLogic.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA.Widgets { class LeaveMapLogic { - enum Tab { Objectives, Chat }; + enum Tab { Objectives, Chat } Tab currentTab; OrderManager orderManager; @@ -125,6 +125,13 @@ namespace OpenRA.Mods.RA.Widgets var objectivesContainer = dialog.Get("OBJECTIVES_PANEL"); Game.LoadWidget(world, panel, objectivesContainer, new WidgetArgs()); objectivesContainer.IsVisible = () => currentTab == Tab.Objectives; + + string video = null; + if (world.LocalPlayer.WinState != WinState.Undefined) + video = world.LocalPlayer.WinState == WinState.Won ? world.Map.Videos.GameWon : world.Map.Videos.GameLost; + + if (!string.IsNullOrEmpty(video)) + Media.PlayFMVFullscreen(world, video, () => { }); } if (isMultiplayer) diff --git a/OpenRA.Mods.RA/Widgets/Logic/MissionBrowserLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/MissionBrowserLogic.cs index 46edd5bb62..6bb79416ea 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/MissionBrowserLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/MissionBrowserLogic.cs @@ -23,14 +23,19 @@ namespace OpenRA.Mods.RA.Widgets.Logic { public class MissionBrowserLogic { + enum PlayingVideo { None, Info, Briefing, GameStart } + readonly Action onStart; readonly ScrollPanelWidget descriptionPanel; readonly LabelWidget description; readonly SpriteFont descriptionFont; readonly DropDownButtonWidget difficultyButton; - readonly ButtonWidget startVideoButton; - readonly ButtonWidget stopVideoButton; + readonly ButtonWidget startBriefingVideoButton; + readonly ButtonWidget stopBriefingVideoButton; + readonly ButtonWidget startInfoVideoButton; + readonly ButtonWidget stopInfoVideoButton; readonly VqaPlayerWidget videoPlayer; + readonly BackgroundWidget fullscreenVideoPlayer; readonly ScrollPanelWidget missionList; readonly ScrollItemWidget headerTemplate; @@ -38,12 +43,12 @@ namespace OpenRA.Mods.RA.Widgets.Logic MapPreview selectedMapPreview; - bool showVideoPlayer; + PlayingVideo playingVideo; string difficulty; [ObjectCreator.UseCtor] - public MissionBrowserLogic(Widget widget, Action onStart, Action onExit) + public MissionBrowserLogic(Widget widget, World world, Action onStart, Action onExit) { this.onStart = onStart; @@ -54,16 +59,17 @@ namespace OpenRA.Mods.RA.Widgets.Logic var title = widget.GetOrNull("MISSIONBROWSER_TITLE"); if (title != null) - title.GetText = () => showVideoPlayer ? selectedMapPreview.Title : title.Text; + title.GetText = () => playingVideo != PlayingVideo.None ? selectedMapPreview.Title : title.Text; widget.Get("MISSION_INFO").IsVisible = () => selectedMapPreview != null; var previewWidget = widget.Get("MISSION_PREVIEW"); previewWidget.Preview = () => selectedMapPreview; - previewWidget.IsVisible = () => !showVideoPlayer; + previewWidget.IsVisible = () => playingVideo == PlayingVideo.None; videoPlayer = widget.Get("MISSION_VIDEO"); - widget.Get("MISSION_BIN").IsVisible = () => showVideoPlayer; + widget.Get("MISSION_BIN").IsVisible = () => playingVideo != PlayingVideo.None; + fullscreenVideoPlayer = Ui.LoadWidget("FULLSCREEN_PLAYER", Ui.Root, new WidgetArgs { { "world", world } }); descriptionPanel = widget.Get("MISSION_DESCRIPTION_PANEL"); @@ -72,10 +78,15 @@ namespace OpenRA.Mods.RA.Widgets.Logic difficultyButton = widget.Get("DIFFICULTY_DROPDOWNBUTTON"); - startVideoButton = widget.Get("START_VIDEO_BUTTON"); - stopVideoButton = widget.Get("STOP_VIDEO_BUTTON"); - stopVideoButton.IsVisible = () => showVideoPlayer; - stopVideoButton.OnClick = StopVideo; + startBriefingVideoButton = widget.Get("START_BRIEFING_VIDEO_BUTTON"); + stopBriefingVideoButton = widget.Get("STOP_BRIEFING_VIDEO_BUTTON"); + stopBriefingVideoButton.IsVisible = () => playingVideo == PlayingVideo.Briefing; + stopBriefingVideoButton.OnClick = () => StopVideo(videoPlayer); + + startInfoVideoButton = widget.Get("START_INFO_VIDEO_BUTTON"); + stopInfoVideoButton = widget.Get("STOP_INFO_VIDEO_BUTTON"); + stopInfoVideoButton.IsVisible = () => playingVideo == PlayingVideo.Info; + stopInfoVideoButton.OnClick = () => StopVideo(videoPlayer); var allMaps = new List(); missionList.RemoveChildren(); @@ -114,12 +125,12 @@ namespace OpenRA.Mods.RA.Widgets.Logic SelectMap(allMaps.First()); var startButton = widget.Get("STARTGAME_BUTTON"); - startButton.OnClick = StartMission; + startButton.OnClick = StartMissionClicked; startButton.IsDisabled = () => selectedMapPreview.RuleStatus != MapRuleStatus.Cached; widget.Get("BACK_BUTTON").OnClick = () => { - StopVideo(); + StopVideo(videoPlayer); Game.Disconnect(); Ui.CloseWindow(); onExit(); @@ -128,7 +139,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic void CreateMissionGroup(string title, IEnumerable maps) { - var header = ScrollItemWidget.Setup(headerTemplate, () => true, () => {}); + var header = ScrollItemWidget.Setup(headerTemplate, () => true, () => { }); header.Get("LABEL").GetText = () => title; missionList.AddChild(header); @@ -139,41 +150,35 @@ namespace OpenRA.Mods.RA.Widgets.Logic var item = ScrollItemWidget.Setup(template, () => selectedMapPreview != null && selectedMapPreview.Uid == map.Uid, () => SelectMap(map), - StartMission); + StartMissionClicked); item.Get("TITLE").GetText = () => map.Title; missionList.AddChild(item); } } - float cachedSoundVolume; - float cachedMusicVolume; void SelectMap(Map map) { - StopVideo(); - selectedMapPreview = Game.modData.MapCache[map.Uid]; // Cache the rules on a background thread to avoid jank new Thread(selectedMapPreview.CacheRules).Start(); - var video = selectedMapPreview.Map.PreviewVideo; - var videoVisible = video != null; - var videoDisabled = !(videoVisible && GlobalFileSystem.Exists(video)); + var briefingVideo = selectedMapPreview.Map.Videos.Briefing; + var briefingVideoVisible = briefingVideo != null; + var briefingVideoDisabled = !(briefingVideoVisible && GlobalFileSystem.Exists(briefingVideo)); - startVideoButton.IsVisible = () => videoVisible && !showVideoPlayer; - startVideoButton.IsDisabled = () => videoDisabled; - startVideoButton.OnClick = () => - { - showVideoPlayer = true; - videoPlayer.Load(video); - videoPlayer.PlayThen(StopVideo); + var infoVideo = selectedMapPreview.Map.Videos.BackgroundInfo; + var infoVideoVisible = infoVideo != null; + var infoVideoDisabled = !(infoVideoVisible && GlobalFileSystem.Exists(infoVideo)); - // Mute other distracting sounds - cachedSoundVolume = Sound.SoundVolume; - cachedMusicVolume = Sound.MusicVolume; - Sound.SoundVolume = Sound.MusicVolume = 0; - }; + startBriefingVideoButton.IsVisible = () => briefingVideoVisible && playingVideo != PlayingVideo.Briefing; + startBriefingVideoButton.IsDisabled = () => briefingVideoDisabled || playingVideo != PlayingVideo.None; + startBriefingVideoButton.OnClick = () => PlayVideo(videoPlayer, briefingVideo, PlayingVideo.Briefing, () => StopVideo(videoPlayer)); + + startInfoVideoButton.IsVisible = () => infoVideoVisible && playingVideo != PlayingVideo.Info; + startInfoVideoButton.IsDisabled = () => infoVideoDisabled || playingVideo != PlayingVideo.None; + startInfoVideoButton.OnClick = () => PlayVideo(videoPlayer, infoVideo, PlayingVideo.Info, () => StopVideo(videoPlayer)); var text = map.Description != null ? map.Description.Replace("\\n", "\n") : ""; text = WidgetUtils.WrapText(text, description.Bounds.Width, descriptionFont); @@ -205,25 +210,72 @@ namespace OpenRA.Mods.RA.Widgets.Logic }; } - void StopVideo() + float cachedSoundVolume; + float cachedMusicVolume; + void MuteSounds() { - if (!showVideoPlayer) - return; - - Sound.SoundVolume = cachedSoundVolume; - Sound.MusicVolume = cachedMusicVolume; - - videoPlayer.Stop(); - showVideoPlayer = false; + cachedSoundVolume = Sound.SoundVolume; + cachedMusicVolume = Sound.MusicVolume; + Sound.SoundVolume = Sound.MusicVolume = 0; } - void StartMission() + void UnMuteSounds() { - StopVideo(); + if (cachedSoundVolume > 0) + Sound.SoundVolume = cachedSoundVolume; + + if (cachedMusicVolume > 0) + Sound.MusicVolume = cachedMusicVolume; + } + + void PlayVideo(VqaPlayerWidget player, string video, PlayingVideo pv, Action onComplete) + { + StopVideo(player); + + playingVideo = pv; + player.Load(video); + + // video playback runs asynchronously + player.PlayThen(onComplete); + + // Mute other distracting sounds + MuteSounds(); + } + + void StopVideo(VqaPlayerWidget player) + { + if (playingVideo == PlayingVideo.None) + return; + + UnMuteSounds(); + player.Stop(); + playingVideo = PlayingVideo.None; + } + + void StartMissionClicked() + { + StopVideo(videoPlayer); if (selectedMapPreview.RuleStatus != MapRuleStatus.Cached) return; + var gameStartVideo = selectedMapPreview.Map.Videos.GameStart; + if (gameStartVideo != null && GlobalFileSystem.Exists(gameStartVideo)) + { + var fsPlayer = fullscreenVideoPlayer.Get("PLAYER"); + fullscreenVideoPlayer.Visible = true; + PlayVideo(fsPlayer, gameStartVideo, PlayingVideo.GameStart, () => + { + StopVideo(fsPlayer); + StartMission(); + }); + } + else + StartMission(); + } + + void StartMission() + { OrderManager om = null; Action lobbyReady = null; diff --git a/mods/cnc/chrome/missionbrowser.yaml b/mods/cnc/chrome/missionbrowser.yaml index 992e2613d9..b38435c7e2 100644 --- a/mods/cnc/chrome/missionbrowser.yaml +++ b/mods/cnc/chrome/missionbrowser.yaml @@ -21,7 +21,7 @@ Container@MISSIONBROWSER_PANEL: X: 15 Y: 15 Width: 239 - Height: 347 + Height: 307 Children: ScrollItem@HEADER: Width: PARENT_RIGHT-27 @@ -74,6 +74,13 @@ Container@MISSIONBROWSER_PANEL: Width: PARENT_RIGHT - 32 VAlign: Top Font: Small + DropDownButton@DIFFICULTY_DROPDOWNBUTTON: + X: 15 + Y: 337 + Width: 239 + Height: 25 + Text: Difficulty + Font: Regular Button@BACK_BUTTON: Y: 376 Width: 140 @@ -81,20 +88,34 @@ Container@MISSIONBROWSER_PANEL: Text: Back Font: Bold Key: escape - Button@START_VIDEO_BUTTON: + Button@START_BRIEFING_VIDEO_BUTTON: X: PARENT_RIGHT - 290 Y: 376 Width: 140 Height: 35 - Text: View Briefing + Text: Watch Briefing Font: Bold - Button@STOP_VIDEO_BUTTON: + Button@STOP_BRIEFING_VIDEO_BUTTON: X: PARENT_RIGHT - 290 Y: 376 Width: 140 Height: 35 Text: Stop Briefing Font: Bold + Button@START_INFO_VIDEO_BUTTON: + X: PARENT_RIGHT - 440 + Y: 376 + Width: 140 + Height: 35 + Text: Watch Info Video + Font: Bold + Button@STOP_INFO_VIDEO_BUTTON: + X: PARENT_RIGHT - 440 + Y: 376 + Width: 140 + Height: 35 + Text: Stop Info Video + Font: Bold Button@STARTGAME_BUTTON: X: PARENT_RIGHT - 140 Y: 376 @@ -102,13 +123,6 @@ Container@MISSIONBROWSER_PANEL: Height: 35 Text: Play Font: Bold - DropDownButton@DIFFICULTY_DROPDOWNBUTTON: - X: PARENT_RIGHT - 290 - 150 - Y: 376 - Width: 140 - Height: 35 - Text: Difficulty - Font: Bold Container@MISSION_BIN: Children: VqaPlayer@MISSION_VIDEO: @@ -116,3 +130,14 @@ Container@MISSIONBROWSER_PANEL: Y: 1 Width: 640 Height: 375 +Background@FULLSCREEN_PLAYER: + Width: WINDOW_RIGHT + Height: WINDOW_BOTTOM + Background: panel-allblack + Visible: False + Children: + VqaPlayer@PLAYER: + X: 0 + Y: 0 + Width: WINDOW_RIGHT + Height: WINDOW_BOTTOM diff --git a/mods/ra/chrome/missionbrowser.yaml b/mods/ra/chrome/missionbrowser.yaml index 1200ec72d3..573016812a 100644 --- a/mods/ra/chrome/missionbrowser.yaml +++ b/mods/ra/chrome/missionbrowser.yaml @@ -16,7 +16,7 @@ Background@MISSIONBROWSER_PANEL: X: 20 Y: 50 Width: 270 - Height: 377 + Height: 332 Children: ScrollItem@HEADER: BaseName: scrollheader @@ -69,20 +69,34 @@ Background@MISSIONBROWSER_PANEL: Width: PARENT_RIGHT - 32 VAlign: Top Font: Small - Button@START_VIDEO_BUTTON: + Button@START_BRIEFING_VIDEO_BUTTON: X: 20 Y: PARENT_BOTTOM - 45 - Width: 120 + Width: 130 Height: 25 - Text: Play Briefing + Text: Watch Briefing Font: Bold - Button@STOP_VIDEO_BUTTON: + Button@STOP_BRIEFING_VIDEO_BUTTON: X: 20 Y: PARENT_BOTTOM - 45 - Width: 120 + Width: 130 Height: 25 Text: Stop Briefing Font: Bold + Button@START_INFO_VIDEO_BUTTON: + X: 160 + Y: PARENT_BOTTOM - 45 + Width: 130 + Height: 25 + Text: Watch Info Video + Font: Bold + Button@STOP_INFO_VIDEO_BUTTON: + X: 160 + Y: PARENT_BOTTOM - 45 + Width: 130 + Height: 25 + Text: Stop Info Video + Font: Bold Button@STARTGAME_BUTTON: X: PARENT_RIGHT - 140 - 130 Y: PARENT_BOTTOM - 45 @@ -99,9 +113,9 @@ Background@MISSIONBROWSER_PANEL: Font: Bold Key: escape DropDownButton@DIFFICULTY_DROPDOWNBUTTON: - X: PARENT_RIGHT - 140 - 130 - 150 - Y: PARENT_BOTTOM - 45 - Width: 140 + X: 20 + Y: 427 - HEIGHT + Width: 270 Height: 25 Text: Difficulty Font: Bold @@ -117,3 +131,14 @@ Background@MISSIONBROWSER_PANEL: Y: 1 Width: 640 Height: 375 +Background@FULLSCREEN_PLAYER: + Width: WINDOW_RIGHT + Height: WINDOW_BOTTOM + Background: dialog5 + Visible: False + Children: + VqaPlayer@PLAYER: + X: 0 + Y: 0 + Width: WINDOW_RIGHT + Height: WINDOW_BOTTOM From 1564e6c0ddb381282a5379454e539bef8b153600 Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Fri, 5 Dec 2014 00:52:07 +0100 Subject: [PATCH 2/3] Update missions for yaml-defined FMV playback --- mods/cnc/maps/gdi01/gdi01.lua | 20 ++++++-------------- mods/cnc/maps/gdi01/map.yaml | 8 ++++++-- mods/cnc/maps/gdi02/gdi02.lua | 6 ------ mods/cnc/maps/gdi02/map.yaml | 7 +++++-- mods/cnc/maps/gdi03/gdi03.lua | 14 +++----------- mods/cnc/maps/gdi03/map.yaml | 8 ++++++-- mods/cnc/maps/gdi04a/gdi04a.lua | 16 +++------------- mods/cnc/maps/gdi04a/map.yaml | 9 +++++++-- mods/cnc/maps/gdi04b/gdi04b.lua | 16 +++------------- mods/cnc/maps/gdi04b/map.yaml | 9 +++++++-- mods/cnc/maps/gdi04c/gdi04c.lua | 16 +++------------- mods/cnc/maps/gdi04c/map.yaml | 9 +++++++-- mods/cnc/maps/nod01/map.yaml | 6 ++++-- mods/cnc/maps/nod01/nod01.lua | 3 --- mods/cnc/maps/nod03a/map.yaml | 6 ++++++ mods/cnc/maps/nod03a/nod03a.lua | 14 +++----------- mods/cnc/maps/nod03b/map.yaml | 6 ++++++ mods/cnc/maps/nod03b/nod03b.lua | 14 +++----------- mods/ra/maps/allies-01/allies01.lua | 16 +++++----------- mods/ra/maps/allies-01/map.yaml | 9 ++++++--- mods/ra/maps/allies-02/allies02.lua | 10 +--------- mods/ra/maps/allies-02/map.yaml | 9 ++++++--- mods/ra/maps/allies-03a/allies03a.lua | 10 +++------- mods/ra/maps/allies-03a/map.yaml | 6 +++++- mods/ra/maps/soviet-01/map.yaml | 7 +++++-- mods/ra/maps/soviet-01/soviet01.lua | 17 +++-------------- 26 files changed, 112 insertions(+), 159 deletions(-) diff --git a/mods/cnc/maps/gdi01/gdi01.lua b/mods/cnc/maps/gdi01/gdi01.lua index a72f09d2d5..3b00bca278 100644 --- a/mods/cnc/maps/gdi01/gdi01.lua +++ b/mods/cnc/maps/gdi01/gdi01.lua @@ -83,26 +83,18 @@ WorldLoaded = function() Trigger.OnPlayerWon(player, function() Media.PlaySpeechNotification(player, "Win") - Trigger.AfterDelay(25, function() - Media.PlayMovieFullscreen("consyard.vqa") - end) end) Trigger.OnPlayerLost(player, function() Media.PlaySpeechNotification(player, "Lose") - Trigger.AfterDelay(25, function() - Media.PlayMovieFullscreen("gameover.vqa") - end) end) - Media.PlayMovieFullscreen("landing.vqa", function() - nodObjective = enemy.AddPrimaryObjective("Destroy all GDI troops") - gdiObjective1 = player.AddPrimaryObjective("Eliminate all Nod forces in the area") - gdiObjective2 = player.AddSecondaryObjective("Establish a beachhead") - - ReinforceWithLandingCraft(MCVReinforcements, lstStart.Location + CVec.New(2, 0), lstEnd.Location + CVec.New(2, 0), mcvTarget.Location) - Reinforce(InfantryReinforcements) - end) + nodObjective = enemy.AddPrimaryObjective("Destroy all GDI troops") + gdiObjective1 = player.AddPrimaryObjective("Eliminate all Nod forces in the area") + gdiObjective2 = player.AddSecondaryObjective("Establish a beachhead") + + ReinforceWithLandingCraft(MCVReinforcements, lstStart.Location + CVec.New(2, 0), lstEnd.Location + CVec.New(2, 0), mcvTarget.Location) + Reinforce(InfantryReinforcements) Trigger.OnIdle(Gunboat, function() SetGunboatPath(Gunboat) end) diff --git a/mods/cnc/maps/gdi01/map.yaml b/mods/cnc/maps/gdi01/map.yaml index 8fc60d9c8c..c83bae8e5f 100644 --- a/mods/cnc/maps/gdi01/map.yaml +++ b/mods/cnc/maps/gdi01/map.yaml @@ -10,8 +10,6 @@ Description: Use the units provided to protect the Mobile Construction Vehicle. Author: Westwood Studios -PreviewVideo: gdi1.vqa - Tileset: TEMPERAT MapSize: 64,64 @@ -22,6 +20,12 @@ UseAsShellmap: False Type: Campaign +Videos: + Briefing: gdi1.vqa + GameStart: landing.vqa + GameWon: consyard.vqa + GameLost: gameover.vqa + Options: Crates: False Fog: True diff --git a/mods/cnc/maps/gdi02/gdi02.lua b/mods/cnc/maps/gdi02/gdi02.lua index dd58233f75..71b097169c 100644 --- a/mods/cnc/maps/gdi02/gdi02.lua +++ b/mods/cnc/maps/gdi02/gdi02.lua @@ -72,16 +72,10 @@ WorldLoaded = function() Trigger.OnPlayerWon(player, function() Media.PlaySpeechNotification(player, "Win") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("flag.vqa") - end) end) Trigger.OnPlayerLost(player, function() Media.PlaySpeechNotification(player, "Lose") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("gameover.vqa") - end) end) nodObjective = enemy.AddPrimaryObjective("Destroy all GDI troops") diff --git a/mods/cnc/maps/gdi02/map.yaml b/mods/cnc/maps/gdi02/map.yaml index 62c348865f..833b87bb34 100644 --- a/mods/cnc/maps/gdi02/map.yaml +++ b/mods/cnc/maps/gdi02/map.yaml @@ -10,8 +10,6 @@ Description: Defend your position, deploy the MCV, then build a sizable force to Author: Westwood Studios -PreviewVideo: gdi2.vqa - Tileset: TEMPERAT MapSize: 64,64 @@ -22,6 +20,11 @@ UseAsShellmap: False Type: Campaign +Videos: + Briefing: gdi2.vqa + GameWon: flag.vqa + GameLost: gameover.vqa + Options: Crates: False Fog: True diff --git a/mods/cnc/maps/gdi03/gdi03.lua b/mods/cnc/maps/gdi03/gdi03.lua index 5dfb23f22c..cd2dc4aa28 100644 --- a/mods/cnc/maps/gdi03/gdi03.lua +++ b/mods/cnc/maps/gdi03/gdi03.lua @@ -59,24 +59,16 @@ WorldLoaded = function() Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed") end) - Media.PlayMovieFullscreen("samdie.vqa", function() - nodObjective = enemy.AddPrimaryObjective("Destroy all GDI troops") - gdiMainObjective = player.AddPrimaryObjective("Eliminate all Nod forces in the area") - gdiAirSupportObjective = player.AddSecondaryObjective("Destroy the SAM sites to receive air support") - end) + nodObjective = enemy.AddPrimaryObjective("Destroy all GDI troops") + gdiMainObjective = player.AddPrimaryObjective("Eliminate all Nod forces in the area") + gdiAirSupportObjective = player.AddSecondaryObjective("Destroy the SAM sites to receive air support") Trigger.OnPlayerLost(player, function() Media.PlaySpeechNotification(player, "Lose") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("gameover.vqa") - end) end) Trigger.OnPlayerWon(player, function() Media.PlaySpeechNotification(player, "Win") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("bombaway.vqa") - end) end) Trigger.OnAllKilled(SamSites, function() diff --git a/mods/cnc/maps/gdi03/map.yaml b/mods/cnc/maps/gdi03/map.yaml index 4ec7a782a9..d6844575a7 100644 --- a/mods/cnc/maps/gdi03/map.yaml +++ b/mods/cnc/maps/gdi03/map.yaml @@ -10,8 +10,6 @@ Description: Build up forces to destroy Nod base.\n\nOnce all Nod SAM sites are Author: Westwood Studios -PreviewVideo: gdi3.vqa - Tileset: TEMPERAT MapSize: 64,64 @@ -22,6 +20,12 @@ UseAsShellmap: False Type: Campaign +Videos: + Briefing: gdi3.vqa + GameStart: samdie.vqa + GameWon: bombaway.vqa + GameLost: gameover.vqa + Options: Crates: False Fog: True diff --git a/mods/cnc/maps/gdi04a/gdi04a.lua b/mods/cnc/maps/gdi04a/gdi04a.lua index 637150af1a..795380b4a1 100644 --- a/mods/cnc/maps/gdi04a/gdi04a.lua +++ b/mods/cnc/maps/gdi04a/gdi04a.lua @@ -121,26 +121,16 @@ WorldLoaded = function() Trigger.OnPlayerWon(gdi, function() Media.PlaySpeechNotification(gdi, "Win") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("burdet1.vqa") - end) end) Trigger.OnPlayerLost(gdi, function() Media.PlaySpeechNotification(gdi, "Lose") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("gameover.vqa") - end) end) - Media.PlayMovieFullscreen("bkground.vqa", function() - Media.PlayMovieFullscreen("nitejump.vqa", function() - gdiObjective = gdi.AddPrimaryObjective("Retrieve the crate with the stolen rods.") - reinforcementsObjective = gdi.AddSecondaryObjective("Eliminate " .. KillsUntilReinforcements .. " Nod units for reinforcements.") - nod.AddPrimaryObjective("Defend against the GDI forces.") - end) - end) + gdiObjective = gdi.AddPrimaryObjective("Retrieve the crate with the stolen rods.") + reinforcementsObjective = gdi.AddSecondaryObjective("Eliminate " .. KillsUntilReinforcements .. " Nod units for reinforcements.") + nod.AddPrimaryObjective("Defend against the GDI forces.") BuildNod1() Utils.Do(NodHelis, function(heli) diff --git a/mods/cnc/maps/gdi04a/map.yaml b/mods/cnc/maps/gdi04a/map.yaml index 205059de81..b2290cf9db 100644 --- a/mods/cnc/maps/gdi04a/map.yaml +++ b/mods/cnc/maps/gdi04a/map.yaml @@ -10,8 +10,6 @@ Description: Nod has captured classified GDI property.\n\nYou must find and retr Author: Westwood Studios -PreviewVideo: gdi4b.vqa - Tileset: TEMPERAT MapSize: 64,64 @@ -22,6 +20,13 @@ UseAsShellmap: False Type: Campaign +Videos: + BackgroundInfo: bkground.vqa + Briefing: gdi4b.vqa + GameStart: nitejump.vqa + GameWon: burdet1.vqa + GameLost: gameover.vqa + Options: Cheats: False Crates: False diff --git a/mods/cnc/maps/gdi04b/gdi04b.lua b/mods/cnc/maps/gdi04b/gdi04b.lua index 96501f0d5e..c04c2c7844 100644 --- a/mods/cnc/maps/gdi04b/gdi04b.lua +++ b/mods/cnc/maps/gdi04b/gdi04b.lua @@ -126,25 +126,15 @@ WorldLoaded = function() Trigger.OnPlayerWon(gdi, function() Media.PlaySpeechNotification(gdi, "Win") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("burdet1.vqa") - end) end) Trigger.OnPlayerLost(gdi, function() Media.PlaySpeechNotification(gdi, "Lose") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("gameover.vqa") - end) end) - Media.PlayMovieFullscreen("bkground.vqa", function() - Media.PlayMovieFullscreen("nitejump.vqa", function() - gdiObjective = gdi.AddPrimaryObjective("Retrieve the crate with the stolen rods.") - reinforcementsObjective = gdi.AddSecondaryObjective("Eliminate " .. KillsUntilReinforcements .. " Nod units for reinforcements.") - nod.AddPrimaryObjective("Defend against the GDI forces.") - end) - end) + gdiObjective = gdi.AddPrimaryObjective("Retrieve the crate with the stolen rods.") + reinforcementsObjective = gdi.AddSecondaryObjective("Eliminate " .. KillsUntilReinforcements .. " Nod units for reinforcements.") + nod.AddPrimaryObjective("Defend against the GDI forces.") SetupWorld() diff --git a/mods/cnc/maps/gdi04b/map.yaml b/mods/cnc/maps/gdi04b/map.yaml index 770e70ee99..079aace9ce 100644 --- a/mods/cnc/maps/gdi04b/map.yaml +++ b/mods/cnc/maps/gdi04b/map.yaml @@ -10,8 +10,6 @@ Description: Nod has captured classified GDI property.\n\nYou must find and retr Author: Westwood Studios -PreviewVideo: gdi4b.vqa - Tileset: TEMPERAT MapSize: 64,64 @@ -22,6 +20,13 @@ UseAsShellmap: False Type: Campaign +Videos: + BackgroundInfo: bkground.vqa + Briefing: gdi4b.vqa + GameStart: nitejump.vqa + GameWon: burdet1.vqa + GameLost: gameover.vqa + Options: Crates: False Fog: True diff --git a/mods/cnc/maps/gdi04c/gdi04c.lua b/mods/cnc/maps/gdi04c/gdi04c.lua index 32f098899a..fc9e3a9f73 100644 --- a/mods/cnc/maps/gdi04c/gdi04c.lua +++ b/mods/cnc/maps/gdi04c/gdi04c.lua @@ -81,25 +81,15 @@ WorldLoaded = function() Trigger.OnPlayerWon(player, function() Media.PlaySpeechNotification(player, "Win") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("burdet1.vqa") - end) end) Trigger.OnPlayerLost(player, function() Media.PlaySpeechNotification(player, "Lose") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("gameover.vqa") - end) end) - Media.PlayMovieFullscreen("bkground.vqa", function() - Media.PlayMovieFullscreen("nodsweep.vqa", function() - nodObjective = nod.AddPrimaryObjective("Destroy all GDI troops") - gdiObjective1 = player.AddPrimaryObjective("Defend the town of Bialystok") - gdiObjective2 = player.AddPrimaryObjective("Eliminate all Nod forces in the area") - end) - end) + nodObjective = nod.AddPrimaryObjective("Destroy all GDI troops") + gdiObjective1 = player.AddPrimaryObjective("Defend the town of Bialystok") + gdiObjective2 = player.AddPrimaryObjective("Eliminate all Nod forces in the area") townAttackTrigger = false Trigger.OnExitedFootprint(TownAttackTrigger, function(a, id) diff --git a/mods/cnc/maps/gdi04c/map.yaml b/mods/cnc/maps/gdi04c/map.yaml index 9aee35cbfd..0f902080a1 100644 --- a/mods/cnc/maps/gdi04c/map.yaml +++ b/mods/cnc/maps/gdi04c/map.yaml @@ -10,8 +10,6 @@ Description: Nod is moving to capture and hold a civilian town.\n\nYour mission Author: Westwood Studios -PreviewVideo: gdi4a.vqa - Tileset: TEMPERAT MapSize: 64,64 @@ -22,6 +20,13 @@ UseAsShellmap: False Type: Campaign +Videos: + BackgroundInfo: bkground.vqa + Briefing: gdi4a.vqa + GameStart: nodsweep.vqa + GameWon: burdet1.vqa + GameLost: gameover.vqa + Options: Crates: False Fog: True diff --git a/mods/cnc/maps/nod01/map.yaml b/mods/cnc/maps/nod01/map.yaml index f400ea530b..5744194484 100644 --- a/mods/cnc/maps/nod01/map.yaml +++ b/mods/cnc/maps/nod01/map.yaml @@ -10,8 +10,6 @@ Description: In order for the Brotherhood to gain a foothold, we must begin by e Author: Westwood Studios -PreviewVideo: nod1.vqa - Tileset: DESERT MapSize: 64,64 @@ -22,6 +20,10 @@ UseAsShellmap: False Type: Campaign +Videos: + Briefing: nod1.vqa + GameLost: nodlose.vqa + Options: Crates: False Fog: True diff --git a/mods/cnc/maps/nod01/nod01.lua b/mods/cnc/maps/nod01/nod01.lua index cd3dcf9ec5..8e5a80ab65 100644 --- a/mods/cnc/maps/nod01/nod01.lua +++ b/mods/cnc/maps/nod01/nod01.lua @@ -52,9 +52,6 @@ WorldLoaded = function() Trigger.OnPlayerLost(nod, function() Media.PlaySpeechNotification(nod, "Lose") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("nodlose.vqa") - end) end) NodObjective1 = nod.AddPrimaryObjective("Kill Nikoomba") diff --git a/mods/cnc/maps/nod03a/map.yaml b/mods/cnc/maps/nod03a/map.yaml index d6541ae6ec..459fda5b22 100644 --- a/mods/cnc/maps/nod03a/map.yaml +++ b/mods/cnc/maps/nod03a/map.yaml @@ -22,6 +22,12 @@ UseAsShellmap: False Type: Campaign +Videos: + Briefing: nod3.vqa + GameStart: dessweep.vqa + GameWon: desflees.vqa + GameLost: flag.vqa + Options: Crates: False Fog: True diff --git a/mods/cnc/maps/nod03a/nod03a.lua b/mods/cnc/maps/nod03a/nod03a.lua index d1c1bb9909..ca035ea648 100644 --- a/mods/cnc/maps/nod03a/nod03a.lua +++ b/mods/cnc/maps/nod03a/nod03a.lua @@ -31,23 +31,15 @@ WorldLoaded = function() Trigger.OnPlayerWon(player, function() Media.PlaySpeechNotification(player, "Win") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("desflees.vqa") - end) end) Trigger.OnPlayerLost(player, function() Media.PlaySpeechNotification(player, "Lose") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("flag.vqa") - end) end) - Media.PlayMovieFullscreen("dessweep.vqa", function() - gdiObjective = enemy.AddPrimaryObjective("Eliminate all Nod forces in the area") - nodObjective1 = player.AddPrimaryObjective("Capture the prison") - nodObjective2 = player.AddSecondaryObjective("Destroy all GDI forces") - end) + gdiObjective = enemy.AddPrimaryObjective("Eliminate all Nod forces in the area") + nodObjective1 = player.AddPrimaryObjective("Capture the prison") + nodObjective2 = player.AddSecondaryObjective("Destroy all GDI forces") Trigger.OnCapture(TechCenter, function() Trigger.AfterDelay(DateTime.Seconds(2), function() diff --git a/mods/cnc/maps/nod03b/map.yaml b/mods/cnc/maps/nod03b/map.yaml index f704be7a0b..2e9d47b926 100644 --- a/mods/cnc/maps/nod03b/map.yaml +++ b/mods/cnc/maps/nod03b/map.yaml @@ -22,6 +22,12 @@ UseAsShellmap: False Type: Campaign +Videos: + Briefing: nod3.vqa + GameStart: dessweep.vqa + GameWon: desflees.vqa + GameLost: flag.vqa + Options: Crates: False Fog: True diff --git a/mods/cnc/maps/nod03b/nod03b.lua b/mods/cnc/maps/nod03b/nod03b.lua index a8c5609ab9..4f7e9842c0 100644 --- a/mods/cnc/maps/nod03b/nod03b.lua +++ b/mods/cnc/maps/nod03b/nod03b.lua @@ -47,23 +47,15 @@ WorldLoaded = function() Trigger.OnPlayerWon(player, function() Media.PlaySpeechNotification(player, "Win") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("desflees.vqa") - end) end) Trigger.OnPlayerLost(player, function() Media.PlaySpeechNotification(player, "Lose") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("flag.vqa") - end) end) - Media.PlayMovieFullscreen("dessweep.vqa", function() - gdiObjective = enemy.AddPrimaryObjective("Eliminate all Nod forces in the area") - nodObjective1 = player.AddPrimaryObjective("Capture the prison") - nodObjective2 = player.AddSecondaryObjective("Destroy all GDI forces") - end) + gdiObjective = enemy.AddPrimaryObjective("Eliminate all Nod forces in the area") + nodObjective1 = player.AddPrimaryObjective("Capture the prison") + nodObjective2 = player.AddSecondaryObjective("Destroy all GDI forces") Trigger.OnKilled(TechCenter, function() player.MarkFailedObjective(nodObjective1) end) Trigger.OnCapture(TechCenter, function() diff --git a/mods/ra/maps/allies-01/allies01.lua b/mods/ra/maps/allies-01/allies01.lua index d20f14ca3b..a3557a9f6d 100644 --- a/mods/ra/maps/allies-01/allies01.lua +++ b/mods/ra/maps/allies-01/allies01.lua @@ -142,14 +142,10 @@ end MissionAccomplished = function() Media.PlaySpeechNotification(player, "Win") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("snowbomb.vqa") - end) end MissionFailed = function() Media.PlaySpeechNotification(player, "Lose") - Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlayMovieFullscreen("bmap.vqa") end) end SetUnitStances = function() @@ -182,14 +178,12 @@ WorldLoaded = function() Trigger.OnPlayerLost(player, MissionFailed) Trigger.OnPlayerWon(player, MissionAccomplished) - Media.PlayMovieFullscreen("landing.vqa", function() - FindEinsteinObjective = player.AddPrimaryObjective("Find Einstein.") - TanyaSurviveObjective = player.AddPrimaryObjective("Tanya must survive.") - EinsteinSurviveObjective = player.AddPrimaryObjective("Einstein must survive.") - CivilProtectionObjective = player.AddSecondaryObjective("Protect all civilians.") + FindEinsteinObjective = player.AddPrimaryObjective("Find Einstein.") + TanyaSurviveObjective = player.AddPrimaryObjective("Tanya must survive.") + EinsteinSurviveObjective = player.AddPrimaryObjective("Einstein must survive.") + CivilProtectionObjective = player.AddSecondaryObjective("Protect all civilians.") - RunInitialActivities() - end) + RunInitialActivities() Trigger.OnKilled(Lab, LabDestroyed) Trigger.OnKilled(OilPump, OilPumpDestroyed) diff --git a/mods/ra/maps/allies-01/map.yaml b/mods/ra/maps/allies-01/map.yaml index 6d4fb202bc..194dca0b8c 100644 --- a/mods/ra/maps/allies-01/map.yaml +++ b/mods/ra/maps/allies-01/map.yaml @@ -10,8 +10,6 @@ Description: Rescue Einstein from the Headquarters inside this Soviet complex.\n Author: Westwood Studios -PreviewVideo: ally1.vqa - Tileset: SNOW MapSize: 128,128 @@ -22,6 +20,12 @@ UseAsShellmap: False Type: Campaign +Videos: + Briefing: ally1.vqa + GameStart: landing.vqa + GameWon: snowbomb.vqa + GameLost: bmap.vqa + Options: Crates: False Fog: True @@ -586,7 +590,6 @@ Rules: Scripts: allies01.lua ObjectivesPanel: PanelName: MISSION_OBJECTIVES - -StartGameNotification: TRAN.Extraction: Inherits: TRAN RenderUnit: diff --git a/mods/ra/maps/allies-02/allies02.lua b/mods/ra/maps/allies-02/allies02.lua index a332d67400..244586136f 100644 --- a/mods/ra/maps/allies-02/allies02.lua +++ b/mods/ra/maps/allies-02/allies02.lua @@ -22,16 +22,10 @@ end MissionAccomplished = function() Media.PlaySpeechNotification(player, "Win") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("montpass.vqa") - end) end MissionFailed = function() Media.PlaySpeechNotification(player, "Lose") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("frozen.vqa") - end) end Tick = function() @@ -109,9 +103,7 @@ WorldLoaded = function() Trigger.OnPlayerLost(player, MissionFailed) Trigger.OnPlayerWon(player, MissionAccomplished) - Media.PlayMovieFullscreen("mcv.vqa", function() - ConquestObjective = player.AddPrimaryObjective("Secure the area.") - end) + ConquestObjective = player.AddPrimaryObjective("Secure the area.") Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(allies, "MissionTimerInitialised") end) diff --git a/mods/ra/maps/allies-02/map.yaml b/mods/ra/maps/allies-02/map.yaml index 44b654d70c..8668f38ceb 100644 --- a/mods/ra/maps/allies-02/map.yaml +++ b/mods/ra/maps/allies-02/map.yaml @@ -10,8 +10,6 @@ Description: A critical supply convoy is due through this area in 10 minutes, bu Author: Westwood Studios -PreviewVideo: ally2.vqa - Tileset: SNOW MapSize: 128,128 @@ -22,6 +20,12 @@ UseAsShellmap: False Type: Campaign +Videos: + Briefing: ally2.vqa + GameStart: mcv.vqa + GameWon: montpass.vqa + GameLost: frozen.vqa + Options: Crates: False Fog: True @@ -881,7 +885,6 @@ Rules: Scripts: allies02.lua ObjectivesPanel: PanelName: MISSION_OBJECTIVES - -StartGameNotification: ^Vehicle: MustBeDestroyed: Tooltip: diff --git a/mods/ra/maps/allies-03a/allies03a.lua b/mods/ra/maps/allies-03a/allies03a.lua index a230e87b20..31e35483cb 100644 --- a/mods/ra/maps/allies-03a/allies03a.lua +++ b/mods/ra/maps/allies-03a/allies03a.lua @@ -114,13 +114,11 @@ InitObjectives = function() Trigger.OnPlayerLost(player, function() Trigger.AfterDelay(25, function() Media.PlaySpeechNotification(player, "Lose") - Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlayMovieFullscreen("sovtstar.vqa") end) end) end) Trigger.OnPlayerWon(player, function() Trigger.AfterDelay(25, function() Media.PlaySpeechNotification(player, "Win") - Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlayMovieFullscreen("toofar.vqa") end) end) end) end @@ -250,9 +248,7 @@ WorldLoaded = function() InitPlayers() - Media.PlayMovieFullscreen("brdgtilt.vqa", function() - InitObjectives() - InitTriggers() - SendAlliedUnits() - end) + InitObjectives() + InitTriggers() + SendAlliedUnits() end diff --git a/mods/ra/maps/allies-03a/map.yaml b/mods/ra/maps/allies-03a/map.yaml index 4d4b84c40d..08d980944a 100644 --- a/mods/ra/maps/allies-03a/map.yaml +++ b/mods/ra/maps/allies-03a/map.yaml @@ -20,6 +20,11 @@ UseAsShellmap: False Type: Campaign +Videos: + GameStart: brdgtilt.vqa + GameWon: toofar.vqa + GameLost: sovtstar.vqa + Options: Crates: False Fog: True @@ -1379,7 +1384,6 @@ Rules: Scripts: allies03a.lua ObjectivesPanel: PanelName: MISSION_OBJECTIVES - -StartGameNotification: ^Infantry: MustBeDestroyed: Tooltip: diff --git a/mods/ra/maps/soviet-01/map.yaml b/mods/ra/maps/soviet-01/map.yaml index 0aa80801f7..6281dfb4e5 100644 --- a/mods/ra/maps/soviet-01/map.yaml +++ b/mods/ra/maps/soviet-01/map.yaml @@ -20,7 +20,11 @@ UseAsShellmap: False Type: Campaign -PreviewVideo: soviet1.vqa +Videos: + Briefing: soviet1.vqa + GameStart: flare.vqa + GameWon: snstrafe.vqa + GameLost: sfrozen.vqa Options: Crates: False @@ -782,7 +786,6 @@ Rules: Scripts: soviet01.lua ObjectivesPanel: PanelName: MISSION_OBJECTIVES - -StartGameNotification: V01: LeavesHusk: HuskActor: healcrate diff --git a/mods/ra/maps/soviet-01/soviet01.lua b/mods/ra/maps/soviet-01/soviet01.lua index 60b8e60fd2..c135a5ec63 100644 --- a/mods/ra/maps/soviet-01/soviet01.lua +++ b/mods/ra/maps/soviet-01/soviet01.lua @@ -46,27 +46,16 @@ WorldLoaded = function() Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed") end) - Media.PlayMovieFullscreen("flare.vqa", function() - CivilProtectionObjective = france.AddPrimaryObjective("Protect the civilians.") - VillageRaidObjective = player.AddPrimaryObjective("Raze the village.") - JeepDemolishingBridge() - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlaySpeechNotification(player, "StartGame") - end) - end) + CivilProtectionObjective = france.AddPrimaryObjective("Protect the civilians.") + VillageRaidObjective = player.AddPrimaryObjective("Raze the village.") + JeepDemolishingBridge() Trigger.OnPlayerWon(player, function() Media.PlaySpeechNotification(player, "Win") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("snstrafe.vqa") - end) end) Trigger.OnPlayerLost(player, function() Media.PlaySpeechNotification(player, "Lose") - Trigger.AfterDelay(DateTime.Seconds(1), function() - Media.PlayMovieFullscreen("sfrozen.vqa") - end) end) Trigger.AfterDelay(DateTime.Seconds(2), InsertYaks) From e342619ac708c0bac1d31c3147d217067fc9344b Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Fri, 5 Dec 2014 22:21:51 +0100 Subject: [PATCH 3/3] Add video support to legacy map importer This enables the map importer to map the .ini video definitions to ours. The mapping generally is as follows: Intro => BackgroundInfo Brief => Briefing Action => GameStart Win => GameWon Lose => GameLost An issue in some Red Alert maps means that this mapping is not always quite correct. In those maps that do not have a 'Brief' video defined (scg03a is an example), Westwood has assigned the video that should probaby have been the 'Action' video to the 'Intro' slot instead. I can only assume that that was done due to some limitation in the original game code. Mappers will have to correct that assignment manually in those cases. --- OpenRA.Game/Map/Map.cs | 2 ++ .../UtilityCommands/LegacyMapImporter.cs | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/OpenRA.Game/Map/Map.cs b/OpenRA.Game/Map/Map.cs index ea3adcfc22..fd6b5545c9 100644 --- a/OpenRA.Game/Map/Map.cs +++ b/OpenRA.Game/Map/Map.cs @@ -408,6 +408,8 @@ namespace OpenRA root.Add(new MiniYamlNode(field, FieldSaver.FormatValue(this, f))); } + root.Add(new MiniYamlNode("Videos", FieldSaver.SaveDifferences(Videos, new MapVideos()))); + root.Add(new MiniYamlNode("Options", FieldSaver.SaveDifferences(Options, new MapOptions()))); root.Add(new MiniYamlNode("Players", null, diff --git a/OpenRA.Mods.Common/UtilityCommands/LegacyMapImporter.cs b/OpenRA.Mods.Common/UtilityCommands/LegacyMapImporter.cs index ad08442540..9339342826 100644 --- a/OpenRA.Mods.Common/UtilityCommands/LegacyMapImporter.cs +++ b/OpenRA.Mods.Common/UtilityCommands/LegacyMapImporter.cs @@ -157,6 +157,8 @@ namespace OpenRA.Mods.Common.UtilityCommands map.MapResources = Exts.Lazy(() => new CellLayer(TileShape.Rectangle, size)); map.MapTiles = Exts.Lazy(() => new CellLayer(TileShape.Rectangle, size)); + map.Videos = new MapVideos(); + map.Options = new MapOptions(); if (legacyMapFormat == IniMapFormat.RedAlert) @@ -174,6 +176,7 @@ namespace OpenRA.Mods.Common.UtilityCommands ReadCncTrees(file); } + LoadVideos(file, "BASIC"); LoadActors(file, "STRUCTURES"); LoadActors(file, "UNITS"); LoadActors(file, "INFANTRY"); @@ -502,5 +505,33 @@ namespace OpenRA.Mods.Common.UtilityCommands map.Players.Add(section, pr); } + + void LoadVideos(IniFile file, string section) + { + foreach (var s in file.GetSection(section)) + { + if (s.Value != "x" && s.Value != "") + { + switch (s.Key) + { + case "Intro": + map.Videos.BackgroundInfo = s.Value.ToLower() + ".vqa"; + break; + case "Brief": + map.Videos.Briefing = s.Value.ToLower() + ".vqa"; + break; + case "Action": + map.Videos.GameStart = s.Value.ToLower() + ".vqa"; + break; + case "Win": + map.Videos.GameWon = s.Value.ToLower() + ".vqa"; + break; + case "Lose": + map.Videos.GameLost = s.Value.ToLower() + ".vqa"; + break; + } + } + } + } } }