Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Skipping a cutscene??  (Read 2735 times)

0 Members and 1 Guest are viewing this topic.

noxis

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 32
  • Noxis Interactive
    • View Profile
    • Noxis Media
Skipping a cutscene??
« 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?
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Skipping a cutscene??
« Reply #1 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.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Skipping a cutscene??
« Reply #2 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.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.019 seconds with 21 queries.