Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

3 Pages V   1 2 3 >  
Reply to this topicStart new topic
> Berka's Video script II reloaded !
berka
post Jan 16 2009, 02:39 PM
Post #1


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




Hi !

I've made a new movie's managment in rm.
It's more simple and add lots of settings:
volume managment, fullscreen mode, auto-detect file format...

puts this script above main and run the game first: a Videos directory will be created !
then add your videos files into.

and call the video with an event (call script) like this:

QUOTE
[film]
film = test.avi
aig = 999
bass = 0


the scripts:
[Show/Hide] rmvx&rmxp
CODE
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#                            -  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


the demo

enjoy !

Caution:
this script is totally free of use, but I need an apparent credit in your game and:

Do not post these scripts anywhere without my permission !

This post has been edited by berka: Feb 8 2009, 01:44 AM


__________________________
Go to the top of the page
 
+Quote Post
   
paladin99706
post Jan 16 2009, 03:35 PM
Post #2


Level 8
Group Icon

Group: Revolutionary
Posts: 124
Type: Artist
RM Skill: Skilled




Hmm.. interesting.... I'll give it a try. wink.gif


__________________________
Current project:
Silent Sword

Percentage
3.87%

Last worked on:
3/4/09


Plan: Remaking Silent Sword from scratch
Go to the top of the page
 
+Quote Post
   
dandanthedan
post Jan 16 2009, 06:33 PM
Post #3


Death Striker
Group Icon

Group: Revolutionary
Posts: 299
Type: Developer
RM Skill: Skilled




wow! ill give it a try...although im using trebor's avi player at the moment i think ill give it a try...happy.gif


__________________________
[Show/Hide] My Current Project


Box by Me


[Show/Hide] click me!



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"
Go to the top of the page
 
+Quote Post
   
berka
post Jan 17 2009, 03:43 AM
Post #4


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




I'll provide you a demo !


__________________________
Go to the top of the page
 
+Quote Post
   
omegazion
post Jan 17 2009, 07:01 AM
Post #5


Level 1 / 0
Group Icon

Group: Revolutionary
Posts: 198
Type: Scripter
RM Skill: Masterful




wow berka, you make video scripts sound so easy to make. Amazing work. (LOL, overriding the eval method, that's sexy)


__________________________

Those who live by the sword, Die by the gun.
Go to the top of the page
 
+Quote Post
   
Mickadell
post Jan 17 2009, 03:22 PM
Post #6


Level 5
Group Icon

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.
Attached File(s)
Attached File  Management.gif ( 3.26K ) Number of downloads: 12
 
Go to the top of the page
 
+Quote Post
   
berka
post Jan 18 2009, 04:09 AM
Post #7


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




thanks !

suggestions for improving this script are welcomed !


__________________________
Go to the top of the page
 
+Quote Post
   
kamster94
post Jan 20 2009, 10:54 AM
Post #8


Level 1
Group Icon

Group: Member
Posts: 10
Type: None
RM Skill: Undisclosed




can u write how to call video from Main Menu (Scene_Title)? pls
Go to the top of the page
 
+Quote Post
   
berka
post Jan 20 2009, 12:45 PM
Post #9


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




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.


__________________________
Go to the top of the page
 
+Quote Post
   
Genshyu
post Jan 20 2009, 03:11 PM
Post #10


Level 8
Group Icon

Group: Revolutionary
Posts: 118
Type: Scripter
RM Skill: Intermediate




Tried your chara gen.. AWESOME DUDE. Very nice biggrin.gif.


__________________________
My current Scripts.

[Show/Hide] Save / Load Scripts.



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.
Go to the top of the page
 
+Quote Post
   
dezet
post Jan 21 2009, 03:17 AM
Post #11



Group Icon

Group: Member
Posts: 1
Type: Developer
RM Skill: Skilled




thank you so much
Go to the top of the page
 
+Quote Post
   
SojaBird
post Jan 21 2009, 04:52 AM
Post #12


Level 51
Group Icon

Group: Revolutionary
Posts: 1,573
Type: Scripter
RM Skill: Advanced




Very nice,
Perhaps you could add a function so that you can add a border around the player tongue.gif


Anyway,
Nice.



Greatzz,
SojaBird.


__________________________
Art from the highest shelf?

Scriptology, scripting podcast



HUD's Request Lobby (multiple hud-scripts)


------------------------------------------------------------------

Random Stuff
OMG, it's Hab!!


This is a crazy drawing application! (by me)

How did I learned to script
QUOTE
Hey pim! I'm the Law G14!

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 ;)


