Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Stopping cutscenes  (Read 6547 times)

0 Members and 1 Guest are viewing this topic.

Banbury

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 36
  • I'm a llama! Mooh!
    • View Profile
Stopping cutscenes
« on: January 28, 2003, 08:27:00 AM »

Hi,
how do I stop scripted cutscenes with a keypress? The key event doesn't respond while the cutscene is running. Do I have to place a 'Sleep' behind every function? Does the TimeSlice functions have something to do with it (I wasn't able to call it due to lack of documentation)?

Greetings

Banbury
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Stopping cutscenes
« Reply #1 on: January 28, 2003, 10:38:52 AM »

The "Keypress" event should work no matter it a scripted sequence is running or not. I think the easiest solution would be to:

1) set up a global variable and set it to false before you execute the cutscene
2) in the "keypress" event handler set the global variable to true
3) in the cutscene script check for the value of that global variable every now and then and if it's true, then interrupt the script (by return or something...).

By calling the Sleep command, you return control to the engine. But methods like GoTo or Talk call the Sleep command automatically so you don't have to call it explicitly.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Banbury

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 36
  • I'm a llama! Mooh!
    • View Profile
Re:Stopping cutscenes
« Reply #2 on: January 28, 2003, 01:37:21 PM »

I tried to attach a script with my cutscene and then detaching in on a keypress. The event handler isn't executed though (tested it with a Msg).
I think it's a little messy to check at every line of my cutscene, if it has been canceled.

Greetings

Banbury
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Stopping cutscenes
« Reply #3 on: January 28, 2003, 01:44:02 PM »

The "keypress" handler should be in a script that is attached to the Game object, because the Game recieves the keypresses.

And...yes, it is messy. But now that you mention it, detaching the cutscene script from the keypress handler should also work and it would be a much cleaner solution.

(Sorry, I can't test it right now)
« Last Edit: January 28, 2003, 01:44:54 PM by Mnemonic »
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.034 seconds with 23 queries.