Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: noxis on October 23, 2006, 03:40:53 PM

Title: Skipping a cutscene??
Post by: noxis on October 23, 2006, 03:40:53 PM
How would I go about skipping a cutscene code wise?

For example, at the start of the game I am showing a credit sequence with text that fades in and out .. but I would like to give the option for the player to press ESC at any time to skip the sequence.  How would I go about do this?
Title: Re: Skipping a cutscene??
Post by: metamorphium on October 24, 2006, 08:16:33 AM
There are several ways how to do this. I'll present the most easy way, although I would have done it a bit differently.

Split this fading and menu scene into 2 scenes, then register in game.script

Code: [Select]
on "Keypress"
{
   if (Keyboard.KeyCode == VK_ESCAPE)
   {
      if (Scene.Name == "FadingSceneNameGoesHere") Game.ChangeScene("MenuScene");
   }
}

Another approach is having global variable, which you set instead of calling Game.ChangeScene and in your fading loops you check
if this variable changed and if so, behave accordingly.

Hope this helps.
Title: Re: Skipping a cutscene??
Post by: Mnemonic on October 24, 2006, 08:43:01 AM
And another way would be having the entire cutscene in a separate script. You'd run the cutscene by attaching the script (Scene.AttachScript("path\some_cutscene.script")) and on keypress you'd simply kill the entire script (Scene.DetachScript("path\some_cutscene.script"), thus interrupting the cutscene.