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.

fullscreen with soundspawns avi scrip, having problems..

xLeD

Member

okay so here it goes, I'm trying to get the avi script to actualy work, and I discovered that the screen adapts to the size of the video, meaning:
if you have a 640x480 video it's adapt perfectly to your original window (it'll adapt good in fullscreen aswell)

but the only problem I've encountered with this script is:
in fullscreen mode, when you run fullscrene (duh)
the video flickers, meaning that it looks like it's updating the frames all the time wich makes it look wierd... it flickers between the actual video and the gamescreen... making it look totaly wierd.
my question is: how do I fix this ? :P

here is the script:
PHP:
#================================
# .avi's in RMXP by Soundspawn
# (and I think edited by Popper)
#----------------------------------------------------------------
# Instructions                                                          
#================================
=begin
In the RPG Maker XP menu, go to Game > Open Game Folder
You'll see subfolders like Graphics and Data.  Make a new folder and call it 'Movies'.
Put your .avi movie files in that folder.  To play a movie in game, put:
    Scene_Movie.new("movie_name")
  where movie_name is the name of your .avi file WITHOUT the .avi part.
To make an intro/developed by/credits movie before your title screen, go to Main and put
    Scene_Movie.new("movie_name")
under $scene = Scene_Title.new
=end
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)','')
 

xLeD

Member

I've tried that, but it still flickers, only this time, between black and the video =/
well, it should be possible.. since if I use a 1280x720 video, then it automaticly becomes full screen with the video (without flickering) but then the game window must be normal size, not fullscreen.. if it's fullscreen, it get's messed up in some wierd way.. =/
anyone got any idea ? becouse mainly it SHOULD be possible to make it automaticly update in some way (quicker)
 
are you using vista?
With vista it flickers like crazy, you have to disable the vista transparency theme.
It doesn't even work in fullscreen with me anyway, but in windowed mode i have the flickering unless i disable the vista theme.
 

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