Main Menu
  • Welcome to The RPG Maker Resource Kit.

How do I make the avi player work?

Started by Anubis Vs. Jehuty, March 11, 2010, 05:40:13 AM

0 Members and 1 Guest are viewing this topic.

Anubis Vs. Jehuty

I'm really new to rgss, so can someone please explain this to me? Sorry if this is stupid.


guldurkhand

#1
Step 1. make a folder called "Movies" in your project folder
Step 2. put there your avi movie
Step 3. go to script editor
step 4. right mouse click on the list of script classes
step 5. insert a script
step 6. call it "Scene_Movie"
step 7.
copy paste this in that empty script page:


[spoiler]###########################################################
class Scene_Movie
###########################################################
#Created by SoundSpawn
###########################################################
#Fixed by Popper
###########################################################
#Instruction
#  1) Movies must in in a new folder called Movies in your directory
#  2)If you call this script from and event (EG:    Call Script: $scene = Scene_Movie.new("INTRO") )
#  3) Have fun playin movies with this script!!!
###########################################################
###########################################################
###########################################################

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(0.1)
Graphics.update
sleep(0.1)
Graphics.update
sleep(0.1)
fullscreen
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)
$scene = Scene_Map.new
break
end
end
$scene = Scene_Map.new
end

end[/spoiler]


step 8. make a new event(somewhere in the map)
step 9. insert a new event command
step 10. go to the script command(last event command of the event command list)
step 11. copy paste:
$scene = Scene_Movie.new("INTRO")
step 12. change "INTRO" in the name of the movie in your Movies folder
step 13. have fun!




this is at least what I thought but it isn't working for me(only the sound is what I hear, I can't view the video).... weird
can some super scripter help me on this, what did I do wrong?