Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Movie Script, Sound Spawn script
anime4mage
post Apr 9 2008, 02:58 PM
Post #1


Level 5
Group Icon

Group: Member
Posts: 60
Type: Event Designer
RM Skill: Skilled




Update 4/18/08
----------------------

Main Movie Script #Author: Sound Spawn# #Enhanced Animemage#

-not recommended for Fullscreen-
-It is not recommended to use this script in a Finished Game, however use at your own risk.-
-this script will not affect game development, this is a add-on.-
--This Script was posted so Other's can help with it's development--

Here is Sound Spawns AVI script(now MPG), not mine so don't ask me how to use it.
-Works with RMXP and RMVX-

you will need at least a 640x480 video resolution in .mpg format -for RMXP-
you will need at least a 544x416 video resolution in .mpg format -for RMVX- or use Graphics.resize_screen(width, height)
(I'd suggest finding a video recoder, Converter) I like Free Video Converter(needs .net framework 2.0)
I recommend using MPEG-1, WMV7 video Codecs with 25FPS, 512kbps or 256kbps and
MP2, WMA Audio Codecs with 44100 Frequency, Stereo, and 128kbps.

#note: Full Screen Call buggy#
#Resolution that are smaller than 640x480 will lock to topleft screen; bigger than 640x480 will lose bottom and right portions of movie#

Make file called Movies in <Mydocuments>/<RMXP or RMVX>/<your project>/Movies
ie subdirectory (yourgame\data, yourgame\graphics, yourgame\movies <-put mpg files here)

Insert new script file in Script Editor under Scene_****'s
name new file - Scene_Movie
Copy and Paste code in empty script window

follow the inset instructions
CODE
##Copy this into a new section of your game.
##To play a file, move the mpg file into a "movies" subdirectory
##(yourgame\data, yourgame\graphics, yourgame\movies).
##Then call '$scene = Scene_Movie.new("filename")' where filename is your movies actual filename
## (minus the .mpg).         #exapmple Scene_Movie.new("???")
## If you want to play multiple movies in a row
##(for example before the game starts, maybe a "developed by", "produced by", "intro movie"
## set or something... Go to the "main" section of code and find the line "$scene = Scene_Title.new".
##Just after that line add:
##CODE
##Audio.bgm_play("Movies/" + 'dev_by', 100, 100) #loads movie
##Audio.bgm_play("Movies/" + 'pro_b', 100, 100) #loads movie
##Audio.bgm_play("Movies/" + 'intro', 100, 100) #loads movie
##Audio.bgm_stop
##$scene = Scene_Movie.close_scene     #closes active movie window
##$scene = Scene_Movie.new("dev_by")
##$scene = Scene_Movie.new("pro_by")
##$scene = Scene_Movie.new("intro")
##$scene = Scene_Title.new
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+".mpg"
   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)     #Remove '#' if using RMXP
#    Graphics.update                      #Remove '#' if using RMXP
    @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)           #can change or add Input::C
      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)','')

def close_scene
  $keybd = Win32API.new ('user32.dll', 'keybd_event', ['i', 'i', 'l', 'l'], 'v')
  $keybd.call 0xA4, 0, 0, 0
  $keybd.call 0x73, 0, 0, 0
  $keybd.call 0x73, 0, 2, 0
  $keybd.call 0xA4, 0, 2, 0
end
#End Movie Script#
[Show/Hide] Example

To make intro movie call script in Main(Script Editor)
Put scene_movie above scene_title - Leave Quotes in "" rename movie to your mpg file(exlude .mpg)
CODE
Audio.bgm_play("Movies/" + 'movie', 100, 100)
Audio.bgm_stop
$scene = Scene_Movie.close_scene      #closes active movie window
$scene = Scene_Movie.new("movie")
$scene = Scene_Title.new
[Show/Hide] Example

