Is this even possible, to play avi or other formats, is it even possible to use library files in scripts?
If so this would be very awesome, I have been working on cgi over the last year and it would be nice to add 3d cinimatics to my game.
Sure. You just need an .avi player script and that's it. You might find it even here. Just try the search button.
For an avi player script, I would go with using VirtualDub (http://www.virtualdub.org/). Don't worry, its free. You can turn the avi file into an image sequence, and extract the audio.
I don't think that's such a good idea in RMXP. It would increase the game size and the video-audio streams wouldn't be synchrnoized because RMXP might go down a few fps. This would be largely notable in longer sequences. I suggest you just get a .avi player script and play .avi files over RMXP.
this might help
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)', '')
i found it here
http://zelaron.com/forum/showthread.php?t=39921
CreationAsylum has a few movie scripts that I recall. Obviously they are not perfect, but they are pretty interesting to check out. The most famous one I know of is by SoundSpawn, and that's the second link, or at least to my knowledge.
http://www.creationasylum.net/index.php?showtopic=5107
http://www.creationasylum.net/index.php?showtopic=11838
dam it crashes in full screen mode, thats the main mode i want my game to be played in, more console like :P
Are you using the RGSS100J.dll? That's the one from PKE.
hmm RGSS102E.dll
Quote from: Mightylink on October 14, 2008, 03:52:01 am
dam it crashes in full screen mode, thats the main mode i want my game to be played in, more console like :P
Some movie scripts I remember reading aren't compatible with full screen, especially SoundSpawn. Of course, I managed to find ways through this, including when the game automatically goes into Windowed mode first and the movie plays, I can simply Alt + Enter and the movie shall become full-screened. Of course, this is annoying to do...
hmm i got it working but the problem is the video lags v_v
its a very small video, 640x480 using default windows codec
i also came up with a full screen fix but when the video plays full screen it fills with a bunch of black boxes and flickers a lot
I've been reading around again and again, and it seems to me that there's "supposedly" only one script that can play movies and that's by SoundSpawn, but unfortunately, the technology for that isn't perfect...Usually because of the codec problems...That's strange though. The older RPG Maker series can certainly play movies, why can't XP do so?
Here's the topic if you want to read a bit...Just note it's .ORG so face the evilness of that site!
http://www.rmxp.org/forums/index.php?topic=56279.msg544491
thanks for going through all the trouble, i been searching around also, google and everything
it seems no matter what codec i used they all have the exact same problems, its such a shame cause i been getting much better at cgi lately and i wanted to put my skills into the games cinimatics
ive also been trying to find a flash script but doesnt seem to be one, im afraid to go with blizzards image sequence cause it will probably use way too much power and space to be displaying 24 pictures a second.
*god points his finger at me and yell's "Screwed!!!"*
Mainly space. I can make the image screen play up to 40 images per second, but imagine how much space that would take. Also, I'd need to load a big part of those images into the cache. Imagine the RAM usage. >.<
Mightylink, there is a flash script. But, it is heavy on errors.
RMXP meets Flash v1.0 (http://www.rmxp.org/forums/index.php?topic=35668.0)
you know why not go external, .bik is a popular format for a lot of games, cant there be a script just to run a shortcut like movies/bik.exe -filename -fullscreen
something like that, the bik player automaticlly plays full screen without any window graphics around it
[EDIT]
OK, im making my own script for this with tons of custamization to it, I learned how to use variables and such, i got all the syntax down, tooks weeks of tutorials but im starting to get the hang of scripting now
hope to get it done soon, i will add all the controls to show a window or play in the game screen, full screen, custom resolutions, disable esc and all that jazz :P the bink player plays videos seamlessly over the game screen so its perfect, you cant even tell the difference you would swear the video is playing the game screen itself.
should be great
big credit and thanks to shdwlink1993 for showing me the one line of code to run shortcuts which i will now turn into many lines of code to give you lots of options to custamize the script :D
###########################################################
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
Yeaaa Thought you could use that cuz i Am! :ninja:
Quote from: Taharo on November 20, 2008, 03:03:27 am
Yeaaa Thought you could use that cuz i Am! :ninja:
Well, good work for people who are trying to search for a movie script. Though apparently I think Mightylink already solved this thing by making a script of his own (Launching the BINK player or something along those lines). It's all in this thread. http://forum.chaos-project.com/index.php?topic=2085.0
At least you saved people from clicking a link to CreationAslyum and just having Soundspawn's script here. :P
ya its still being worked on but it works lol, i been learning variables and made a very beefy config for it, over 50 options but one of them is being a pain in the ass
just like that other guys script its crashing in full screen mode... geez rpg maker really hates movie scripts, so i dont know what to do...
ive given up and come to the conclusion you cannot use anything outside rpg maker to control screen setttings, if anything other then rpg maker itself trys to modify the screen it crashes...