okay so here it goes, I'm trying to get the avi script to actualy work, and I discovered that the screen adapts to the size of the video, meaning:
if you have a 640x480 video it's adapt perfectly to your original window (it'll adapt good in fullscreen aswell)
but the only problem I've encountered with this script is:
in fullscreen mode, when you run fullscrene (duh)
the video flickers, meaning that it looks like it's updating the frames all the time wich makes it look wierd... it flickers between the actual video and the gamescreen... making it look totaly wierd.
my question is: how do I fix this ? :P
here is the script:
if you have a 640x480 video it's adapt perfectly to your original window (it'll adapt good in fullscreen aswell)
but the only problem I've encountered with this script is:
in fullscreen mode, when you run fullscrene (duh)
the video flickers, meaning that it looks like it's updating the frames all the time wich makes it look wierd... it flickers between the actual video and the gamescreen... making it look totaly wierd.
my question is: how do I fix this ? :P
here is the script:
PHP:
#================================
# .avi's in RMXP by Soundspawn
# (and I think edited by Popper)
#----------------------------------------------------------------
# Instructions
#================================
=begin
In the RPG Maker XP menu, go to Game > Open Game Folder
You'll see subfolders like Graphics and Data. Make a new folder and call it 'Movies'.
Put your .avi movie files in that folder. To play a movie in game, put:
Scene_Movie.new("movie_name")
where movie_name is the name of your .avi file WITHOUT the .avi part.
To make an intro/developed by/credits movie before your title screen, go to Main and put
Scene_Movie.new("movie_name")
under $scene = Scene_Title.new
=end
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)','')