Vi svelerò oggi il trucco per far andare a schermo intero i video 1. Video .avi (ris. 640x480 consigliata) 2. Fare una cartella Movies e mettere dentro i filmati e rinominateli in 0.avi, 1.avi ecc... ("0" sarà un eventuale filmato prima del Title) 3. Fate ora come vi dico, attenti a seguire tutti i passaggi Video sch. int. con video iniziale Create due classi: Scene_MovieA e Scene_MovieB Incollate in A questo: class Scene_MovieA
def initialize(movie,length,x=fullscreen,y=fullscreen,x2=fullscreen,y2=fullscreen)
@readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
@movie_name = Dir.getwd()+"\\Movies\\"+movie+".avi"
@counter = length
end
def main
game_name = "\0" * 256
@readini.call('Game','Title','',game_name,255,".\\Game.ini")
game_name.delete!("\0")
Graphics.transition
@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 == fullscreen
fullscreen
Graphics.update
sleep(1)
Graphics.update
sleep(1)
Graphics.update
sleep(1)
end
@movie.call("play FILE",0,0,0)
loop do
sleep(1)
@message.call(@temp.to_i,11,0,0)
Graphics.update
@message.call(@temp.to_i,11,1,0)
Input.update
if Input.trigger?(Input::B)
break
end
@counter = @counter - 1
if @counter <= 0
break
end
end
@movie.call("close FILE",0,0,0)
$scene = Scene_Title.new
Graphics.freeze
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)','') E in B questo: class Scene_MovieB
def initialize(movie,length,x=fullscreen,y=fullscreen,x2=fullscreen,y2=fullscreen)
@readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
@movie_name = Dir.getwd()+"\\Movies\\"+movie+".avi"
@counter = length
end
def main
game_name = "\0" * 256
@readini.call('Game','Title','',game_name,255,".\\Game.ini")
game_name.delete!("\0")
Graphics.transition
@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 == fullscreen
$full = Win32API.new('user32','keybd_event','%w(l,l,l,l)','')
$full.call(18,0,0,0)
$full.call(13,0,0,0)
$full.call(18,0,2,0)
$full.call(13,0,2,0)
Graphics.update
sleep(1)
Graphics.update
sleep(1)
Graphics.update
sleep(1)
end
@movie.call("play FILE",0,0,0)
loop do
sleep(1)
@message.call(@temp.to_i,11,0,0)
Graphics.update
@message.call(@temp.to_i,11,1,0)
Input.update
if Input.trigger?(Input::B)
break
end
@counter = @counter - 1
if @counter <= 0
break
end
end
@movie.call("close FILE",0,0,0)
$scene = Scene_Map.new
Graphics.freeze
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)','') Ora cambiate su Main questo: $scene=Scene_Title.new In questo: $scene=Scene_MovieA.new("0",2) "0" è il filmato e 2 sono i secondi, cambiateli a seconda del nome e durata del video. Il video iniziale dev'essere unico. Non usatelo più volte, si potrebbe corrompere lo script. Non modificare una sillaba nello script per non interrompre il ciclo ricorrente e bloccarlo senza farlo funzionare più. Adesso in Scene_Title e precisamente sopra "def main": $full = Win32API.new('user32','keybd_event','%w(l,l,l,l)','')
$full.call(18,0,0,0)
$full.call(13,0,0,0)
$full.call(18,0,2,0)
$full.call(13,0,2,0) Così facendo, però, dovrete, per chiamare un filmato tramite evento, chiamare lo script $scene=Scene_MovieB("NOMEFILESENZAESTENZIONE", DURATAINSECONDI) video sch. int. senza video iniziale Utilizzare questo codice in una classe Scene_Movie: class Scene_Movie
def initialize(movie,length,x=fullscreen,y=fullscreen,x2=fullscreen,y2=fullscreen)
@readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
@movie_name = Dir.getwd()+"\\Movies\\"+movie+".avi"
@counter = length
end
def main
game_name = "\0" * 256
@readini.call('Game','Title','',game_name,255,".\\Game.ini")
game_name.delete!("\0")
Graphics.transition
@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
@movie.call("play FILE",0,0,0)
loop do
sleep(1)
@message.call(@temp.to_i,11,0,0)
Graphics.update
@message.call(@temp.to_i,11,1,0)
Input.update
if Input.trigger?(Input::B)
break
end
@counter = @counter - 1
if @counter <= 0
break
end
end
@movie.call("close FILE",0,0,0)
$scene = Scene_Map.new
Graphics.freeze
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)','') Anche qui in Scene_Title sopra "def main": $full = Win32API.new('user32','keybd_event','%w(l,l,l,l)','')
$full.call(18,0,0,0)
$full.call(13,0,0,0)
$full.call(18,0,2,0)
$full.call(13,0,2,0) E non cambiare niente in Main. Per chiamare lo script usare: $scene=Scene_Movie("NOMEFILESENZAESTENZIONE", DURATAINSECONDI) Per i filmati durante il gioco ci sono piccolissimi problemi. Infatti, se dopo il filmato avete messo un messaggio non lo leggerete e si mangerà anche 2 secondi del filmato. Rimedio? Se dopo il filmato dovete mettere un messaggio, ne mettete un'altro vuoto prima di questo. Esempio: $scene=Scene_MoviesB.new("3",47) Messaggio: Messaggio: Ciao! Per il filmato, basta modificarlo mettendo un'immagine nera per i primi due secondi (dico due ma vedete voi se più o meno) e il gioco è fatto! Esempio: Filmato: 5sec \=1 sec. imm. nera !=1sec filmato Filmato norm.:!!!!! Filmato modificato:\\!!!!! Un grazie è sempre gradito! ------------------------------------------------------------------------------------------------------------------------------------------ AGGIORNAMENTO DEL 24/10/11 Problema: alcuni video iniziali nn si vedono a schermo intero Risoluzione: Mettete in Scene_MovieA al posto di: if @width == fullscreen
fullscreen Questo: if @width == fullscreen
$full = Win32API.new('user32','keybd_event','%w(l,l,l,l)','')
$full.call(18,0,0,0)
$full.call(13,0,0,0)
$full.call(18,0,2,0)
$full.call(13,0,2,0) In caso di problemi, fate un commento o contattatemi via PM ---------------------------------------------------------------------------------------------------------------------------------------- ULTERIORE AGGIORNAMENTO DEL 24/10/11 Vi sto facendo un lavoretto veloce veloce, eh raga? Problema: Intermittenze nel video iniziale Risoluzione: Sostituite Scene_MovieA con questo: class Scene_MovieA
def initialize(movie,length,x=fullscreen,y=fullscreen,x2=fullscreen,y2=fullscreen)
@readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
@movie_name = Dir.getwd()+"\\Movies\\"+movie+".avi"
@counter = length
end
def main
game_name = "\0" * 256
@readini.call('Game','Title','',game_name,255,".\\Game.ini")
game_name.delete!("\0")
Graphics.transition
@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 == fullscreen
$full = Win32API.new('user32','keybd_event','%w(l,l,l,l)','')
$full.call(18,0,0,0)
$full.call(13,0,0,0)
$full.call(18,0,2,0)
$full.call(13,0,2,0)
Graphics.update
sleep(1)
Graphics.update
sleep(1)
Graphics.update
sleep(1)
end
@movie.call("play FILE",0,0,0)
Graphics.update
loop do
sleep(1)
@counter = @counter - 1
if @counter <= 0
Graphics.update
break
end
end
@movie.call("close FILE",0,0,0)
$scene = Scene_Title.new
Graphics.freeze
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)','') dopo aver incollato il codice fate applica e cliccate più volte su salva. non facendolo, mi si avviava il filmato bene e poi il gioco a finestra. Poi faccio anche per i filmati normali. x problemi contattatemi via PM