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.

Help with this script [SoundSpawn's AVI Player]

This isn't my script, but I'm using it for my game. Is there a way to add to this or change so that it works in fullscreen without dropping out of fullscreen and then playing?

The script is below. Basically what I'm looking for is to be able to play the avi file while the game is in fullscreen and have the movie also fullscreen.

I don't think soundspawn is still around, but if he is I know he was working on the fullscreen feature a while ago. I'm not sure if he fixed it.

Please help... My game is looks good with the way it is, but would be better with the enhancement of fullscreen.

Thank you in advance,
Firestalker

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

S0L0

Member

Hi, I'm sorry but, your idea is to make your game fullscreen?? and you hoped people could modify that script for instead just show the fullscreen movies it would also keep your game fullscreen?? IF that is your idea then try use the newest version of his script

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

for call it use the:
Scene_Movie.new(FILENAME)

FILENAME = movie file, if file be: Intro, then use the "Intro"

for make your game as FULLSCREEN use this script:

http://www.rmxp.org/forums/showthread.php?t=4203&highlight=module+Resolution

now if you want make your game instantly fullscreen soon you launch the game, place this code over the "begin" on the "main" script:

Code:
Resolution.initialize
Resolution.fullscreen

hope this helps you
 
I can play the game in fullscreen, but when I play the movie it get out of fullscreen and goes to windowed mode to play it.

I want to play the game in fullscreen and have the movie play in fullscreen as well. So the game isn't interupted by the screen going to windowed mode and then back to fullscreen.

The version you posted SOLO is the same version I have. I was wondering if someone can fix the script so that it doesn't go into windowed mode to play the movie, it just plays the movie in fullscreen mode.

Thank you for the help though.


Can anyone help with this?
 

S0L0

Member

plz call me S0L0 not SOLO :P

anyways, I posted those 2 scripts because is what I use and it works good for me..., I see both in fullscreen, movie and the game, as i'm not any expert scrippter as several people here I try my best (wich isn' big deal) for help but :P

but I didn't full understood your issue right now, you problem now is, you play fullscreen watch movie (stil in fullscreen) then it return to game but become windowed??

OR, you play game fullscreen, then when go watch movie it become set as windowed then return to fullscreen?
 
OR, you play game fullscreen, then when go watch movie it become set as windowed then return to fullscreen?

That's the issue I'm having At the moment. I'm sorry for that... i'm not very good with names.
:*)
Thank you I'll try that way and see if it works.

Thank you
 

S0L0

Member

then I THINK I know the issue (I think :P), are your movie width less then 640 ??, because if i'm not wrong, your movie has to be 640 width minim for it become fullscreen, if your movie under it, just make a test, grab some movie you know wich the width is over 640 (can be any kind of file aslong is a .avi file (it can even be some kind of videoclip, home movie backup or anything) and try play it with the game

I stil recomend you use your movie with same size as your game resoluttion (640x480 is the default, myself I use 800x600)

anyways just test and see if works then say something :D
 
Thank you..... I do have one question though, how do you get your game into 800 x 600 resolution?

I tried the resolution script you suggested, but it only makes the screen around the game black. The looks windowed and in the top left hand corner while the rest of the screen is black.

How do get it to fill the screen with the game? Minus the black screen?
 

S0L0

Member

on this precise moment you can't, for all I found so far, for you make your game (the map itself) be with 640x480 bigger resollution you would had to change the auto tle and the tilemap class hidden script codes, and someone here had one but it was too heavy making game very but very laggy

myself I use the game in 800x600 and ALL menus and battle system are in that resolution, only map itself (fog and panorama) are using the 640x480 viewport and i'm using a hud for the rest of it :)

but back to your problem, is it fixed yet or what :) ?
 
It is fixed thank you for your help, but now the game won't return when the movie is finished playing.

You have to physically go down to the "Start" Bar at the bottom of the screen and click the game again.

Let's see if I can explain it better:

The game is playing and the movie starts. The screen blanks out for a second and the movie plays. After the movie ends the screen blanks again and you stuck looking your desktop and the little box telling you that the game in playing. You know have to go down to the bottom of the screen and press the button again.

Not really sure why it's doing that, since it wasn't doing it before. I'll keep trying.

Thank you for the help.
 

S0L0

Member

NOW that is realy a strange error, because the game itself goes "down" to the taskbar (as if was minimized) is realy weird..., but if everything works good (incluidng the fullscreens and etc) AND if you didn't changed the scripts, then my suggestion would be, try contact selwyn (hope typed his name correct) since he made the resolution script himself, and only his script might be doing some conflict with your game for making it goes minimized, so at that I realy can't help you..., so try PM him for he see this topic and see if have any idea...

Because AT that, i'm sorry but myself i'm not expert enought to know why/how your game can go to minimized ...
 

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