Help - Search - Members - Calendar
Full Version: Animation help (wondering if its possible to)
RPG RPG Revolution Forums > Game Engines > RPG Maker VX Discussion
CptBuckaroo
Hi if anyone could help me out to put an animated movie part or fmv for an intro or end sequence to game i have a master's degree in both classical and computer animation i have a storyboard drawn out but i am curious if it is possible to add it in as i don't wan't to waste my time drawing it if i cant add i figure the storyboard the ending sequence is going to be 4mins and 37 seconds long roughly. so thats somewhere around 3000 drawings the frame rate i guess is about 24 frames a second so thats 12 pictures a second so as you might guess its a lot of work to put in so if someone could help me figure out putting an fmv in or what format it might need to be?
poisonshift
Features
-Windowed or Fullscreen.
- It plays seamlessly. Without flickering.
- Stretch Video to fit the window or the screen. Keeping the original video Aspect Ratio
- Skippable Video.

Video Spec
Yes there are some minor things to respect when adding a video so it can be played correctly:
- Xvid Codec
- Mp3 in CBR ( constant bit rate )
- No restricted video size, though there is not much interest of having a video wider than 640px as it will be stretched DOWN.
- Stay in control, on the maps, as it just overlays the graphics, and the Map's BGM isn't stopped. ( DOESn't mean the game is actually running or the events updated )

CODE
#======================================================================
=========
# By trebor777
# Date: 26/10/2008
# Version 1.5 - Updated 27/10/2008
#-------------------------------------------------------------------------------
# RMVX Avi Player
#
# Instructions:
# Video Specification ( to ensure good playability )
# Recommended encoding: Xvid + MP3 CBR (very important to keep a constant
# bit rate for the audio, else it won't play it)
# Video Resolution : Up to 640*480
# Save the videos into a new folder called Movies in your project root folder.
#
# Call in an event(using the call script command) or in your script:
#
# Movie.play("myvideo",width,height)
# Movie.play("myvideo")
#
# By providing the dimensions of your video, if smaller than 640*480, the script
# will stretch it in the window(or in the screen if in fullscreen), to fit a
# width of 640px, but keeping the original aspect ratio.
#
# Don't need to provide the dimensions if the video is 640*480.
#===============================================================================
module Movie
attr_accessor :fps
def self.play(movie, width=Graphics.width, height=Graphics.height)
movie= "./Movies/#{movie}.avi"
fps = 24
readini= Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
wnd= Win32API.new('user32','FindWindowEx','%w(l,l,p,p)','L')
@mplayer= Win32API.new('winmm','mciSendString','%w(p,p,l,l)','V')
@detector = Win32API.new('user32','GetSystemMetrics','%w(l)','L')
timer= 1.0/fps
info= " " * 255
game_name= "\0" * 256
readini.call('Game','Title','',game_name,255,".\\Game.ini")
game_name.delete!("\0")
hwnd= wnd.call(0,0,nil,game_name).to_s
@mplayer.call("open #{movie} alias FILM style child parent #{hwnd}",0,0,0)
@mplayer.call("status FILM length",info,255,0)
movie_lenght = info.unpack("a*")[0].gsub!("\000","").to_i
info= " " * 255
@ratio = height.to_f/width
@width = 0
self.update_stretch
@mplayer.call("play FILM window",0,0,0)
loop do
sleep(timer)
Input.update
update_stretch
@mplayer.call("status FILM mode",info,255,0)
s= info.unpack("a*")[0].gsub!("\000","")
break if Input.repeat?(Input:: or s.to_s == "stopped"
end
@mplayer.call("close FILM",0,0,0)
Input.update
end
def self.update_stretch
n_w = @detector.call(0)
if @width != n_w
@width = n_w
w = (n_w == 640)? 640 : Graphics.width
h = (n_w == 640)? 480 : Graphics.height
new_height = (w*@ratio).round
@mplayer.call("put FILM window at 0 #{(h-new_height)/2} #{w} #{new_height}",0,0,0)
end
end
end


Information
I did not create this, please give all credit to TREBOR777 for the script.
ENJOY.
bc gy
QUOTE (CptBuckaroo @ Mar 22 2010, 10:37 AM) *
Hi if anyone could help me out to put an animated movie part or fmv for an intro or end sequence to game i have a master's degree in both classical and computer animation i have a storyboard drawn out but i am curious if it is possible to add it in as i don't wan't to waste my time drawing it if i cant add i figure the storyboard the ending sequence is going to be 4mins and 37 seconds long roughly. so thats somewhere around 3000 drawings the frame rate i guess is about 24 frames a second so thats 12 pictures a second so as you might guess its a lot of work to put in so if someone could help me figure out putting an fmv in or what format it might need to be?



Well there is a script to put movie in rpg but the probleme is it cannot put it in as a intro but it can in the middle of a event
well there is the script but it is in french sorry bout I speak french so that why I toke it but ill explain if you take it

CODE
[/code]#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#                            -  Game_Film II - reloaded ^^
#  par berka
#                          www.rpgmakervx-fr.com                                          
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#  Rgss 1 & 2                  v 1.0
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#                              Utilisation
# écrivez dans un event, commande insérer un script:
#
# #minimum requis:
# [film]                # obligatoire !
# film = monfilm.avi    # ou mpg... nom du fichier à lire
#
# #configuration optionnelle, l'ordre n'est pas important
# mettre les 4 coordonnées sinon aucune !
# x = 12                # position horizontale
# y = 1                  # position verticale
# w = 150                # redimensionnement du film: largeur
# h = 150                # redimensionnement du film: hauteur
#
# full = true            # active (ou pas) le plein écran dans le mode fenetré
# vol = 750              # entre 0 et 1000 volume sonore du film
# bass = 999            # entre 0 et 1000 volume des basses: tres faible nuance
# aig = 250              # entre 0 et 1000 volume des aigus: tres faible nuance
# ret = Scene_Map
# #commandes:
# bouton B pour quitter, C pour interrompre/reprendre la lecture
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# pourquoi un nouveau script de video ?
# simplement pour ne plus avoir à répondre à toutes ces questions sur la video !
# ce script est le plus simple possible: j'ai testé toutes les erreurs possibles
# l'appel est personalisable
# le format de la video est auto-détecté
# ajout du plein écran
# de la gestion du volume
# Un dossier Films est automatiquement créé dans votre projet.
# vous y déposez les vidéos à lire !
# Il vaut mieux prendre de petites videos: parce que les démos de 200 Mo...
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

class Game_Film
  def initialize(hash)
    hash.has_key?(:film) ? film=hash[:film] : return
    hash.has_key?(:x) ? @x=hash[:x]+" " : @x="0"
    hash.has_key?(:y) ? @y=hash[:y]+" " : @y="0"
    hash.has_key?(:w) ? @w=hash[:w]+" " : @w=""
    hash.has_key?(:h) ? @h=hash[:h]+" " : @h=""
    hash.has_key?(:vol) ? @vol=hash[:vol]+" " : @vol="1000"
    hash.has_key?(:bass) ? @bass=hash[:bass]+" " : @bass="1000"
    hash.has_key?(:aig) ? @aig=hash[:aig]+" " : @aig="1000"
    hash.has_key?(:pos) ? @pos="at pos #{hash[:pos].to_i*1000} " : @pos="at pos 0 "
    @ret='$scene='<<hash[:ret]<<'.new' if hash.has_key?(:ret)
    @full=hash[:full] if hash.has_key?(:full)
    @full&&dim_ecran !=[640,480] ? @plee="fullscreen " : @plee=""
    @type=" "
    @type=" type mpegvideo" if File.extname(film)==(".mpg"||".mpeg")
    @type=" type avivideo" if File.extname(film)==".avi"
    @nom='./Films/'+film
    (p "fichier #{@nom} non trouvé";return) if !FileTest.exist?(@nom)
    @film=Win32API.new('winmm','mciSendString','ppll','v')
    lecture
  end
  def handle
    jeu="\0"*256
    ini=Win32API.new('kernel32','GetPrivateProfileStringA','pppplp', 'l')
    ini.call('Game','Title','',jeu,255,".\\Game.ini")
    return Win32API.new('user32','FindWindowEx','llpp','l').call(0,0,nil,jeu.delete!("\0"))
  end
  def lecture
    v,t,status,pause=version,Time.now," "*255,false
    @film.call("open #{@nom} alias FILE#{@type} style child parent "+handle.to_s,0,0,0)
    @film.call("put FILE window at #{@x}#{@y}#{@w}#{@h}",status,255,0)
    @film.call("setaudio File volume to #{@vol}",status,255,0)
    @film.call("setaudio File bass to #{@bass}",status,255,0)
    @film.call("setaudio File trebble to #{@aig}",status,255,0)
    @film.call("play FILE #{@plee} notify",status,255,handle)
    loop{sleep(0.1)
      Input.update
      @film.call("status FILE mode notify",status,255,0)
      break if status.unpack("aaaa")=="stop".split(//)||Input.trigger?(Input::B)
      if Input.trigger?(Input::C)
        if !pause;@film.call("pause FILE notify",status,255,handle);pause=true
        else;@film.call("play FILE #{@plee} notify",status,255,handle);pause=false
        end      
      end
      (t=maj(t))if v=='xp'}
    @film.call("close FILE notify",0,0,handle)
    @ret.nil? ? $scene=Scene_Map.new : eval(@ret)
  end
  def dim_ecran
    lw=Win32API.new('user32','GetSystemMetrics','i','i')
    return lw.call(0),lw.call(1)
  end
  def maj(t)
    (Graphics.update;return Time.now)if t.sec<=Time.now.sec-9||t.min !=Time.now.min
    return t
  end
end
Dir.open("./Films") rescue Dir::mkdir("./Films",0777)
class Game_Interpreter;def eval(script);cmd_eval(script);end;end#rmvx
class Interpreter;def eval(script);cmd_eval(script);end;end#rmxp
def cmd_eval(script)
  if script.include?("[film]")
    hash={}
    script.gsub!("[film]"){}
    list=script.split("\n")
    list.each{|e|e.gsub!(" "){};f=e.split("=");hash[f[0].to_sym]=f[1] if !f[1].nil?}
    Game_Film.new(hash)
  else;return Kernel.eval(script)
  end
end
def version;FileTest.exist?('./Data/scripts.rvdata') ? 'vx': 'xp';end
def call_film(script)
  version=='vx' ? i=Game_Interpreter : i=Interpreter
  i.new.cmd_eval(script)
end
[code]




but call a movie event you have to use advance script call and write this


CODE
[/code]
[film]
film = "monfilm.avi"
full = true
vol = 750
bass = 999
aig = 250
ret = Scene_Map
[code]


Where you see "monfilm.avi" is replace by the name of your movie dont put the " " for the name though
for the format i kinda suggest you to use if you can wmv because i notice that some format of movie doesnt work
Ill give an exemple so you can understan how it work

This script is place over main and I didnt notice any kind of script incompability with it

ex: my video name is test and format wmv

[film]
film = test.wmv
full = true
vol = 750
bass = 999
aig = 250
ret = Scene_Map

and the video should play but there is one more thing that you must do first
is create a folder call "Films" but without quotes in the your project folder(you know where there is a folder call data,graphic,ect)
and you put your video in it

Sorry if it was long hope it help.
CptBuckaroo
Thanks poisonshift i just tested it with a random video it seems to work perfectly i better get drawing then
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.