#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Game_Film II - reloaded ^^ # par berka # www.rpgmakervx-fr.com #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # Rgss 1&2 v 1.0 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # -Utilisation- # écrivez dans un event, commande insérer un script: # # #minimum requis: # [film] # obligatoire ! # film = monfilm.avi # ou mpg... nom du fichier à lire # # #configuration optionnelle, l'ordre n'est pas important # mettre les 4 coordonnées sinon aucune ! # x = 12 # position horizontale # y = 1 # position verticale # w = 150 # redimensionnement du film: largeur # h = 150 # redimensionnement du film: hauteur # # full = true # active (ou pas) le plein écran dans le mode fenetré # vol = 750 # entre 0 et 1000 volume sonore du film # bass = 999 # entre 0 et 1000 volume des basses: tres faible nuance # aig = 250 # entre 0 et 1000 volume des aigus: tres faible nuance # #commandes: # bouton B pour quitter, C pour interrompre/reprendre la lecture #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # pourquoi un nouveau script de video ? # simplement pour ne plus avoir à répondre à toutes ces questions sur la video ! # ce script est le plus simple possible: j'ai testé toutes les erreurs possibles # l'appel est personalisable # le format de la video est auto-détecté # ajout du plein écran # de la gestion du volume # Un dossier Films est automatiquement créé dans votre projet. # vous y déposez les vidéos à lire ! # Il vaut mieux prendre de petites videos: parce que les démos de 200 Mo... #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
class Game_Film def initialize(hash) hash.has_key?(:film) ? film=hash[:film] : return hash.has_key?(:x) ? @x=hash[:x]+" " : @x="0" hash.has_key?(:y) ? @y=hash[:y]+" " : @y="0" hash.has_key?(:w) ? @w=hash[:w]+" " : @w="" hash.has_key?(:h) ? @h=hash[:h]+" " : @h="" hash.has_key?(:vol) ? @vol=hash[:vol]+" " : @vol="1000" hash.has_key?(:bass) ? @bass=hash[:bass]+" " : @bass="1000" hash.has_key?(:aig) ? @aig=hash[:aig]+" " : @aig="1000" hash.has_key?(:pos) ? @pos="at pos #{hash[:pos].to_i*1000} " : @pos="at pos 0 " @full=hash[:full] if hash.has_key?(:full) @full&&dim_ecran !=[640,480] ? @plee="fullscreen " : @plee="" @type=" " @type=" type mpegvideo" if File.extname(film)==(".mpg"||".mpeg") @type=" type avivideo" if File.extname(film)==".avi" @nom='./Films/'+film (p "fichier #{@nom} non trouvé";return) if !FileTest.exist?(@nom) @film=Win32API.new('winmm','mciSendString','ppll','v') lecture end def handle jeu="\0"*256 ini=Win32API.new('kernel32','GetPrivateProfileStringA','pppplp', 'l') ini.call('Game','Title','',jeu,255,".\\Game.ini") return Win32API.new('user32','FindWindowEx','llpp','l').call(0,0,nil,jeu.delete!("\0")) end def lecture v,t,status,pause=version,Time.now," "*255,false @film.call("open #{@nom} alias FILE#{@type} style child parent "+handle.to_s,0,0,0) @film.call("put FILE window at #{@x}#{@y}#{@w}#{@h}",status,255,0) @film.call("setaudio File volume to #{@vol}",status,255,0) @film.call("setaudio File bass to #{@bass}",status,255,0) @film.call("setaudio File trebble to #{@bass}",status,255,0) @film.call("play FILE #{@plee} notify",status,255,handle) loop{sleep(0.1) Input.update @film.call("status FILE mode notify",status,255,0) break if status.unpack("aaaa")=="stop".split(//)||Input.trigger?(Input::B) if Input.trigger?(Input::C) if !pause;@film.call("pause FILE notify",status,255,handle);pause=true else;@film.call("play FILE #{@plee} notify",status,255,handle);pause=false end end (t=maj(t))if v=='xp'} @film.call("close FILE notify",0,0,handle) $scene=Scene_Map.new end def dim_ecran lw=Win32API.new('user32','GetSystemMetrics','i','i') return lw.call(0),lw.call(1) end def maj(t) (Graphics.update;return Time.now)if t.sec<=Time.now.sec-9||t.min !=Time.now.min return t end def version;FileTest.exist?('./Data/scripts.rvdata') ? 'vx': 'xp';end end Dir.open("./Films") rescue Dir::mkdir("./Films",0777) class Game_Interpreter;def eval(script);cmd_eval(script);end;end#rmvx class Interpreter;def eval(script);cmd_eval(script);end;end#rmxp def cmd_eval(script) if script.include?("[film]") hash={} script.gsub!("[film]"){} list=script.split("\n") list.each{|e|e.gsub!(" "){};f=e.split("=");hash[f[0].to_sym]=f[1] if !f[1].nil?} Game_Film.new(hash) else;return Kernel.eval(script) end end
recruiting: writer(for the dialogues), mapper and eventer... visit this thread to join: Grendis Recruitment Thread "You can tame a lion, but you can never make it vegetables"
Group: Member
Posts: 71
Type: Event Designer
RM Skill: Masterful
Comment Rate: Good
You have done a good job. It will be useful when I find something for to put on the game. Mostly likely anime. Thats the closest to my game. Not real life. But still very well done.
well... you can transfer the player in an empty map which contains a video launcher event. and when the video finishes, you call back the title thanks to the event command.
Things I am currently Learning: RGSS2. If you use a script you don't have to give credit :D I'm nice like that. However, if you wan't to give credit then Give Credit to Craig Ramsey.
For the past couple of months I've been learning RGSS and I've got the basic stuff down such windows, variables, conditional statements, ect. But, I can't see myself making big scripts such as a jumping system or a side view battle system. I was wondering how you learned to script because I really want to know how to script really well.
Thanks in advance.
Hey there,
Well I don't make battle neither though I can still teach you some things :)... The way I've learned to script is by reading other scripts for the most part. I've allways been interested in other peoples work but this time I though I had to try to make something myself...and it worked!! The most importand thing when you go scripting is (at least in my case) that you want to make something to help an other wich can't script. You also need to feel the competition that's around in the scripting-community. Cause, I have to say, if you get pushed to get a sertain request done before an other scripter does, you feel POWERFULL!! :P So that's an other thing... You also don't need to be afraid to learn from others or helpfiles. When I write my scripts, I actualy always have the helpfiles open to look things up I don't know or remember. Then, you must be calm, cause you need to try the script a lot of times. When I write a script, I test it after almost every changes. First I set up the major structure. Like when I make a window-script or part of a script I start with something like this:
CODE
class Window_Name < Window_Base def initialize(x,y,width,height) super(x,y,width,height) refresh end
def refresh self.contents.clear draw_contents end
def draw_contents draw_something(with, some, parameters) end
def update refresh if @something != @what_it_should_be end end
So that's also very important. Then, the biggest thing I learned scripting from is TRIAL AND ERROR. That's the most irritating way to learn something, cause it's more ERROR than TRIAL, but it does the trick realy good.
So that's it how I did it. Now it's up to you. Do some requests (if I didn't do it allready :P) and learn from them.
Hope that helped you out a little. If not, keep your eye on the Scriptology-topic (see my sig) where I'll be updating for my scripting(video)tutorials. Perhaps they're going to be usefull for you one day ;)
For the past couple of months I've been learning RGSS and I've got the basic stuff down such windows, variables, conditional statements, ect. But, I can't see myself making big scripts such as a jumping system or a side view battle system. I was wondering how you learned to script because I really want to know how to script really well.
Thanks in advance.
Hey there,
Well I don't make battle neither though I can still teach you some things :)... The way I've learned to script is by reading other scripts for the most part. I've allways been interested in other peoples work but this time I though I had to try to make something myself...and it worked!! The most importand thing when you go scripting is (at least in my case) that you want to make something to help an other wich can't script. You also need to feel the competition that's around in the scripting-community. Cause, I have to say, if you get pushed to get a sertain request done before an other scripter does, you feel POWERFULL!! :P So that's an other thing... You also don't need to be afraid to learn from others or helpfiles. When I write my scripts, I actualy always have the helpfiles open to look things up I don't know or remember. Then, you must be calm, cause you need to try the script a lot of times. When I write a script, I test it after almost every changes. First I set up the major structure. Like when I make a window-script or part of a script I start with something like this:
CODE
class Window_Name < Window_Base def initialize(x,y,width,height) super(x,y,width,height) refresh end
def refresh self.contents.clear draw_contents end
def draw_contents draw_something(with, some, parameters) end
def update refresh if @something != @what_it_should_be end end
So that's also very important. Then, the biggest thing I learned scripting from is TRIAL AND ERROR. That's the most irritating way to learn something, cause it's more ERROR than TRIAL, but it does the trick realy good.
So that's it how I did it. Now it's up to you. Do some requests (if I didn't do it allready :P) and learn from them.
Hope that helped you out a little. If not, keep your eye on the Scriptology-topic (see my sig) where I'll be updating for my scripting(video)tutorials. Perhaps they're going to be usefull for you one day ;)
all right ! it is not possible since the video is played in a new transpearent window...which is "childed" (?) with the rgss player... the rgss player is set to the background and his handle is deactivated