Toggle Chat
RM - Chat
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Video Player
#1 OFFLINE
Inviato 04 January 2012 - 08:41 PM
#2 OFFLINE
Inviato 04 January 2012 - 09:32 PM
topic1782.html
Sposto in Richieste Script RGSS2.
#3 OFFLINE
Inviato 05 January 2012 - 02:43 PM
"Script 'video' line317: RunetimeError Occurred
Il driver non può riconoscere il parametro del comando specificato"
#4 OFFLINE
Inviato 05 January 2012 - 03:38 PM
E' presente quest'altro script di trebor777:
#======================================================================
=========
# By trebor777
# Date: 26/10/2008
# Version 1.5 - Updated 27/10/2008
#-------------------------------------------------------------------------------
# RMVX Avi Player
#
# Instructions:
# Video Specification ( to ensure good playability )
# Recommended encoding: Xvid + MP3 CBR (very important to keep a constant
# bit rate for the audio, else it won't play it)
# Video Resolution : Up to 640*480
# Save the videos into a new folder called Movies in your project root folder.
#
# Call in an event(using the call script command) or in your script:
#
# Movie.play("myvideo",width,height)
# Movie.play("myvideo")
#
# By providing the dimensions of your video, if smaller than 640*480, the script
# will stretch it in the window(or in the screen if in fullscreen), to fit a
# width of 640px, but keeping the original aspect ratio.
#
# Don't need to provide the dimensions if the video is 640*480.
#===============================================================================
module Movie
attr_accessor :fps
def self.play(movie, width=Graphics.width, height=Graphics.height)
movie= "./Movies/#{movie}.avi"
fps = 24
readini= Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
wnd= Win32API.new('user32','FindWindowEx','%w(l,l,p,p)','L')
@mplayer= Win32API.new('winmm','mciSendString','%w(p,p,l,l)','V')
@detector = Win32API.new('user32','GetSystemMetrics','%w(l)','L')
timer= 1.0/fps
info= " " * 255
game_name= "\0" * 256
readini.call('Game','Title','',game_name,255,".\\Game.ini")
game_name.delete!("\0")
hwnd= wnd.call(0,0,nil,game_name).to_s
@mplayer.call("open #{movie} alias FILM style child parent #{hwnd}",0,0,0)
@mplayer.call("status FILM length",info,255,0)
movie_lenght = info.unpack("a*")[0].gsub!("\000","").to_i
info= " " * 255
@ratio = height.to_f/width
@width = 0
self.update_stretch
@mplayer.call("play FILM window",0,0,0)
loop do
sleep(timer)
Input.update
update_stretch
@mplayer.call("status FILM mode",info,255,0)
s= info.unpack("a*")[0].gsub!("\000","")
break if Input.repeat?(Input:: or s.to_s == "stopped"
end
@mplayer.call("close FILM",0,0,0)
Input.update
end
def self.update_stretch
n_w = @detector.call(0)
if @width != n_w
@width = n_w
w = (n_w == 640)? 640 : Graphics.width
h = (n_w == 640)? 480 : Graphics.height
new_height = (w*@ratio).round
@mplayer.call("put FILM window at 0 #{(h-new_height)/2} #{w} #{new_height}",0,0,0)
end
end
end
Non lo ho ancora provato, quindi non so dirti se funziona... Presumibilmente i file video devono essere in .avi, e forse c'è bisogno di qualche codec installato, tipo Xvid...Se no, se sei proprio agli inizi, e vuoi per forza usare un video nel tuo progetto, usa i tool meno recenti (cui ti farai maggiormente le ossa), oppure usa il tool nuovo (VX Ace). Questi fanno inserire già di default i video.
Ricorda però che video ed mp3 saranno simbolo di pesantezza per il progetto =)
#5 OFFLINE
Inviato 05 January 2012 - 03:47 PM
EDIT:
Trovato =)
EDIT 2:
Mi da errore qui << break if Input.repeat?(Input:: or s.to_s == "stopped" >>
ho messo la parentesi finale ma niente =(
#6 OFFLINE
Inviato 05 January 2012 - 04:02 PM
Comunque, le istruzioni sono all'interno dello script:
Citazione
# Video Specification ( to ensure good playability )
# Recommended encoding: Xvid + MP3 CBR (very important to keep a constant
# bit rate for the audio, else it won't play it)
# Video Resolution : Up to 640*480
# Save the videos into a new folder called Movies in your project root folder.
#
# Call in an event(using the call script command) or in your script:
#
# Movie.play("myvideo",width,height)
# Movie.play("myvideo")
#
# By providing the dimensions of your video, if smaller than 640*480, the script
# will stretch it in the window(or in the screen if in fullscreen), to fit a
# width of 640px, but keeping the original aspect ratio.
#
# Don't need to provide the dimensions if the video is 640*480.
Movie.play("myvideo",width,height)
Movie.play("myvideo")
Dove myvideo, dovrà essere sostituito con il nome del tuo.Quest'ultimi, dovranno essere inseriti in una cartella chiamata Movies all'interno del tuo progetto.
#7 OFFLINE
Inviato 05 January 2012 - 04:14 PM
#8 OFFLINE
Inviato 05 January 2012 - 04:17 PM
#9 OFFLINE
Inviato 05 January 2012 - 04:17 PM
#10 OFFLINE
Inviato 08 January 2012 - 06:57 PM
#11 OFFLINE
Inviato 10 January 2012 - 05:11 AM
#12 OFFLINE
Inviato 11 January 2012 - 07:48 PM
#13 OFFLINE
Inviato 12 January 2012 - 06:29 PM
Hai provato a installare il codec Xvid?
#14 OFFLINE
Inviato 13 January 2012 - 01:23 PM
#15 OFFLINE
Inviato 14 January 2012 - 08:40 PM
Prova ad installarlo e vedi se ti da errori.
Se no, posso consigliarti di usare il VX Ace che oltre ad avere features in più, ha proprio la possibilità di implementare i video senza problemi :)
1 utente(i) stanno leggendo questa discussione
0 utenti, 1 ospiti, 0 utenti anonimi