Greatzz,
SojaBird.
Go to the top of the page
 
+Quote Post
   
berka
post Jan 21 2009, 05:00 AM
Post #13


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




QUOTE (Genshyu @ Jan 21 2009, 12:11 AM) *
Tried your chara gen.. AWESOME DUDE. Very nice biggrin.gif.

You mean The ASA Heroes Creator ?
sweat.gif

Pim321:
What kinda border ? black bord like 16:9' ?


__________________________
Go to the top of the page
 
+Quote Post
   
SojaBird
post Jan 21 2009, 09:27 AM
Post #14


Level 51
Group Icon

Group: Revolutionary
Posts: 1,573
Type: Scripter
RM Skill: Advanced




Well you know, like the vid is playing on a tv screen biggrin.gif That should be fun. (Could be done with show picture though).

Anyway,
Pure cool coding you've done so far biggrin.gif


Greatzz,
SojaBird.


__________________________
Art from the highest shelf?

Scriptology, scripting podcast



HUD's Request Lobby (multiple hud-scripts)


------------------------------------------------------------------

Random Stuff
OMG, it's Hab!!


This is a crazy drawing application! (by me)

How did I learned to script
QUOTE
Hey pim! I'm the Law G14!

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 ;)


Greatzz,
SojaBird.
Go to the top of the page
 
+Quote Post
   
berka
post Jan 21 2009, 09:59 AM
Post #15


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




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


__________________________
Go to the top of the page
 
+Quote Post
   
luciferx
post Jan 22 2009, 09:09 PM
Post #16



Group Icon

Group: Member
Posts: 1
Type: Developer
RM Skill: Skilled




Nice Script... But when i try implemented on RMXP(with RMXP Script) It has error on the middle of the movie.....

is anyone has tries on RMXP...?? Please try it....
Go to the top of the page
 
+Quote Post
   
onidsouza
post Jan 26 2009, 04:40 PM
Post #17


image master of doom
Group Icon

Group: Revolutionary
Posts: 603
Type: None
RM Skill: Undisclosed




Hey SUPER ULTRA VERY NICE MEGA COOL SCRIPT! and works perfectly! Nice Work!
I CERTANLY WILL USE THIS IN MY GAME!
Thaks!


__________________________
Gabba Gabba Hey! enjoy your life ^^
lol (by keet's brother)
some lol
more lol
even MORE lol
Serious Discussion
why all my lol's have Teh Parakeet involved?

me ^^

bacon

Spamming is always better with bacon
Go to the top of the page
 
+Quote Post
   
onidsouza
post Jan 27 2009, 04:37 PM
Post #18


image master of doom
Group Icon

Group: Revolutionary
Posts: 603
Type: None
RM Skill: Undisclosed




One thing about your script, once the video stops playing, my game window minimizes. Why? Can you fix that? I can't cuz i am BAD in the Win32API

EDIT: This when the game (not the video) is in full screenmode. When in windowed mode it works fine

This post has been edited by onidsouza: Jan 27 2009, 04:50 PM


__________________________
Gabba Gabba Hey! enjoy your life ^^
lol (by keet's brother)
some lol
more lol
even MORE lol
Serious Discussion
why all my lol's have Teh Parakeet involved?

me ^^

bacon

Spamming is always better with bacon
Go to the top of the page
 
+Quote Post
   
berka
post Jan 28 2009, 07:56 AM
Post #19


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




yeah... maybe it's a focus issue... i'll fix it !


__________________________
Go to the top of the page
 
+Quote Post
   
aznguy212
post Jan 28 2009, 08:49 AM
Post #20


Level 2
Group Icon

Group: Member
Posts: 21
Type: Artist
RM Skill: Beginner




oni please use edit your post and do not double post...it gets very annoying for some and its against the rules in almost every forum...


__________________________
I think sigs are not really necessary...
but...my name is worth a load of cash!
Go to the top of the page
 
+Quote Post
   

3 Pages V   1 2 3 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 03:32 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker