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
This commit is contained in:
Matthias Mailänder
2013-02-03 14:58:43 +01:00
parent 15032e3a40
commit 6e9ac71168
2 changed files with 21 additions and 19 deletions

View File

@@ -17,8 +17,9 @@ using OpenRA.Mods.RA.Activities;
using OpenRA.Mods.RA.Move; using OpenRA.Mods.RA.Move;
using OpenRA.Traits; using OpenRA.Traits;
using OpenRA.Widgets; using OpenRA.Widgets;
using OpenRA.Scripting;
namespace OpenRA.Mods.Cnc namespace OpenRA.Mods.Cnc.Missions
{ {
class Gdi01ScriptInfo : TraitInfo<Gdi01Script> { } class Gdi01ScriptInfo : TraitInfo<Gdi01Script> { }
@@ -34,40 +35,37 @@ namespace OpenRA.Mods.Cnc
var b = w.Map.Bounds; var b = w.Map.Bounds;
Game.MoveViewport(new CPos(b.Left + b.Width/2, b.Top + b.Height/2).ToFloat2()); Game.MoveViewport(new CPos(b.Left + b.Width/2, b.Top + b.Height/2).ToFloat2());
Scripting.Media.PlayFMVFullscreen(w, "gdi1.vqa", Action afterFMV = () =>
() => Scripting.Media.PlayFMVFullscreen(w, "landing.vqa", () => {
{ Sound.PlayMusic(Rules.Music["aoi"]);
Sound.PlayMusic(Rules.Music["aoi"]); started = true;
started = true; };
})); Game.RunAfterDelay(0, () => Media.PlayFMVFullscreen(w, "gdi1.vqa", () =>
Media.PlayFMVFullscreen(w, "landing.vqa", afterFMV)));
} }
public void OnVictory(World w) public void OnVictory(World w)
{ {
started = false;
Sound.PlayToPlayer(Players["GoodGuy"], "accom1.aud");
Players["GoodGuy"].WinState = WinState.Won;
Action afterFMV = () => Action afterFMV = () =>
{ {
Players["GoodGuy"].WinState = WinState.Won;
started = false;
Sound.StopMusic(); 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) public void OnLose(World w)
{ {
started = false;
Sound.PlayToPlayer(Players["GoodGuy"], "fail1.aud");
Players["GoodGuy"].WinState = WinState.Lost;
Action afterFMV = () => Action afterFMV = () =>
{ {
Players["GoodGuy"].WinState = WinState.Lost;
started = false;
Sound.StopMusic(); 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; int ticks = 0;
@@ -168,6 +166,7 @@ namespace OpenRA.Mods.Cnc
{ {
var self = Actors[ "Gunboat" ]; var self = Actors[ "Gunboat" ];
var mobile = self.Trait<Mobile>(); var mobile = self.Trait<Mobile>();
self.Trait<AutoTarget>().stance = UnitStance.AttackAnything; //TODO: this is ignored
self.QueueActivity(mobile.ScriptedMove(Actors["gunboatLeft"].Location)); self.QueueActivity(mobile.ScriptedMove(Actors["gunboatLeft"].Location));
self.QueueActivity(mobile.ScriptedMove(Actors["gunboatRight"].Location)); self.QueueActivity(mobile.ScriptedMove(Actors["gunboatRight"].Location));
self.QueueActivity(new CallFunc(() => SetGunboatPath())); self.QueueActivity(new CallFunc(() => SetGunboatPath()));

View File

@@ -480,6 +480,9 @@ Rules:
-Buildable: -Buildable:
RMBO: RMBO:
-Buildable: -Buildable:
BOAT:
Mobile:
OnRails: false # workaround a crash
Sequences: Sequences: