The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Maytag on October 02, 2006, 06:30:40 AM

Title: AVI Insert Script. I need help with this.
Post by: Maytag on October 02, 2006, 06:30:40 AM
I need a quick script that will allow me to insert an AVI.. if you can get SWF to work. that would be AMAZING *SWF is Shockwave File  *or Shockwave Format**

well please someone make this script.. ive seen it on Rmxp.net but its dead now :(
Title: Re: AVI Insert Script. I need help with this.
Post by: Winged on October 02, 2006, 08:43:41 AM
http://www.hbgames.org/forums/showthread.php?t=9626

See what a lil searching can do? Have fun!

~Winged
Title: Re: AVI Insert Script. I need help with this.
Post by: Arrow on October 10, 2006, 02:54:07 AM
So this plays the movie, right? How can I make it so the menu can't be pulled up/make it work in fullscreen?

Code: [Select]
###########################################################
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
Title: Re: AVI Insert Script. I need help with this.
Post by: xxMAZxx on November 18, 2006, 08:30:33 PM
where abouts does the movies folder need to go - graphics or just the project folder?
Title: Re: AVI Insert Script. I need help with this.
Post by: :) on November 18, 2006, 08:33:30 PM
just drop it anywhere and make sure it is labled right, and see if it works
Title: Re: AVI Insert Script. I need help with this.
Post by: xxMAZxx on November 18, 2006, 08:51:41 PM
oooer nothing happens - i go to the event, accept and then the screen just flickers and nothing happens
Title: Re: AVI Insert Script. I need help with this.
Post by: xxMAZxx on November 18, 2006, 09:35:29 PM
any idea what i'm doing wrong?
the Movies folder is in my project folder
the movie is in the Movies folder
the event commnd is: Script: Scene_Movie.new("movie1")

any idea what i've missed?
Title: Re: AVI Insert Script. I need help with this.
Post by: Winged on November 19, 2006, 09:51:14 AM
It might actually need to go into a folder...I think you need to make a movie folder, I'll check

~Winged
Title: Re: AVI Insert Script. I need help with this.
Post by: :) on November 19, 2006, 04:08:02 PM
HAHAHAHA lol, it was right there read the instuctions in the script:

#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!!!
Title: Re: AVI Insert Script. I need help with this.
Post by: xxMAZxx on November 19, 2006, 04:09:38 PM
Again i say:

"the Movies folder is in my project folder
the movie is in the Movies folder
the event commnd is: Script: Scene_Movie.new("movie1")

any idea what i've missed?"
Title: Re: AVI Insert Script. I need help with this.
Post by: Blizzard on November 20, 2006, 11:50:07 AM
Should be:

Code: [Select]
$scene = Scene_Movie.new("movie1")
Title: Re: AVI Insert Script. I need help with this.
Post by: landofshadows on November 20, 2006, 01:12:39 PM
By the looks of things you need to name your movie cilp the same as the instance name "movie1.avi" I am  only guessing... I mean thats how the 3 picture animated Background script worked for me....
Title: Re: AVI Insert Script. I need help with this.
Post by: superkal1 on May 23, 2007, 06:51:39 AM
instead of
Scene=Scene_Movie.new("whatever the movie is")
Add
$scene=Scene_Movie.new("whatever the movie is")
ther we go hope it works
Title: Re: AVI Insert Script. I need help with this.
Post by: FruitBodyWash on January 02, 2009, 02:46:55 AM
Sorry to NEcro post... but.... *cringe* I am having a little trouble. I created the folder Movies, put my movie in the folder, created "Scene_Movie" and pasted the code into it, and created an event that will call the script:  $scene = Scene_Movie.new("my movie"), and I get an error saying

"Wrong number of aurguments (0 for 1)"

Does the movie folder go in the graphics folder or outside it?

I'll try again, rendering the movie (its possible there's something wrong with the AVI but.... *Shrugs*)

Also, does it have to be AVI? or could I use a different movie format?

Thanks for anyone who can help, I just spent the last 18 hours slaving over this movie (though the fact that it only last 30 seconds its not obvious) I really want to play movies throughout my game.  Thanks again!
Title: Re: AVI Insert Script. I need help with this.
Post by: theconqueror on February 05, 2009, 08:02:16 PM
Hey, If you still need help i mihgt have your solution. I have used the script before, despite me changing the folder location, it has worked for me.

After you copy and paste the script, make an event. Call Script: Scene_Movie.new("yourmovie"). Without the quotation marks it will take yourmovie as a varibale which is not specified within Scene_Movie. Despite you all saying call script: $scene = Scene_Movie.new("yourmovie") works, I have just used Scene_Movie.new("yourmovie") and it works fine for me, although saying that if it looks like it doesn't work, look at the start bar and see if your game is highlighted as if it isn't then your movie will run but you wont see anything just a blank screen.

Unless I'm using a different script which when compared doesn't seem like it. One final thought make sure the "yourmovie" is in the exact same case as it is written on the filename. This although simple is one of the most common errors, that and forgetting to put a comma. Damn syntax...

Hope that helps?
Title: Re: AVI Insert Script. I need help with this.
Post by: FruitBodyWash on February 05, 2009, 11:47:58 PM
:) thanks.  I acctually ended up giving up, then, I weeks later i tried copying and pasting it in again, all the same way, calling the script the same way, and.... viola... *shrugs* it worked.  :)