To make multiple scenes
CODE
Audio.bgm_play("Movies/" + 'splash', 100, 100)
Audio.bgm_play("Movies/" + 'developedby', 100, 100)
Audio.bgm_play("Movies/" + 'movie', 100, 100)
Audio.bgm_stop
$scene = Scene_Movie.close_scene      #closes active movie window
$scene = Scene_Movie.new("splash")
$scene = Scene_Movie.new("developedby")
$scene = Scene_Movie.new("movie.mpg") #will not work(because of '.mpg'), will skip
$scene = Scene_Title.new

To call in game; call script using 'call script event'
CODE
Audio.bgm_play("Movies/" + 'movie', 100, 100)
Audio.bgm_stop
$scene = Scene_Movie.close_scene
$scene = Scene_Movie.new("movie")
$scene = Scene_Map.new
return
------------------------------------------
#you can add this to the script; but you can just use event commands after script call
$scene = Scene_Movie.new("movie")
$game_map.events[1].erase        #Event number to erase/ if event001=[1]
$game_map.setup(1)            #Move player to map/ if map001=(1)
$game_player.moveto(0,0)        #Move Player to tile/ (0,0)=topleftcorner
$game_player.refresh            #player refresh
$scene = Scene_Map.new            #reset map
$game_map.autoplay            #load game
[Show/Hide] Example1
[Show/Hide] Example2

#don't forget to Stop BGM & BGS before script; then enable BGM & BGS after script#

This is the most complete guide to movie script I hope you like it.

All thanks and praise for script is associated to 'Sound Spawn'

--This Script was posted so Other's can help with it's development--

This post has been edited by anime4mage: May 27 2008, 07:44 AM
Attached File(s)
Attached File  Movie_Script.html ( 25.71K ) Number of downloads: 919
 


__________________________
http://www.animemage.org<< My website (^^)
Go to the top of the page
 
+Quote Post
   

