Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Need a movie script for RMXP

Okay, I need a movie script for RMXP, but I have a few requirements:

- It needs to work in fullscreen
- It needs to work with AVIs at least and possibly other formats
- When the player presses Enter, the movie should end and the game should go on
- The player should have no other control over the movie (eg. No rewind, no pause, etc.)

Is there any script like this that would fit my needs and is easy to use?
 
try my old video script:
Code:
#========================================== 
#                           -  Game_Film  - 
#   Rgss 1 & 2 
#---------------------------------------------------------------------------- 
#                               par berka 
#                         sur les bases de Corwin 
#---------------------------------------------------------------------------- 
# -> instructions: 
# -1-create a "Films" directory
# -2-pastle it avi files
# -3-call this script using an event, with
#      $game_film = Game_Film.new("Test.avi") 
# ou  $game_film = Game_Film.new("Test.avi", pos x, pos y, width, height) 
# ou  $game_film = Game_Film.new("Test.avi", pos x, pos y) ....etc.... 
#=========================================== 
class Game_Film 
  
  Volume = 500 #entre 0 et 1000 
  
  def initialize(film, x = 0, y= 0, w= 640, h= 480) 
    @x= x.to_s+" " #position horizontale 
    @y= y.to_s+" " #position verticale 
    @w= w.to_s+" "#largeur par default 640 
    @h= h.to_s+" " #hauteur par default 480 
    @nom = Dir.getwd()+"\\Films\\"+film # recherche de l'adresse de la video 
    @readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', '%w(p p p p l p)', 'l') #pour lire le fichier Game.ini 
    @film= Win32API.new('winmm','mciSendString','%w(p,p,l,l)','V') #gestion du media 
    @handle = Win32API.new('user32','FindWindowEx','%w(l,l,p,p)','L') #pour recuperer le handle de la fenetre 
    @message = Win32API.new('user32','SendMessage','%w(l,l,l,l)','V') #pour envoyer des infos 
    charge 
  end 
  
  def charge 
    jeu  = "\0" * 256 
    @readini.call('Game','Title','',jeu,255,".\\Game.ini")#on lit le game.ini jusqu'au string Title, on inscrit le titre dans jeu 
    jeu.delete!("\0") #on enleve tous les \0 du string 
    @temp = @handle.call(0,0,nil,jeu).to_s #on recupere la fenetre 
    @film.call("open \""+@nom+"\" alias FILE style 1073741824 parent " + @temp.to_s,0,0,0) #on ouvre le media 
    @status = " " * 255 
    lecture 
  end 
  
  def lecture 
    pause = false 
    @film.call("put FILE window at "+@x+@y+@w+@h, @status,0,0) #on positionne la fenetre du media 
    @film.call("setaudio MediaFile volume to "+Volume.to_s, @status,0,0) #on regle le volume 
    @film.call("play FILE from 0",@status,0,0) #et on lit le media 
    loop do 
      sleep(0.1) #on raffraichit 
      @message.call(@temp.to_i,11,0,0) #on envoie l'info de lecture 
      Graphics.update #mise a jour graphique 
      @message.call(@temp.to_i,11,1,0) #on envoie l'info de lecture 
      Input.update #mise a jour des touches 
      @film.call("status FILE mode",@status,255,0) #on recupere l'etat du media 
      true_status = @status.unpack("aaaa") #que l'on insere dans un tableau 
      break if true_status == "stop".split(//) #sort de la boucle si en stop 
      if Input.trigger?(Input::C) 
        Input.update 
        break 
        $scene=Scene_Title.new
      end 
    end 
    @film.call("close FILE",0,0,0) #et on ferme le fichier 
  end 
end
 
I have a script, got it from somwhere Ageeeeees ago, can't exactly remember who from, so don't kill me for not crediting.

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)','')
 
Bridgeman":22dx1wgl said:
Tried it, but the game just freezes when I try to play the movie...

Please only post scripts that you know for sure that they will work

The problem is that that script is basically the only script around that can play .avi files, and unless you know how to use it, it's not worth most people's time. (For example, you have to use very specific codecs, and you hacve to get several other things just right)
 
