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.

A script for movie..

I created a company and in my game I want to add a short movie of my company from my computer..
The format of the movie is: AVI/WMV

Someone can tell me how can I do it / script it?
 
A general rule of tumb is to always use the search function but anyway...

That's the only script out there (well I think there is another who plays flash movies...). It works for some, not for others. It could depend on stuff such as the video's codec, important.

(By the way, do you really need that? I've never seen anyone actually use it in a project, unless someone can prove me wrong on that.)
 
Yes.. I really need that..
But of course if I don't have so I'll need to try to find something else ;(
I have a little video with the title of the game + the title of my company..
That why i need that ><

By the way, I need it will open the video IN THE SAME WINDOW.. It's mean I want the video will open in the same window game.. ok..?
I hope that you can find what I want..
Again, I'll be very happy if you will find it + You will get a big credit in my game [=
 
To be honest with you dude, like Zekallinos said, I've never really seen anyone use Soundspawn's AVI script, because a lot of the problems your having, a lot of others do too. I tried it myself, and I couldn't get it to work either. To save myself the trouble though, instead, i just improvised. I'm using Kain Nobels splash script, which is generally used for company logos and such, and Mogs animated title screen-Sofia to make things look more professional. Then, I'm using pictures for the inro, along with actual gameplay animation. This is just a suggestion though to you. You can still try.

Here's the script anyways
#   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")]

Since this usually doesn't work for people, some possible errors to take into consideration, is you could have a codec error, which in that case, you'll have to download some codec packs. Another thing is, depending on what scripts your using, you may have a script conflict. Also make sure you put the move into a subdirectory folder like it says in the beginning of the script. Best of luck to you.  :thumb:
 
Bluescope":2mtw7mhy said:
General information: As I just found out, you can play AVI files with RMXP in a seperate window (exits fullscreen and minimizes your Game.exe). You can play the files with the audio play event commands, like "Play [insert audio resource type]". Depending on what resource type you choose, your replay settings will slightly change (explained below). Note that your video must be in the correct directory, e.g. Audio\ME\ to be selectable from the list.

Replay from BGM command: Oversaturated movie display, looping
Replay from BGS command: Normal display, looping
Replay from ME command: Normal display, not looping
Replay from SE command: Normal display, not looping
It's not the best solution, but it works. Besides that, I haven't seen much video players except for the one made by soundspawn.
 
guitarshredderj":10fbf00y said:
To be honest with you dude, like Zekallinos said, I've never really seen anyone use Soundspawn's AVI script, because a lot of the problems your having, a lot of others do too. I tried it myself, and I couldn't get it to work either. To save myself the trouble though, instead, i just improvised. I'm using Kain Nobels splash script, which is generally used for company logos and such, and Mogs animated title screen-Sofia to make things look more professional. Then, I'm using pictures for the inro, along with actual gameplay animation. This is just a suggestion though to you. You can still try.

Here's the script anyways
#   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")]

Since this usually doesn't work for people, some possible errors to take into consideration, is you could have a codec error, which in that case, you'll have to download some codec packs. Another thing is, depending on what scripts your using, you may have a script conflict. Also make sure you put the move into a subdirectory folder like it says in the beginning of the script. Best of luck to you.  :thumb:
Thanks :) I'll try..
But I don't sure that I know how to use that.. You have ICQ? or messenger?
And you will help me there?
 
Thanks :) I'll try..
But I don't sure that I know how to use that.. You have ICQ? or messenger?
And you will help me there?

To be honest with you dude, since i don't know much about the script, i can't really go into details, plus i'm no scripter. Your better off  getting help from Glitchfinder, since he seems to know more about it. Sorry...

Best of luck to you.  :thumb:
 
The two most common problems with this script are fairly easy to troubleshoot. The first is when the script won't do anything, and it just skips to the title screen. That just means you aren't using the right filetype. (.mkv or .wmv instead of .avi) If it plays the audio, but not the video, then it means you have an incompatible codec. Just because you have a codec installed, doesn't mean it'll work. For example, avoid all codecs related to Xvid and other downloaded codecs, and stick with default ones. I always recommend using some of the codecs by Intel that come preinstalled on pretty much every windows computer. At least one of them has a good compression vs. quality ratio, and it is playable on every computer I've tested it on. There are a couple of less common issues as well. For example, you can get it to play .wmv files, but it will actually cut off a random portion of the screen, using a horizontal line as the edge between what is displaying and what isn't.
 
so...
I think my video is wmv..:(
What now? Which script i need to add to my game and what to do next?
Glitchfinder can you add me to your messenger (if you don't have so open please..) and help me there?

I'll try to talk english good there [=

Anyway, this is my messenger ID:
dinezra@hotmail.com
 
LGC admin":uc4v2u77 said:
so...
I think my video is wmv..:(
What now? Which script i need to add to my game and what to do next?
Glitchfinder can you add me to your messenger (if you don't have so open please..) and help me there?

I'll try to talk english good there [=

Anyway, this is my messenger ID:
dinezra@hotmail.com

You really should avoid posting emails if you want to avoid spambots. Also, I actually don't use a messenger. Haven't for a long time. What i'd recommend if you have a .wmv file is that you find a program like the River Past Video Cleaner, which I use to convert my videos from one type to another. Just to warn you, most of those are either very bad, or they cost money. I'd recommend one that you have to pay for, and using its free trial. (or, if you work with videos more than that, like I do, then I'd recommend actually buying it)

Edit: Ignore what I said about a video converter, they're way above most peopl's heads. If you have a reasonable video that's under 100mb, then try heading over to http://zamzar.com/ to have it converted.
 
monkeydlu":1cnubc8s said:
if anything, you can rely on Pseudo animation, lol.

Honestly, that doesn't even work for most intros. You have to really work hard to make an intro composed entirely of seperate, non-moving images like that. Oh, and it's entirely evented. Most people prefer something that at least has some motion of the chartacters. Plus, you missed the intro to the newest version of Soul Raves. It's by the same person.
 
it's not all that hard, a good 10-15 hours will do it :P

but yeah, of course it's be better with actual motion, but it's hard to do XD Since of course, the Avi script barely works, same with flash, but it's actually possible if you had your own artist and could draw seperate parts... just needs the right experimenting

I'm the one who made that btw, not sure about a new one...? XD
 
monkeydlu":2qa8qgua said:
it's not all that hard, a good 10-15 hours will do it :P

but yeah, of course it's be better with actual motion, but it's hard to do XD Since of course, the Avi script barely works, same with flash, but it's actually possible if you had your own artist and could draw seperate parts... just needs the right experimenting

I'm the one who made that btw, not sure about a new one...? XD

I meant the one for the Soul Raves Game (it is actually not the original Soul Raves). I remember it being (apparently) by the same person.
 
Lol, I'm confused, oh well. I just posted it as a joke, I doubt normal people would do something like this, but... I'm not normal x.x

my third one's already done, just waiting to get it more fixed up to post it on youtube, lol.
 

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