Posts in this topic
- anime4mage   Movie Script   Apr 9 2008, 02:58 PM
- - anime4mage   ** Update 4/16/08 Movie script will play other fi...   Apr 16 2008, 09:39 AM
- - xerious   Great Work SS, i make good use of this ...   Apr 16 2008, 09:40 AM
- - anime4mage   Currently I am looking on how to close the active ...   Apr 16 2008, 09:52 AM
- - anime4mage   Whooo! I finally did it! I made some work...   Apr 18 2008, 01:57 PM
- - anime4mage   just a little bump and update. added some recomme...   Apr 23 2008, 07:59 AM
- - Firestalker5   I have a question..... how would you make it so it...   Apr 23 2008, 09:15 AM
- - anime4mage   Sorry for the late Reply I was busy over the weeke...   Apr 29 2008, 07:42 AM
- - Firestalker5   I managed to get the hanging script error off, but...   Apr 29 2008, 09:00 AM
- - anime4mage   Well I did say 'it may depend on your computer...   Apr 29 2008, 12:23 PM
|- - Firestalker5   QUOTE (anime4mage @ Apr 29 2008, 11:37 AM...   Apr 29 2008, 12:28 PM
- - anime4mage   try this CODEAudio.bgm_play("Movies/" ...   Apr 29 2008, 01:04 PM
- - Firestalker5   I use a WMV. I call the event from a common event...   Apr 29 2008, 01:30 PM
- - Suraksin Varja   Yo!~ first off thanks for tweaking it for VX, ...   May 9 2008, 03:23 AM
- - anime4mage   update, Ok put in some examples put in color coded...   May 27 2008, 07:47 AM
- - Elighja   So what do we change to change the movie name when...   May 30 2008, 08:20 PM
- - Automaton   so what do we do to make a moving title screen? (t...   Jul 12 2008, 09:13 AM
|- - Yanazake   QUOTE (Automaton @ Jul 12 2008, 01:27 PM)...   Jul 13 2008, 01:26 PM
- - Automaton   well do you know any title animation scripts?   Jul 14 2008, 09:18 AM
|- - Yanazake   QUOTE (Automaton @ Jul 14 2008, 01:40 PM)...   Jul 26 2008, 10:38 AM
- - kurosaki_daniel   Make file called Movies in <Mydocuments>/...   Jul 27 2008, 12:38 PM
- - Yanazake   it is saying for you to use MPG files... I'm n...   Aug 1 2008, 04:29 AM
|- - kurosaki_daniel   QUOTE (Yanazake @ Aug 1 2008, 03:51 AM) i...   Aug 5 2008, 02:23 AM
- - GunZz   Can you upload a demo ?   Aug 19 2008, 04:34 PM
- - modern-day-pirate   Could we possibly get a demo of this in action? I ...   Aug 24 2008, 07:32 PM
- - pannawat   Can you guide me to edit Graphics.resize_screen? I...   Sep 6 2008, 11:01 AM
- - miget man12   Ok... There haven't been any posts in this top...   Nov 10 2008, 04:37 PM
|- - sirSLR   QUOTE (miget man12 @ Nov 10 2008, 04:37 P...   Mar 10 2009, 08:28 AM
- - IceSageX   Edit: Nevermind, I fixed it myself.   Jan 8 2009, 01:47 AM
- - t45l   A demo would be nice as i keep getting some errors   Jan 11 2009, 07:54 AM
- - Mickadell   Comment Rate: Ok I think it's good but not exa...   Jan 17 2009, 02:53 AM
- - Tharore   Ok maybe am i getting old threads back or W/E... b...   Feb 17 2009, 12:04 PM
- - Luxofgames   Hi i did everything (hopefully) as i should i copi...   Feb 17 2009, 01:53 PM
- - Luxofgames   Ok managed to get it working, well kind of, i mana...   Feb 18 2009, 04:35 PM
- - buny   can we do it in cut scene????? and please DEMO plz...   Apr 29 2009, 05:02 PM
- - Dragon-boy   k i did everything and i am getting this response ...   May 11 2009, 06:18 PM
- - Frieza2000   I've been meaning to do this since...last year...   Jul 2 2009, 09:10 PM
- - kazemagun   Hey guys i've tried the script it works alrigh...   Jul 23 2009, 01:17 AM
- - Linkio123   PLZ help me! I know, im not the best scripter ...   Oct 23 2009, 07:30 PM
- - Linkio123   I need this script so bad!!! but nothi...   Oct 24 2009, 06:38 AM
- - oldmangreg   So basically how do you make an event to play a vi...   Feb 10 2010, 04:19 PM
- - wawodankurus   well.... it's great script, nice job for you.....   Feb 22 2010, 12:03 AM
- - ragnaroc444   I get a script error line 22 i copied the script t...   Apr 18 2010, 10:19 PM
- - VirusChris   OK, I have a small problem with this script. I k...   May 20 2010, 05:04 PM
- - deathangeltears   can anyone help me with this script im having a pr...   May 23 2010, 06:26 AM
- - VirusChris   Does anyone have a properly working movie script? ...   Jun 8 2010, 10:43 AM
- - Marwin00   Hi im have tryed all thing to make the a intro mov...   Jun 16 2010, 07:36 AM
- - Locke   Nice script there i like   Jun 17 2010, 01:52 AM
- - ryandavison   I've put a video before the title screen and i...   Jul 2 2010, 06:19 AM
- - Twell   What I was looking for, thanks anime4mage   Jul 12 2010, 05:54 AM
- - hbdj90   Hmmm, I got weird plays using this script with avi...   Aug 19 2010, 10:52 AM
- - narutoall76   wos great thank you coder i know you worked hard...   Sep 6 2010, 06:32 PM
- - goeng1225   Script error messages will be printed. ' imp...   Sep 9 2010, 08:47 PM
- - lestat2100   Yes having some trouble. tried using the first scr...   Mar 29 2012, 09:20 AM
- - pkmaster99   I keep getting the script hanging... how do I fix ...   Apr 1 2012, 05:09 PM


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 17th May 2013 - 10:46 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker