From 6e9ac71168aee5a989075ff977cc7d19bbb6b5b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 3 Feb 2013 14:58:43 +0100 Subject: [PATCH] fix GDI01 FMV problems and gunboat crash - show video not only the sound - start the game after video playback - don't crash after the win/loose movies are played - don't crash when moving the gunboat --- OpenRA.Mods.Cnc/Missions/Gdi01Script.cs | 37 ++++++++++++------------- mods/cnc-classic/maps/gdi01/map.yaml | 3 ++ 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs b/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs index d5b2b51611..43975d632a 100644 --- a/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs +++ b/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs @@ -17,8 +17,9 @@ using OpenRA.Mods.RA.Activities; using OpenRA.Mods.RA.Move; using OpenRA.Traits; using OpenRA.Widgets; +using OpenRA.Scripting; -namespace OpenRA.Mods.Cnc +namespace OpenRA.Mods.Cnc.Missions { class Gdi01ScriptInfo : TraitInfo { } @@ -34,40 +35,37 @@ namespace OpenRA.Mods.Cnc var b = w.Map.Bounds; Game.MoveViewport(new CPos(b.Left + b.Width/2, b.Top + b.Height/2).ToFloat2()); - Scripting.Media.PlayFMVFullscreen(w, "gdi1.vqa", - () => Scripting.Media.PlayFMVFullscreen(w, "landing.vqa", () => - { - Sound.PlayMusic(Rules.Music["aoi"]); - started = true; - })); + Action afterFMV = () => + { + Sound.PlayMusic(Rules.Music["aoi"]); + started = true; + }; + Game.RunAfterDelay(0, () => Media.PlayFMVFullscreen(w, "gdi1.vqa", () => + Media.PlayFMVFullscreen(w, "landing.vqa", afterFMV))); } public void OnVictory(World w) { - started = false; - Sound.PlayToPlayer(Players["GoodGuy"], "accom1.aud"); - Players["GoodGuy"].WinState = WinState.Won; - Action afterFMV = () => { + Players["GoodGuy"].WinState = WinState.Won; + started = false; Sound.StopMusic(); - Game.Disconnect(); + Sound.PlayToPlayer(Players["GoodGuy"], "accom1.aud"); }; - Game.RunAfterDelay(5000, () => Scripting.Media.PlayFMVFullscreen(w, "consyard.vqa", afterFMV)); + Game.RunAfterDelay(0, () => Media.PlayFMVFullscreen(w, "consyard.vqa", afterFMV)); } public void OnLose(World w) { - started = false; - Sound.PlayToPlayer(Players["GoodGuy"], "fail1.aud"); - Players["GoodGuy"].WinState = WinState.Lost; - Action afterFMV = () => { + Players["GoodGuy"].WinState = WinState.Lost; + started = false; Sound.StopMusic(); - Game.Disconnect(); + Sound.PlayToPlayer(Players["GoodGuy"], "fail1.aud"); }; - Game.RunAfterDelay(5000, () => Scripting.Media.PlayFMVFullscreen(w, "gameover.vqa", afterFMV)); + Game.RunAfterDelay(0, () => Media.PlayFMVFullscreen(w, "gameover.vqa", afterFMV)); } int ticks = 0; @@ -168,6 +166,7 @@ namespace OpenRA.Mods.Cnc { var self = Actors[ "Gunboat" ]; var mobile = self.Trait(); + self.Trait().stance = UnitStance.AttackAnything; //TODO: this is ignored self.QueueActivity(mobile.ScriptedMove(Actors["gunboatLeft"].Location)); self.QueueActivity(mobile.ScriptedMove(Actors["gunboatRight"].Location)); self.QueueActivity(new CallFunc(() => SetGunboatPath())); diff --git a/mods/cnc-classic/maps/gdi01/map.yaml b/mods/cnc-classic/maps/gdi01/map.yaml index 43413f51fb..520faba9ae 100644 --- a/mods/cnc-classic/maps/gdi01/map.yaml +++ b/mods/cnc-classic/maps/gdi01/map.yaml @@ -480,6 +480,9 @@ Rules: -Buildable: RMBO: -Buildable: + BOAT: + Mobile: + OnRails: false # workaround a crash Sequences: