Dragon324 16 Report post Posted May 29, 2011 I'm having a serious problem with my movie script. Script: class Scene_Movie def initialize(movie) @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l' @movie_name = Dir.getwd()+"\\Movies\\"+movie+".avi" main end def main game_name = "\0" * 256 @readini.call('Game','Title','',game_name,255,".\\Game.ini") game_name.delete!("\0") @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 Graphics.update sleep(1) Graphics.update sleep(1) Graphics.update sleep(1) end status = " " * 255 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 movie.call("status FILE mode",status,255,0) true_status = status.unpack("aaaa") if true_status.to_s != "play" break end if Input.trigger?(Input::B) Input.update break end end movie.call("close FILE",0,0,0) bail end def bail 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)','') (I set the event to $scene = Scene_Movie.new("1")) the 1 being the avi file name. The movie folder is located in my projects folder. When it starts the game just freezes, the video is only like 16s. (This is stalling me please help) Share this post Link to post Share on other sites
0 kellessdee 48 Report post Posted May 30, 2011 Do you know who wrote the script? Do they still provide support? Unfortunately win32api is not my forte...at all really. Is it absolutely necessary you play a movie? If so hopefully someone here knows win32api and can help you Share this post Link to post Share on other sites
0 Dragon324 16 Report post Posted May 30, 2011 (edited) Do you know who wrote the script? Do they still provide support? Unfortunately win32api is not my forte...at all really. Is it absolutely necessary you play a movie? If so hopefully someone here knows win32api and can help you Well not really for now I threw on what I would call a quick fix but I dont like it. Basically the movie was suppose to be the credits of who helped with the game (sprites,scripts, ect.). So with a movie I could do that fast and simple and it would look really kool. Now its just events with text with the window skin hidden that appears on the top. I thought of using pictures but idk how because I cant draw straight letters and any other program that I know of wont look that good either. Maybe if someone else has another idea that would work I'm open to suggestions. I also just thought maybe its a compatibility issue idk I'll try it in a new project. Also to answer your question I have no idea who wrote or where I got it from it was one of those anonymous things I found lol. Found an alternative thanks. Edited May 30, 2011 by Dragon324 Share this post Link to post Share on other sites
I'm having a serious problem with my movie script.
Script: class Scene_Movie
def initialize(movie)
@readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
@movie_name = Dir.getwd()+"\\Movies\\"+movie+".avi"
main
end
def main
game_name = "\0" * 256
@readini.call('Game','Title','',game_name,255,".\\Game.ini")
game_name.delete!("\0")
@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
Graphics.update
sleep(1)
Graphics.update
sleep(1)
Graphics.update
sleep(1)
end
status = " " * 255
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
movie.call("status FILE mode",status,255,0)
true_status = status.unpack("aaaa")
if true_status.to_s != "play"
break
end
if Input.trigger?(Input::B)
Input.update
break
end
end
movie.call("close FILE",0,0,0)
bail
end
def bail
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)','')
(I set the event to $scene = Scene_Movie.new("1")) the 1 being the avi file name. The movie folder is located in my projects folder. When it starts the game just freezes, the video is only like 16s.
(This is stalling me please help)
Share this post
Link to post
Share on other sites