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.

SoundSpawn Movie script help (don't kill me, plz)

Ok, I know you guys hate dealing with this as much as I do, but I've been trying to figure this out for months and still don't get it, so this is my last resort. And no, I can not script in ruby.

This is the script-
#   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).

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)','')

#   The call script im using is exactly as follows (test1.avi being the name of the avi file)
#   Scene_Movie.new("test1")]

Ok, so far I've made it to where the game starts. If I stick the code to an event and auto start it, the game closes. Please help. This is, indeed, my last resort. Thanks in advance. Oh yeah, and I'm using RMXP, just in case you needed to know.
 
Aside from the fact that you're calling the script wrong, I have to comment on your post. You have the first post I have seen in almost a year regarding this script that tells us not only what script you are using, but what the problem is. (well, sort of) You even provide the script! Anyway, onto the problem:

If you have an avi that the script can play, then you would call it this way:

$scene = Scene_Movie.new("test1")

You do not need the ], and you have to change the actual scene.
 
Ok, never mind. Found a working one. I think you need a certain .dll file that I found while browsing around on the Interwebz. If you want it, I have it here if you want to give it to anyone else who needs help with this.
 
extremeclay":2dg0jgqu said:
Ok, never mind. Found a working one. I think you need a certain .dll file that I found while browsing around on the Interwebz. If you want it, I have it here if you want to give it to anyone else who needs help with this.

If that was something along the lines of winmm.dll, then you already have it on your computer, unless you don't have Windows.
 
extremeclay":524ihwlg said:
Ok, never mind. Found a working one. I think you need a certain .dll file that I found while browsing around on the Interwebz. If you want it, I have it here if you want to give it to anyone else who needs help with this.
I`ve had problems with this script before... could you send me the .dll please? it may help me a lot
 
juances19":1gfwtmxw said:
I`ve had problems with this script before... could you send me the .dll please? it may help me a lot

Do you have a Windows computer? Because any computer with a version of Windows newer than Windows 3.1 will already have the .dll files that this script uses.
 

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