Sakura Martinez
Member
Hello.
I want someone to help me fix a problem with how the AVI player works for my game.
It works fine when I play the movies before the Title Screen. But when I play the movie after selecting a new game, it stops at the end and doesn't load the next scene/map.
This is the script that I am using:
And this is where I placed the supposedly opening movie after selecting a new game from the Title Screen:
It's in the Scene_Title.
I have already tried placing an event on a map to play this op movie but it doesn't work. Also, when I press the 'X' and the ESC key on the keyboard, the movie ends but then it shows the title screen for a couple of seconds before proceeding to the map.
Can someone please help me fix this problem?
I want someone to help me fix a problem with how the AVI player works for my game.
It works fine when I play the movies before the Title Screen. But when I play the movie after selecting a new game, it stops at the end and doesn't load the next scene/map.
This is the script that I am using:
Code:
class Scene_Movie
def initialize(movie,length,exit_to_game=true)
@readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
@movie_name = Dir.getwd()+"\\Movies\\"+movie+".avi"
@counter = length*10
@exit_to_game = exit_to_game
main
end
def main
game_name = "\0" * 256
@readini.call('Game','Title','',game_name,255,".\\Game.ini")
game_name.delete!("\0")
Graphics.transition
@wnd = Win32API.new('user32','FindWindowEx','%w(l,l,p,p)','L')
@temp = @wnd.call(0,0,nil,game_name).to_s
@movie = Win32API.new('winmm','mciSendString','%w(p,p,l,l)','V')
@movie.call("open \""+@movie_name+"\" alias FILE style 1073741824 parent " + @temp.to_s,0,0,0)
@message = Win32API.new('user32','SendMessage','%w(l,l,l,l)','V')
@detector = Win32API.new('user32','GetSystemMetrics','%w(l)','L')
@width = @detector.call(0)
if @width == 640
fullscreen
Screen::update
sleep(1)
Screen::update
sleep(1)
Screen::update
sleep(1)
end
@movie.call("play FILE",0,0,0)
loop do
sleep(0.1)
@message.call(@temp.to_i,11,0,0)
Graphics.update
@message.call(@temp.to_i,11,1,0)
Input.update
if Input.trigger?(Input::B)
Input.update
break
end
@counter = @counter - 1
if @counter <= 0
break
end
end
@movie.call("close FILE",0,0,0)
if @exit_to_game
$scene = Scene_Map.new
else
$scene = nil
end
Graphics.freeze
if @width == 640
fullscreen
end
end
end
def fullscreen()
$full.call(18,0,0,0)
$full.call(13,0,0,0)
$full.call(18,0,2,0)
$full.call(13,0,2,0)
end
$full = Win32API.new('user32','keybd_event','%w(l,l,l,l)','')
And this is where I placed the supposedly opening movie after selecting a new game from the Title Screen:
Code:
# Move player to initial position
$scene = Scene_Movie.new("OP",178,true)
$game_player.moveto($data_system.start_x, $data_system.start_y)
It's in the Scene_Title.
I have already tried placing an event on a map to play this op movie but it doesn't work. Also, when I press the 'X' and the ESC key on the keyboard, the movie ends but then it shows the title screen for a couple of seconds before proceeding to the map.
Can someone please help me fix this problem?