Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Community Calendar Today's Posts Search
Go Back   Zelaron Gaming Forum > Zelaron Gaming > RPGMaker

 
 
Thread Tools Display Modes

 
AVI Player in RMXP
Reply
Posted 2006-06-29, 04:25 PM
LO, BEHOLD, FINNALLY! I found a way to play avi files in an rmxp game! *does dance*

Class Scene_Movie
Quote:
class Scene_Movie
##Copy this into a new section of your game.
##To play a file, move the avi file into a "movies" subdirectory (yourgame\data,
##yourgame\graphics, yourgame\movies).
##Then call "Scene_Movie.new(filename)" where filename is your movies actual filename
## (minus the .avi). exp Scene_Movie.new("???")
## If you want to play multiple movies in a row
##(for example before the game starts, maybe a "developed by", "produced by", "intro movie"
## set or something... Go to the "main" section of code and find the line "$scene = Scene_Title.new".
##Just after that line add:
##CODE
##Scene_Movie.new("dev_by")
##Scene_Movie.new("pro_by")
##Scene_Movie.new("intro")
##$scene = Scene_Movie.new("intro",8,false)assuming the filename of the intro movie is "intro.avi" and it's 8 seconds long.
##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)', '')
Old
Profile PM WWW Search
Atnas shows clear signs of ignorance and confidence; the two things needed to succeed in lifeAtnas shows clear signs of ignorance and confidence; the two things needed to succeed in life
 
 
Atnas
 



 
Reply
Posted 2006-06-30, 07:59 AM in reply to Atnas's post "AVI Player in RMXP"
Well ain't that something?

Have you given it a try yet?

T'would be nice to be able to play little cutscenes.
Old
Profile PM WWW Search
Lenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basics
 
 
Lenny
 



 
Reply
Posted 2006-06-30, 09:47 AM in reply to Lenny's post starting "Well ain't that something? Have you..."
I'll be trying it out as soon as I can <.>
I'm on laptop probation right now.
Old
Profile PM WWW Search
Atnas shows clear signs of ignorance and confidence; the two things needed to succeed in lifeAtnas shows clear signs of ignorance and confidence; the two things needed to succeed in life
 
 
Atnas
 



 
Reply
Posted 2006-06-30, 02:48 PM in reply to Atnas's post starting "I'll be trying it out as soon as I can..."
Why? Didja type a bad word? Didja? Didja?
Goro goro!
Old
Profile PM WWW Search
llamallover2021 is neither ape nor machine; has so far settled for the in-betweenllamallover2021 is neither ape nor machine; has so far settled for the in-between
 
 
llamallover2021
 



 
Reply
Posted 2006-06-30, 03:05 PM in reply to llamallover2021's post starting "Why? Didja type a bad word? Didja?..."
Na... the usual... Something I didn't do... innapropriate hand gestures... 'naughty' words... Blasphemy... S'all good.
Old
Profile PM WWW Search
Atnas shows clear signs of ignorance and confidence; the two things needed to succeed in lifeAtnas shows clear signs of ignorance and confidence; the two things needed to succeed in life
 
 
Atnas
 



 
Reply
Posted 2006-07-13, 07:56 PM in reply to Atnas's post starting "Na... the usual... Something I didn't..."
so to use this script after u put it in do u go to message and put in "call FILENAME" or wut?
Old
Profile PM WWW Search
phsyco025 is neither ape nor machine; has so far settled for the in-betweenphsyco025 is neither ape nor machine; has so far settled for the in-between
 
 
phsyco025
 



 
Reply
Posted 2006-07-14, 07:47 AM in reply to phsyco025's post starting "so to use this script after u put it in..."
Scene_Movie.new(filename)

Use the call script command on the last page and replace (filename) with the name of youur movie, minus the .avi.... Let's say I had a movie named:

The Teletubbies, The Conspiracy.avi
I would just type
code said:
Scene_Movie.new(The Teletubbies, The Conspiracy)
Of course it would have to be in the said directory.... Movies.
Old
Profile PM WWW Search
Atnas shows clear signs of ignorance and confidence; the two things needed to succeed in lifeAtnas shows clear signs of ignorance and confidence; the two things needed to succeed in life
 
 
Atnas
 



 
Reply
Posted 2006-07-14, 09:57 AM in reply to Atnas's post starting "Scene_Movie.new(filename) Use the..."
kk thx and hows that tileset coming along?
Old
Profile PM WWW Search
phsyco025 is neither ape nor machine; has so far settled for the in-betweenphsyco025 is neither ape nor machine; has so far settled for the in-between
 
 
phsyco025
 



 
Reply
Posted 2006-07-14, 02:39 PM in reply to phsyco025's post starting "kk thx and hows that tileset coming..."
I have a few deadlines to meet... I'll let you know when I'm open again to finish it.(should be sunday, sorry it's taking so long, I'm really busy.)
Old
Profile PM WWW Search
Atnas shows clear signs of ignorance and confidence; the two things needed to succeed in lifeAtnas shows clear signs of ignorance and confidence; the two things needed to succeed in life
 
 
Atnas
 
 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 11:00 PM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.