Glitchfinder":3kg80tky said:
Bridgeman":3kg80tky said:
Tried it, but the game just freezes when I try to play the movie...

Please only post scripts that you know for sure that they will work

The problem is that that script is basically the only script around that can play .avi files, and unless you know how to use it, it's not worth most people's time. (For example, you have to use very specific codecs, and you hacve to get several other things just right)

But it doesn't have to be AVI. Is there another script that is more easy to use? Really, if there is I'd like to know. AVI format is not a requirement.
 
NO that's NOT it, that's a P.O.S. script that requres more scripting bandages than its worth. That ridiculous script never worked for me.

For thaluvagawd can SOMEONE, like ANYONE, write a script that will simply PLAY a movie without having to perform BRAIN SURGERY? Anyone? Like PLEASE???
 
Ricoman":366vcggv said:
NO that's NOT it, that's a P.O.S. script that requres more scripting bandages than its worth. That ridiculous script never worked for me.

For thaluvagawd can SOMEONE, like ANYONE, write a script that will simply PLAY a movie without having to perform BRAIN SURGERY? Anyone? Like PLEASE???

What he said
 
OK. I think I'm going to have to explain this from the top. The reason that nobody writes these scripts is because of how they have to do it. RPG Maker XP, RPG Maker VX, and Ruby all have absolutely nothing in them that can handle playing a video. So, the two options for doing that are to either program what amounts to a hack and slash media player, from scratch, or go through something like win32API. Of course, people have only opted for going through win32API becaue it is extremely difficult to custom program a video player that can decode video and display it, much less at a reasonable speed, and including the audio (Which, with video, is basically included as a file within a file). You can't do this with Ruby, because it has to be interpreted, and it is just too slow. So, they have to go through win32API. That presents serious problems of its own. For example, win32API can only handle .avi and .wmv files without a lot of extra work (see above). Not only that, but with how you have to program it, .wmv files do not display properly. So, you are left with a severely limited set of options for .avi files. First off, you cannot use most codecs, as they are interpreted in a way that win32API cannot handle. So, you cannot use xVid, DivX, or most other new ones. Not only that, but most computers have a differenmt set of codecs, so you have to find a relatively universal codec that works with win32API. I personally like the Intel set of codecs, because anyone with an Intel processor can play your video, and it usually works.

I've found that there are two problems you encounter if the file is wrong, but the script works. The first is when the game just skips the mosvie and goes on as if nothing had happened. That happens with the wrong filetype, and possibly several codecs that win32API cannot interpret. The other probelm is when you get audio, and a blank screen where video is. That happens when you are using most of video codecs that win32API cannot handle, but the audio codec can be handled.

Finally, there is a problem with RPG Maker XP itself. With the way it was programmed, there is no way to play a video on fullscreen without the screen flickering. Instead, the only option is actually to mimic fullscreen by putting it to actual size, finding the monitor resolution (Using win32API), and temporarily resizing the screen to fit. (Also using win32API. This action actually causes some problems on certain computers, where the program has to be minimized and maximized again to get it to display properly)
 
Damn... And I thought everything could be done by scripting.

Well, it's just a simple teaser video. If it's that hard to play a video in RMXP, forget it. But I hate Enterbrain for not just including it in the event commands like they did with Rm2k3. It would have made things so easy.
 
Bridgeman":3w08pr9u said:
Damn... And I thought everything could be done by scripting.

Well, it's just a simple teaser video. If it's that hard to play a video in RMXP, forget it. But I hate Enterbrain for not just including it in the event commands like they did with Rm2k3. It would have made things so easy.
It probably can be done by scripting, if you want to work really hard. Also, I can try converting the video and putting it into a demo project, if you like.
 
So I Found A Movie Script.BUT It Does NOT Play AVI At Least I Dont Think So.I Do Not Take Credit Blah Blah...
Link:http://projectpinguin.blogspot.com/2008/10/rmxp-script-for-movie-playback.html
If Link Is Dead Copy Into Adress Bar.(First Post)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top