RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Cancel movie with a button RMVXA

0 Members and 1 Guest are viewing this topic.

pokeball YinOfflineFemale
**
Rep:
Level 86
Writing a script to make the a movie play before the title screen, but I don't know how to make is so that when you press a button, the movie stops. Is there a way to cancel the movie at the press of a button? The movie plays all the way through.

pokeball YinOfflineFemale
**
Rep:
Level 86

****
Rep:
Level 71
Use this  :)
Code: [Select]
if Input.press?(:C)
 SceneManager.call(Scene_Title)
end
Check help file for other buttons, C means you hit enter or Z.

pokeball YinOfflineFemale
**
Rep:
Level 86
That works during movies? I don't think this does  ???
« Last Edit: April 21, 2012, 07:07:17 PM by Yin »

****
Rep:
Level 71
I think it might, why not give it a shot?

pokeball YinOfflineFemale
**
Rep:
Level 86
I did :x It would not skip the movie. Maybe i am doing it wrong though.

Code: [Select]
def before_title_play_movie(movie)
    movie = Movie_To_Play
    Graphics.play_movie('Movies/' + movie) unless movie.empty?
    if Input.press?(:C)
      goto_title
    end
  end

I've also tried trigger instead of press.

****
Rep:
Level 71
This may work, I think it wouldn't work because the option of cancelling isn't constant.
Code: [Select]
def update
  super
  cancel_options
end

def cancel_options
      if Input.press?(:C)
      goto_title
    end

pokeball YinOfflineFemale
**
Rep:
Level 86
Thanks. I did that before too, but it did not work. I think the update method is not called while a movie is running. I could be wrong though. But that's not working either.

Code: [Select]
# Name of movie to play
Movie_To_Play = "Movie"

class Scene_Movie
  def main
    movie=nil
    before_title_play_movie(movie)
    goto_title
  end
 
  def before_title_play_movie(movie)
    movie = Movie_To_Play
    Graphics.play_movie('Movies/' + movie) unless movie.empty?
  end
 
  def goto_title
    SceneManager.call(Scene_Title)
  end
 
  def update
  super
    cancel_options
  end

  def cancel_options
    if Input.press?(:C)
      goto_title
    end
  end
end

That's my full code. The movie keeps playing no matter what I press.

****
Rep:
Level 71
In that case I'm not sure. I highly doubt that this has any thing to do with it but wouldn't you add super after main?

pokeball YinOfflineFemale
**
Rep:
Level 86
No, there's no super class for main. (At least that's what rmvxa told me when I tried it :p)

Thanks for trying to help though. Maybe it's just a stupid limitation of rmvxa.

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Best IRC Quote2014 Zero to Hero2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
The update method is not being called, mainly because Scene_Movie should have Scene_Base as its' superclass. Also you are overwriting 'main'. The update method is not being called, therefore the Input is not being checked, so it won't go to the title until the movie is over.
it's like a metaphor or something i don't know

pokeball YinOfflineFemale
**
Rep:
Level 86
Don't think I can overwrite main if it never existed in the class. I just added Scene_Base as the superclass and added the update call (That was a total facepalm moment for me)

My code now reads like this
Code: [Select]
# Name of movie to play
Movie_To_Play = "Movie"

class Scene_Movie < Scene_Base
  def main
    movie=nil
    before_title_play_movie(movie)
    goto_title
    update
  end
 
  def before_title_play_movie(movie)
    movie = Movie_To_Play
    Graphics.play_movie('Movies/' + movie) unless movie.empty?
    update
  end
 
  def goto_title
    SceneManager.call(Scene_Title)
  end
 
  def update
  super
    cancel_options
  end

  def cancel_options
    if Input.press?(:C)
      goto_title
    end
  end
end

#if Input.press?(:C)
# SceneManager.call(Scene_Title)
#end

Still doesn't work.

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Best IRC Quote2014 Zero to Hero2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
main DOES exist. It's there. In the editor. In Scene_Base. Which is now the superclass of Scene_Movie. Which means it's in Scene_Movie.
There's a problem with this; while Graphics#play_movie is happening, the scene is not being updated. This might be fixed with this controversial method I just invented.
Code: [Select]
class << Graphics
  alias skip_plmovie play_movie
  def play_movie(*args)
    skip_plmovie(*args)
    SceneManager.scene.update if SceneManager.scene.exist?
  end
end
That might work. Not exactly sure how the play_movie method works.

EDIT:: No, that won't work. It'll only call update once the movie has finished.
Hrm...
it's like a metaphor or something i don't know

pokeball YinOfflineFemale
**
Rep:
Level 86
When I aliased main, it froze everything. I added a print in there and it was constantly printing (which means it was indeed updating I think) But it just wasn't playing the movie or recognizing my input.

Oh didn't see you edit the post  :P