psychochild
Member
Hi , i would like to know if it's possible with default options or using a script to play a videoclip as an event during the game.
Thank you
Thank you
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)','')
crispychaney;229290 said:dont even need that lol
just put it in the bgs folder
then use an event to play bgs and choose the video that you want to play
provided that is its an avi format vid, not sure hwta others play
I made a event with the "Script" command and i wrote Scene_Movie.new("movie1")
movie1.avi is the name of the video.
But when i activate the event it plays just the audio of my movie
what's wrong?
##class Scene_Movie
def initialize(movie)
@readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
[B]@movie_name = Dir.getwd()+"\\Movies\\"+movie+".avi"[/B]
main
end
##class Scene_Movie
def initialize(movie)
@readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
[B]@movie_name = Dir.getwd()+"\\Movies\\"+movie+".wmv"[/B]
main
end
how can i do this? i'm not so good in video editingI suggest rerendering the video using a video editting program [movie maker is free and comes with windows if your using windows] under the "Cinepak Codec by Raduis". The video should now be in a format that anybody can view since Cinepak is an extremely common codec.
psychochild;231459 said:Hi there ,i've tried to download a cinepak codec , it was not by radius ,but it was the only one i found,
anyway
how can i do this? i'm not so good in video editing
thank you for your help
psychochild;233747 said:Thank you so much... but still nothing , it still plays just audio...now i'm downloading ACE Mega CodecS Pack 6.03 - Professional Edition almost 50 Mb of codecs , cinepak included... let's see who will win now :thumb:
If my pc will not explode with all these codecs . . . :s
Edit :
Not even this huge codec pack has solved the problem, the event activates , the music of the video starts but i still see the game screen stopped...i'm starting to give up hope
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)','')
ArgumentError occurred while running script.
wrong number of arguments (1 for 2)