CrowMakerVX

TitleProduction1.1

Jan 21st, 2014
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 95.03 KB | None | 0 0
  1. ################################################################################
  2. #                        TITLE PRODUCTION 1.1
  3. #                           By: Ixfuru
  4. ################################################################################
  5. # This script is a powerful tool for altering the way your game starts.  It has
  6. # control over the title scene and adds a new intro part which allows you a wide
  7. # variety of controls and options.  It also has a feature to toggle preset
  8. # game switches and alter preset variables when calling a new game.
  9. ################################################################################
  10. # To use this script, you must put it above 'Main' and below 'Materials in the
  11. # script editor of your RPGMakerVX project.
  12. ################################################################################
  13. # This script is licensed under 'Creative Commons' non-commercial rights.  You
  14. # may only use this script in a commercial project if you get direct authorization
  15. # from its author, Ixfuru, who can be contacted on RPGMakerVX.net via 'The Finish
  16. # Line' user forum, on RPGMakerweb.com and RMRK.net via PM.
  17. ################################################################################
  18. # This script is NOT newb friendly.  It requires addition of a new folder
  19. # containing graphics to be added inside your 'Graphics' folder.  It also
  20. # requires a good bit of setup here in the module.  The setup herein is covered
  21. # through an abundance of instructions and examples.  If you are having
  22. # problems with the script's setup, be sure to study each section and post
  23. # in the forums where you found this script for assistance if you still can't get
  24. # it.
  25. ################################################################################
  26. module Ixfuru
  27.  
  28.   module TitleProduction
  29.    
  30.     #===========================================================================
  31.     # SECTION 1:
  32.     #
  33.     # The Folder
  34.     #
  35.     # Your first step to using the script, (after it is installed as stated
  36.     # above, is to create a folder called 'Production' and put it into the
  37.     # project's Graphics folder.  Insid the folder, you will need the
  38.     # minimum of these images:
  39.     #
  40.     # -Those using only the Title Scene functions:
  41.     #
  42.     #   -A background image 544x416 for the backdrop of your title scene
  43.     #   -An image FOR EACH of the commands you wish to have(preferrably 180x65)
  44.     #   -An image for the commands cursor(any size)
  45.     #   -An image to be used as a Logo
  46.     #
  47.     # -Those wanting the intro functions, will also require:
  48.     #
  49.     #   -A background for the intro (544x416)
  50.     #   -An image for the logo displayed on the intro(no wider than 544 x about 48)
  51.     #
  52.     #
  53.     # -For those that want to get the most out of the script, there is really
  54.     #  no actual limit to the amount of resources you can add.  This script
  55.     #  has the ability to use scrolling images called 'Planes' which can be set
  56.     #  to move in eight different directions.  It also has the ability to use
  57.     #  moving images on the Title Scene. So, after you've read over the instructions
  58.     # and get a feel for how the system works, you may add the images that best
  59.     # fit the intro/title scene you wish to create.
  60.     #===========================================================================
  61.    
  62.     #===========================================================================
  63.     # SECTION 2:
  64.     #
  65.     # Intro Skipping
  66.     #
  67.     # If you only want to use the title functions, then set the following
  68.     # constant 'SKIP_INTRO' to true and it will bypass the Intro section completely
  69.     # at runtime.  If you want to use the intro when you release your game, but
  70.     # don't want to sit through it during the playtesting, then keep this false
  71.     # until you like the way your intro looks, then set it to true for playtesting.
  72.     # Once you're ready to release the project, return here and set the value to
  73.     # false again.
  74.     #===========================================================================
  75.    
  76.     SKIP_INTRO = false
  77.    
  78.     #===========================================================================
  79.     # SECTION 3:
  80.     #
  81.     # The Intro
  82.     #
  83.     # The intro is a unique system which is much like making a little movie.  
  84.     # You are the director.  It's up to you to prepare the set and the performers
  85.     # for their given, (however brief) moments in front of the camera.  The
  86.     # first step in building the Intro is to adjust the constant variable in
  87.     # section 3a. This is where you'll set up certain parameters of your
  88.     # intro scene.  This includes the graphics used as well as some properties
  89.     # to your scrolling planes (if you choose to use any.  Next, you'll jump to
  90.     # section 3b.  In this section you will you will actually say which parts
  91.     # go where, how long they stay, as well as other characteristics of each
  92.     # segment to the section.  
  93.     #===========================================================================
  94.    
  95.     #===========================================================================
  96.     # 3a.  Intro : Graphics
  97.     #
  98.     # This section stores the graphics you will use in the intro scene.  Set up
  99.     # each one by reading the instructions for each.  Keep in mind that because
  100.     # there is no limit to the amount of sections or graphics you can use, most
  101.     # are stored in arrays, (between []s)  or hashes, (between {}s).  Those that
  102.     # are stored in hashes, typically are done so because they have a great many
  103.     # options to set for each one.  In the intro section, only the graphics
  104.     # used for 'INTRO_PLANES' are stored this way.  
  105.     #
  106.     # -intro logos-
  107.     #
  108.     # This array holds the images that you want to use for logos in the scene.
  109.     # You can place as many as you want in the array, just make sure, like
  110.     # in all graphics settings, that you have the graphic in the 'Production'
  111.     # folder you made to support its name when added.  Intro logos can show up
  112.     # and disappear with accompanying sound effects and can be placed at
  113.     # speciic x or ys.
  114.    
  115.     INTRO_LOGOS = ["FL1"]
  116.    
  117.     # -intro texts-
  118.     #
  119.     # This can be very confusing, but the INTRO_TEXTS, though ideal for display
  120.     # of text sprites, IS NOT LIMITED to this.  Any size or shape of graphic
  121.     # is possible in this section.  Just make sure it fits on the screen.
  122.     # During runtime, the intro_texts have a variety of settings which are
  123.     # set when a new graphic is called.  This includes the ability to play
  124.     # sound effects when appearing/disappearing, the ability to 'fadein' and
  125.     # fadeout.  Intro texts images can be set at specific x and y coordinates.
  126.     # All Texts images share the same viewport with the logo image.  Therefor,
  127.     # you need to set the variable called 'LOGO_TEXT_Z' to a value which defines
  128.     # how close to the screen you wish for the images to display. The background
  129.     # of the scene is always shown at a value of 0 (zero).  So, make sure you
  130.     # set the value to something above that.  
  131.    
  132.     INTRO_TEXTS = ["TextFinishLine", "TextIxfuru", "TextJWR"]
  133.     INTRO_LOGO_TEXT_Z = 50  
  134.    
  135.     # -intro planes-
  136.     #
  137.     # Planes are the moving 'parallaxes' that can be set (only one at a given time)
  138.     # in the intro section).  They are stored in the hash below and each one
  139.     # must have specific properties set as well.  The properties are:
  140.     #
  141.     #            id : this is the value which is used to call the plane at runtime
  142.     #            graphic : the graphic used as the plane
  143.     #            direction: the direction the plane will move
  144.     #                          (see -plane directions- below)
  145.     #            speed : the number of pixels the graphic will move each frame
  146.     #            opacity : transparency (0-255)
  147.     #            z : how close the plane appears to the screen.
  148.     #
  149.     # ****IXFURU TRICKS***
  150.     # You can give the appearance of an overlayed background by keeping the
  151.     # intro plane stationary.  This is done by setting the plane at a semi-transparent
  152.     # opacity and setting the ':speed' property to 0.  Also, you can block out
  153.     # the background completely by making the opacity 255.  If you do this, make
  154.     # sure that you have the 'LOGO_TEXT_Z' from above set to a value greater
  155.     # than that of the plane, or the plane will also cover the texts and logos.
  156.     # ********************
  157.    
  158.     # -plane directions-
  159.     #
  160.     # There are eight different directions the planes can travel, you signify
  161.     # the direction you wish for the plane to move by giving the :direction
  162.     # property a value 0-7.  Here is a list of the values and the directions
  163.     # the plane will move accordingly:
  164.     #
  165.     #      0 : top left to bottom right diagonal
  166.     #      1 : top to bottom
  167.     #      2 : top right to bottom left diagonal
  168.     #      3 : left to right
  169.     #      4 : right to left
  170.     #      5 : bottom right to top left diagonal
  171.     #      6 : bottom to top
  172.     #      7 : bottom right to top left
  173.    
  174.     INTRO_PLANES = {
  175.    
  176.     0 => {:graphic => "IntroPlane",
  177.           :direction => 3,
  178.           :speed => 2,
  179.           :opacity => 95,
  180.           :z => 100},
  181.          
  182.     }
  183.    
  184.     INTRO_PLANE_VIEWPORT_Z = 40
  185.    
  186.     # -intro backgrounds-
  187.     #
  188.     # The intro background doesn't have very many properties.  It's just an image
  189.     # that is used for the backdrop of the intro sequence.  Only one background
  190.     # can be displayed at any given time.  It is ALWAYS set to a Z value of 0 (zero)
  191.     # and always set to appear at x 0, y 0.  Make sure that if you want the
  192.     # backgrounds to cover the entire screen, they are 544 x 416.  The background
  193.     # appearing and disappearing can be set to have an accompanying sound effect.
  194.     #
  195.     # ***IXFURUS TRICKS***
  196.     # Though it is imperative to have a background image that fully covers the
  197.     # screen in size, you can create a 'sliver' type background, (or one that
  198.     # only covers a portion of the background, by creating an image 544x416, but
  199.     # having whatever portion you want to be transparent.  
  200.     # ********************
  201.    
  202.     INTRO_BACKGROUNDS = ["IntroBack"]
  203.    
  204.     # -intro transition-
  205.     #
  206.     # Set this constant variable to the graphic you want to use as the
  207.     # transition (kind of like entering a battle) between the intro and when
  208.     # the title scene appears.  In this version of the script, the transition
  209.     # is still buggy and it is possible to bypass this by using an empty
  210.     # string ("") for this value.
  211.    
  212.     INTRO_TRANSITION = "Transition"
  213.    
  214.     # -intro animated objects-
  215.     #
  216.     # Animated Objects are images found in their own folder and named by
  217.     # index of their animation sequence.  That is, 0, 1, 2, 3, etc.  These
  218.     # indicate the frame of the sequence in which they're shown.  When you create
  219.     # an animated object, you are actually creating a 'Sprite_Base'.  This bears
  220.     # an important difference in those images which are displayed for 'texts' and
  221.     # 'logo'.  That is, they can have animations from the database played upon
  222.     # them.  To set up the animated objects, you have to use the hash below and
  223.     # this formula:
  224.     #
  225.     # object_id => {:folder => folder_name,
  226.     #               :frames => {index => {:se => sound_effect_id,
  227.     #                                     :animation => animation_id,
  228.     #                                     :flash_self => [[red, green, blue], duration],
  229.     #                                     :flash_viewport => [[red, green, blue], duration],
  230.     #                                     :x => x_coordinate,
  231.     #                                     :y => y_coordinate,
  232.     #                                     :zoom => zoom_ratio,
  233.     #                                     :time => frame_count_of_index
  234.     #                                     :opacity => transparency(0-255)
  235.     #                                     :stay => should_index_image_stay_visible?},
  236.     #               :linger => image_stays_after_animation? (true or false)
  237.     #               },
  238.     #
  239.     # object_id : this is the reference id value which will be used to call the
  240.     #             specific animated object into effect.
  241.     #
  242.     # :folder : place the name of the subfolder from your Production folder where
  243.     #           the images of the animated object are found.
  244.     #
  245.     # :frames : setting up the frames takes some time, but it has many powerful
  246.     #           properties which can make the animated object move and flash and
  247.     #           even have a database animation played upon it.  To create one,
  248.     #           you need to set each property as follows:
  249.     #
  250.     #            1) se : this is the sound effect that is played when the frame begins.
  251.     #                    Use 'nil' for no sound effect.
  252.    
  253.     #            2) animation : this is the database animation you can play upon it.
  254.     #                          You just need to render the id of the animation you
  255.     #                          wish to choose. You can use 'nil' to bypass the
  256.     #                          option for the given index.
  257.    
  258.     #            3) flash_self : this is a two-element array which holds the color
  259.     #                          and duration of a flash you wish to use for
  260.     #                          the frame.  You can use and empty array [] or 'nil'
  261.     #                          to bypass this option.  If you use it, you must
  262.     #                          provide the first element array a RGB color and the
  263.     #                         second element with a duration for the how long the
  264.     #                         flash should last.
  265.    
  266.     #            4) flash_viewport : this is the same as flash self, however, when
  267.     #                            this occurs, it flashes the screen, not the
  268.     #                           actual object. 'nil' or '[]' defines no flash.
  269.    
  270.     #            5)x and y : these two values set the actual x and y coordinate of
  271.     #                         where the animation should be shown on the screen.
  272.    
  273.     #            6) zoom : this is the float value (decimal point) value which
  274.     #                       determines how zoomed in or out the object appears
  275.     #                       from its normal size.  1.0 is actual size of the image.
  276.    
  277.     #            7) time : this is the actual amount of frames the current index
  278.     #                      of the animated object appears.  When its time ends,
  279.     #                      it is disposed of (unless :stay is set to true) and
  280.     #                      replaced by the next index image.
  281.    
  282.     #            8) opacity : this is the transparency of the current index.  It
  283.     #                        is set from (0-255), with 0 being invisible.
  284.    
  285.     #            9) stay : this is an important value, as it tells the sequence to
  286.     #                    either keep the image of this index, or dispose of it.  
  287.     #                    By utilizing this, you can have the appearance of more
  288.     #                    than one animated object showing at any one point of the
  289.     #                    animation.
  290.     #
  291.     # :linger : this defines whether or not the entire animated object should
  292.     #            remain visible once the animated sequence ends. Set this to
  293.     #           true to keep the image, or false to dispose of it when the
  294.     #           object has run its course.
  295.     #                                      
  296.     # Below is an example of a properly set up frame:
  297.     #
  298.     #   :frames => {5 => {:se => 7,
  299.     #                     :animation => nil,
  300.     #                     :flash_self => [[118, 188, 0], 15],
  301.     #                     :flash_viewport => [],
  302.     #                     :x => 210,
  303.     #                     :y => 100,
  304.     #                     :zoom => 1.0,
  305.     #                     :time => 6,
  306.     #                     :opacity => 255,
  307.     #                     :stay => false},
  308.     #
  309.     # In this example, at index 5, the image would appear accompanied by whatever
  310.     # sound effect you placed with an id of 7 in the SOUNDS hash.  There would
  311.     # be no animation.  The image itself would flash for 15 frames with the
  312.     # color RGB = 118, 188, 0, The viewport wouldn't flash.  It would appear at
  313.     # x 210 and y 100.  It would have its normal dimensions (no zoom), it would
  314.     # remain for 6 frames, having an opacity of 255 and be disposed of when it
  315.     # was over.
  316.     #
  317.     #********IXFURU TRICK***********
  318.     # If you wanted to just display a database animation, you could do so, by
  319.     # making the opacity 0 and running the animation.  In this way, you could
  320.     # use a blank image and place it wherever you want the animation to run.
  321.     #*******************************
  322.    
  323.     ANIMATED_OBJECTS = {
  324.    
  325.     0 => {:folder => "Ixfuru",
  326.           :linger => false,
  327.           :frames => {0 => {:se => 2,
  328.                             :animation => nil,
  329.                             :flash_self => nil,
  330.                             :flash_viewport => nil,
  331.                             :x => 440,
  332.                             :y => 160,
  333.                             :zoom => 1.0,
  334.                             :time => 3,
  335.                             :opacity => 255,
  336.                             :stay => false},
  337.                            
  338.                       1 => {:se => 3,
  339.                             :animation => nil,
  340.                             :flash_self => nil,
  341.                             :flash_viewport => nil,
  342.                             :x => 420,
  343.                             :y => 160,
  344.                             :zoom => 1.0,
  345.                             :time => 3,
  346.                             :opacity => 255,
  347.                             :stay => false},
  348.                            
  349.                       2 => {:se => 2,
  350.                             :animation => nil,
  351.                             :flash_self => nil,
  352.                             :flash_viewport => nil,
  353.                             :x => 400,
  354.                             :y => 160,
  355.                             :zoom => 1.0,
  356.                             :time => 3,
  357.                             :opacity => 255,
  358.                             :stay => false},
  359.                       3 => {:se => 3,
  360.                             :animation => nil,
  361.                             :flash_self => nil,
  362.                             :flash_viewport => nil,
  363.                             :x => 380,
  364.                             :y => 160,
  365.                             :zoom => 1.0,
  366.                             :time => 3,
  367.                             :opacity => 255,
  368.                             :stay => false},
  369.                            
  370.                       4 => {:se => 2,
  371.                             :animation => nil,
  372.                             :flash_self => nil,
  373.                             :flash_viewport => nil,
  374.                             :x => 360,
  375.                             :y => 160,
  376.                             :zoom => 1.0,
  377.                             :time => 3,
  378.                             :opacity => 255,
  379.                             :stay => false},
  380.                            
  381.                       5 => {:se => 3,
  382.                             :animation => nil,
  383.                             :flash_self => nil,
  384.                             :flash_viewport => nil,
  385.                             :x => 340,
  386.                             :y => 160,
  387.                             :zoom => 1.0,
  388.                             :time => 3,
  389.                             :opacity => 255,
  390.                             :stay => false},
  391.                            
  392.                      
  393.                       6 => {:se => 2,
  394.                             :animation => nil,
  395.                             :flash_self => nil,
  396.                             :flash_viewport => nil,
  397.                             :x => 320,
  398.                             :y => 160,
  399.                             :zoom => 1.0,
  400.                             :time => 3,
  401.                             :opacity => 255,
  402.                             :stay => false},
  403.                            
  404.                       7 => {:se => 3,
  405.                             :animation => nil,
  406.                             :flash_self => nil,
  407.                             :flash_viewport => nil,
  408.                             :x => 300,
  409.                             :y => 160,
  410.                             :zoom => 1.0,
  411.                             :time => 3,
  412.                             :opacity => 255,
  413.                             :stay => false},
  414.                            
  415.                      8 => {:se => 2,
  416.                             :animation => nil,
  417.                             :flash_self => nil,
  418.                             :flash_viewport => nil,
  419.                             :x => 280,
  420.                             :y => 160,
  421.                             :zoom => 1.0,
  422.                             :time => 3,
  423.                             :opacity => 255,
  424.                             :stay => false},
  425.                            
  426.                     9 => {:se => 3,
  427.                             :animation => nil,
  428.                             :flash_self => nil,
  429.                             :flash_viewport => nil,
  430.                             :x => 260,
  431.                             :y => 160,
  432.                             :zoom => 1.0,
  433.                             :time => 3,
  434.                             :opacity => 255,
  435.                             :stay => false},
  436.                            
  437.                     10 => {:se => 2,
  438.                             :animation => nil,
  439.                             :flash_self => nil,
  440.                             :flash_viewport => nil,
  441.                             :x => 240,
  442.                             :y => 160,
  443.                             :zoom => 1.0,
  444.                             :time => 3,
  445.                             :opacity => 255,
  446.                             :stay => false},
  447.                            
  448.                     11 => {:se => 3,
  449.                             :animation => nil,
  450.                             :flash_self => nil,
  451.                             :flash_viewport => nil,
  452.                             :x => 220,
  453.                             :y => 160,
  454.                             :zoom => 1.0,
  455.                             :time => 3,
  456.                             :opacity => 255,
  457.                             :stay => false},
  458.                            
  459.                     12 => {:se => nil,
  460.                             :animation => nil,
  461.                             :flash_self => nil,
  462.                             :flash_viewport => nil,
  463.                             :x => 220,
  464.                             :y => 160,
  465.                             :zoom => 1.0,
  466.                             :time => 25,
  467.                             :opacity => 255,
  468.                             :stay => false},
  469.                      
  470.                     13 => {:se => nil,
  471.                             :animation => nil,
  472.                             :flash_self => nil,
  473.                             :flash_viewport => nil,
  474.                             :x => 220,
  475.                             :y => 160,
  476.                             :zoom => 1.0,
  477.                             :time => 6,
  478.                             :opacity => 255,
  479.                             :stay => false},
  480.                            
  481.                     14 => {:se => nil,
  482.                             :animation => nil,
  483.                             :flash_self => nil,
  484.                             :flash_viewport => nil,
  485.                             :x => 220,
  486.                             :y => 160,
  487.                             :zoom => 1.0,
  488.                             :time => 25,
  489.                             :opacity => 255,
  490.                             :stay => false},
  491.                            
  492.                     15 => {:se => 4,
  493.                             :animation => nil,
  494.                             :flash_self => nil,
  495.                             :flash_viewport => [[255, 255, 255], 12],
  496.                             :x => 220,
  497.                             :y => 160,
  498.                             :zoom => 1.0,
  499.                             :time => 25,
  500.                             :opacity => 255,
  501.                             :stay => false},
  502.                            
  503.                            
  504.                     } # End Frames
  505.                    
  506.                    
  507.             } # End Properties
  508.            
  509.     }# End ANIMATED_OBJECTS hash
  510.      
  511.     # The Z coordinate of all animated objects.
  512.     ANIMATED_OBJECTS_VIEWPORT_Z = 90
  513.                    
  514.                    
  515.     #===========================================================================
  516.     # 3c.  Intro : Production
  517.     #
  518.     # Okay, so you've now created the images which will be used as the performers
  519.     # in your big intro scene, now its time to put them to work, by giving them
  520.     # direction and roles to fill.  
  521.     #
  522.     # The production part of the script is the most complex and MOST CRUCIAL to
  523.     # developing a great intro. The entire thing is stored in a massive hash called
  524.     # 'PRODUCTION'.  Within the hash, you will set up each phaze of the intro, by
  525.     # using step names to call in the given images at the given times.
  526.     # When you call upon them, do so in string form, double-quoted, ("").  The
  527.     # following lists each 'step_name' and displays the settings each specific
  528.     # step is required to have to make it valid.
  529.     #
  530.     #---------------------------------------------------------------------------
  531.     #                               3b(1)
  532.     #---------------------------------------------------------------------------
  533.     #
  534.     # "ilogos" : this calls in an INTRO_LOGOS graphic.  
  535.     #
  536.     #                           -properties-
  537.     #
  538.     #          id : this refers to the element of the INTRO_LOGOS where the
  539.     #               graphic is located.
  540.     #          x : the x coordinate where the logo should be placed(0-544)
  541.     #          y : the y coordinate where the logo should be placed(0-416)
  542.     #          se_in : the sound which should be played when the logo appears;
  543.     #                  set this 'nil' if you don't want a sound effect. The value
  544.     #                  you set here refers to the 'SOUNDS' hash in the section
  545.     #                  4, and refers to the id given in the :se part of the hash.
  546.     #          se_out : the sound effect you wish to play when logo disappears;
  547.     #                   set to nil, for no se.
  548.     #
  549.     #                             -array form-
  550.     #        
  551.     #                     [id, x, y, se_in, se_out]
  552.     #
  553.     #---------------------------------------------------------------------------
  554.     #
  555.     # "itexts" : this calls one of the INTRO_TEXTS graphics into play.
  556.     #
  557.     #                          -properties-
  558.     #
  559.     #            id : this refers to the element of the INTRO_TEXTS array where
  560.     #                 the graphic is located.  
  561.     #             x : the x coordinate of the image
  562.     #             y : the y coordinate of the image
  563.     #             se_in : sound effect upon appearing
  564.     #             se_out : sound effect upon disappearing
  565.     #             fadein : should the text fade in? (true or false)
  566.     #             fadeout :should the text_fade out? (true or false)
  567.     #             fade_frames : frames it takes to fade in or out
  568.     #             fade_speed : opacity gained or reduced per frame when fading
  569.     #
  570.     #                             -array form-
  571.     #        
  572.     #     [id, x, y, se_in, se_out, fadein, fadeout, fade_frames, fade_speed]
  573.     #
  574.     #---------------------------------------------------------------------------
  575.     #
  576.     # "iplane" : this calls one of the INTRO_PLANES into the scene.  
  577.     #
  578.     #                           -properties-
  579.     #
  580.     #            id : id of the plane you want to call, refers to the hash key
  581.     #                 of the INTRO_PLANES hash which refers to the given plane.
  582.     #
  583.     #                             -array form-
  584.     #        
  585.     #                                 [id]
  586.     #
  587.     #---------------------------------------------------------------------------
  588.     #
  589.     # "iback" : this calls one of the INTRO_BACKGROUNDS into play
  590.     #
  591.     #                           -properties-
  592.     #
  593.     #            id : refers to the element of the INTRO_BACKGROUNDS array, where
  594.     #                 the image name is located.
  595.     #            se_in : sound effect to play when appearing
  596.     #            se_out : sound effect to play when disappearing
  597.     #
  598.     #                           -array form-
  599.     #        
  600.     #                          [id, se_in, se_out]
  601.     #
  602.     #---------------------------------------------------------------------------
  603.     #
  604.     # "ibgm" : this calls for a new background music
  605.     #
  606.     #                        -properties-
  607.     #
  608.     #              id : refers to the hash key, or reference value of the
  609.     #                   background you wish to call, located in the SOUNDS hash
  610.     #                  of section 4, under the :bgm property.
  611.     #
  612.     #                        -array form-
  613.     #        
  614.     #                            [id]
  615.     #
  616.     #---------------------------------------------------------------------------
  617.     #
  618.     # "ibgs" : calls in a new background sound
  619.     #
  620.     #                       -properties-
  621.     #
  622.     #              id : refers to the hash key of the SOUNDS :bgs you wish to
  623.     #                   start playing
  624.     #
  625.     #                        -array form-
  626.     #        
  627.     #                            [id]
  628.     #
  629.     #---------------------------------------------------------------------------
  630.     #
  631.     # "ise" : calls in a sound effect
  632.     #
  633.     #                        -properties-
  634.     #            
  635.     #               id : refers to the hash key of the SOUNDS :se hash for the
  636.     #                    sound effect you wish to play
  637.     #
  638.     #                        -array form-
  639.     #        
  640.     #                            [id]
  641.     #
  642.     # "iao" : calls an animated object
  643.     #
  644.     #                       -properties-
  645.     #                        
  646.     #               id : refers to the ANIMATED_OBJECTS hash id you gave the
  647.     #                    object you wish to call
  648.     #
  649.     #                       -array form-
  650.     #
  651.     #                           [id]
  652.     #
  653.     #---------------------------------------------------------------------------
  654.     #
  655.     # nil :  using nil as the step call, tells the system not to add any new
  656.     #        images or sounds, but to just wait
  657.     #
  658.     #                       -properties-
  659.     #                
  660.     #                           none
  661.     #
  662.     #                       -array form-
  663.     #
  664.     #                           none
  665.     #
  666.     #---------------------------------------------------------------------------
  667.     #                               3b(2)
  668.     #---------------------------------------------------------------------------
  669.     #
  670.     # For each part of the PRODUCTION hash, you give an chronological id and
  671.     # link it to the properties for each step call.  This is the formula for
  672.     # each entry:
  673.     #
  674.     #    chronological_id => {:for_frames => amount_of_frames
  675.     #                         :step => [step_call_string, [properties]]
  676.     #
  677.     # chronological_id : this value is set to an integer.  It must start at 0 (zero)
  678.     #                    and each id much be one more than the last.  You can
  679.     #                    add as many segments to the intro scene as you want and
  680.     #                    therefor there is no max limit.
  681.     #
  682.     # :for_frames : for the 'amount_of_frames' part, replace it with an integer
  683.     #               value which states how long this segment of the scene lasts.
  684.     #               The :for_frames property is used to tell the system when to
  685.     #               advance to the next step_id and call in the next part of the
  686.     #               scene.  So, if you set this to 180, the scene will wait 180
  687.     #               frames before progressing to the next chronological_id.  The
  688.     #               counter will not begin until the new image or section's
  689.     #               call is completely fulfilled, so don't worry about items
  690.     #               which may take a little longer to fulfill than others.
  691.     #
  692.     # :step : this property is where you will actually insert the step call string
  693.     #         and an array of the various properties each step requires as listed
  694.     #         above in section 3b(1).  The set up for this property is as follows
  695.     #            
  696.     #                   step => [step_call_string, [properties]]
  697.     #
  698.     #         And here is an example of a valid call:
  699.     #
  700.     #                  :step => ["iback", [2, "Slash1", "Slash2"]],
  701.     #
  702.     #         In the example above, we call for a background, the graphic's name
  703.     #         is the 2nd element of the INTRO_BACKGROUNDS array.  When the
  704.     #         background appears, we play the sound effect, "Slash1" and when it
  705.     #         disappears, we play "Slash2".
  706.     #
  707.     #         Example of a simple wait:
  708.     #
  709.     #                 :step => [nil]
  710.     #
  711.     #          That's the proper way to call for a wait.  Since nil has no
  712.     #          properties, we can omit the array as the second element of the
  713.     #          :step array.  Refer to section 3b(1) for the proper array set
  714.     #          up for the given step call.
  715.     #
  716.     #*******IXFURUS TRICKS************
  717.     # Got a few pictures that make up an animation.  Though, the system doesn't
  718.     # incorporate animations, you can make one by placing all the images you
  719.     # want to use as a logo, background or text image and play them successively
  720.     # quickly, like this  (for background):
  721.     #
  722.     # 0 => {:for_frames => 3,
  723.     #       :step => ["iback", [0, "Sword1", nil]},
  724.     #
  725.     # 1 => {:for_frames => 3,
  726.     #       :step => ["iback", [1, "Sword2", nil]},
  727.     #
  728.     # 2 => {:for_frames => 3,
  729.     #       :step => ["iback", [2, "Sword3", nil]},
  730.     #
  731.     # If you've been following along, you would see that each one of these
  732.     # images would appear 3 frames apart, and it would call a different
  733.     # graphic from the INTRO_BACKGROUNDS array each time. (The sound effects,
  734.     # "Sword1", "Sword2", etc.  aren't meaningful in this sequence, but shows
  735.     # that you can play a different sound each image of the 'animation'.
  736.     #*************************************
  737.     #
  738.     #===========================================================================
  739.  
  740.     PRODUCTION = {
  741.    
  742.     #flag_id => {:for_frames => frames_to_run_flagstep,
  743.     #            :step => [prodcution_string, properties]}
  744.    
  745.     0 => {:for_frames => 20,
  746.           :step => [nil]},
  747.    
  748.     # START_BGS
  749.     1 => {:for_frames => 10,
  750.           :step => ["ibgs", [1]]},
  751.          
  752.     # SHOW BACKGROUND
  753.     2 => {:for_frames => 10,
  754.           :step => ["iback", [0, nil, nil]]},
  755.          
  756.     # SHOW PLANE
  757.     3 => {:for_frames => 10,
  758.           :step => ["iplane", [0]]},
  759.          
  760.     # RUN IXFURU ANIMATION
  761.     4 => {:for_frames => 10,
  762.           :step => ["iao", [0]]},
  763.          
  764.     # SHOW INTRO LOGO
  765.     5 => {:for_frames => 270,
  766.           :step => ["ilogos", [0, 80, 160, nil, nil]]},
  767.          
  768.     # BETWEEN TEXT
  769.     6 => {:for_frames => 60,
  770.           :step => [nil]},
  771.          
  772.     # SHOW SECOND TEXT
  773.     7 => {:for_frames => 180,
  774.           :step => ["itexts", [1, 80, 160, 0, nil, true, true, 75, 1]]},
  775.          
  776.     # BETWEEN TEXT
  777.     8 => {:for_frames => 60,
  778.           :step => [nil]},
  779.          
  780.     # SHOW LAST TEXT
  781.     9 => {:for_frames => 180,
  782.           :step => ["itexts", [2, 80, 160, 0, nil, true, true, 75, 1]]},
  783.          
  784.     }
  785.    
  786.     #===========================================================================
  787.     #
  788.     # SECTION 4:
  789.     #
  790.     # Sounds
  791.     #
  792.     # There are three types of sounds used in the system, BGMs (background music),
  793.     # BGS (background sound) and SE (sound effects).   The following hash
  794.     # is used to store all the sounds that you will be using.  This includes those
  795.     # you wish to use in the Intro (and referred to in the PRODUCTION hash) and
  796.     # those you wish to use in the Title scene, which is set up in SECTION 5.
  797.     # To set up the hash, fill in those sounds which you wish to use, giving
  798.     # them each an 'id' or reference value for the hash key and then a three
  799.     # element array which is used to store the actual sound and its properties
  800.     # that you wish to use.  There are three sub-hashes, one for the BGMs, called
  801.     # :bgm, one for the BGSs, called :bgs and one for the SEs, called :se.
  802.     # In each, the formula is the same:
  803.     #
  804.     #          sound_id => [sound_filename, volume, pitch],
  805.     #
  806.     # For the 'sound_filename', just make sure you are referencing an audio file
  807.     # from the appropriate subhash.  In other words, don't call a BGM audio file
  808.     # to play in the SE section.
  809.     #
  810.     #===========================================================================
  811.    
  812.     SOUNDS = {
  813.    
  814.     :bgm => {0 => ["Realm of Sirs", 80, 100]},
  815.    
  816.     :bgs => {0 => ["Wind", 40, 100],
  817.             1 => ["ambience", 40, 100]},
  818.    
  819.     :se => {0 => ["Magic", 100, 50],
  820.             1 => ["Normal Item Get", 100, 80],
  821.             2 => ["Blow6", 100, 80],
  822.             3 => ["Blow2", 100, 80],
  823.             4 => ["Ice4", 100, 150]}
  824.            
  825.     }
  826.    
  827.     # -title sounds-
  828.     #
  829.     # Though the sounds are stored above and you can use multiple bgms, bgs
  830.     # in the Intro, you must designate a specific bgm and bgs for use in the title
  831.     # scene.  You do this by putting the sound_id for the sound you wish to
  832.     # use as defined in the SOUNDS hash.
  833.    
  834.     TITLE_SOUND_IDS = {
  835.    
  836.     :bgm => 0,
  837.     :bgs => 0,
  838.    
  839.     }
  840.    
  841.     #===========================================================================
  842.     #
  843.     # SECTION 5:
  844.     #
  845.     # The Title Scene
  846.     #
  847.     # There are several sections you can customize in the title scene.  This
  848.     # includes the logo, subtitle logo, commands images, cursor image, planes
  849.     # and 'extra' images.  Each section has specific values which must be setup
  850.     # in order to make the scene valid.  Follow the instructions for each.
  851.     #
  852.     #===========================================================================
  853.    
  854.     #===========================================================================
  855.     #
  856.     # 5a.  Title : Logo
  857.     #
  858.     # The title logo is the actual image which represents the name of the game.
  859.     # It is a necessary part of the scene.  You can only have one Title logo and
  860.     # it cannot be changed.  The only properties you can change for the logo are
  861.     # the x and y coordinates
  862.     #===========================================================================
  863.    
  864.     # Refers to the graphic's filename you wish to use
  865.     TITLE_LOGO = "Logo"
  866.    
  867.     # Refers to the x and y placement of the logo image
  868.     TITLE_LOGO_X = 95
  869.     TITLE_LOGO_Y = 10
  870.    
  871.     #===========================================================================
  872.     #
  873.     # 5b.   Title : Subtitle
  874.     #
  875.     # It is NOT necessary to have a subtitle.  But this image will be used to
  876.     # display the subtitle to the game, or any other image you may wish to display
  877.     # as 'part of' the logo.   Like the Logo, you only need to set up the
  878.     # x and y placement here.  Use 'nil' or an empty string, "" for this value
  879.     # to bypass using it.
  880.     #===========================================================================
  881.    
  882.     # The Graphic
  883.     TITLE_SUBTITLE = ""
  884.    
  885.     # The coordinates
  886.     TITLE_SUBTITLE_X = 120
  887.     TITLE_SUBTITLE_Y = 70
  888.    
  889.     #===========================================================================
  890.     #
  891.     # 5c.   Title : Commands
  892.     #
  893.     # The commands images are what replaces the little window which shows
  894.     # the options for the player when he/she first loads up the title scene
  895.     # in the default system.  In this script, you get a different command
  896.     # for each of the commands.  And You CAN HAVE UNLIMITED commands, as long
  897.     # as you can make them fit on the screen AND provided they all have the same
  898.     # height.  This is important, as they need to look structured in some sort of
  899.     # way for when the cursor image moves amongst them awaiting user selection.
  900.     # So again, you can have however many you want, but they MUST be the same
  901.     # height.  
  902.     #
  903.     # The commands properties are stored in a hash.  This hash holds three
  904.     # important properties.  The hash key represents the order in which they
  905.     # will be displayed.  So, you need to start at zero and advance upwards
  906.     # by one with each new command.  This value is used by the cursor for
  907.     # command index.
  908.     #
  909.     #   command_index => {:graphic => filename,
  910.     #                     :scene => string_reference_to_new_scene},
  911.     #
  912.     # Replace 'filename' for the :graphic property with the name of the
  913.     # image you wish to use for the given command.  Then replace the
  914.     # 'string_reference_to_new_scene' with a double-quoted ("") string (word)
  915.     # which references to the scene you wish to change to when the player selects
  916.     # the given command.  
  917.     #
  918.     #^^^^^^^^^^^^VERY IMPORTANT^^^^^^^^^^^^^^^^
  919.     #
  920.     # You MUST have a command which references "scene_map" for when the player
  921.     # wants to start a new game, "scene_file" for when the player wants to
  922.     # continue their saved game and advance to the file scene.  And a 'nil',
  923.     # without the quotes for when the player wants to exit the program.  The
  924.     # order of them is not crucial, and you can reference other scenes from
  925.     # here if you want to.  Even custom scenes like options/credits/minigame, etc.
  926.     # Just as long as you create one for each of the mandatory ones just
  927.     # described.
  928.     #
  929.     #^^^^^^^^^^^^VERY IMPORTANT^^^^^^^^^^^^^^^^^
  930.     #
  931.     # Though the functions required to move to the mandatory scenes are
  932.     # part of the script, if you reference a new or unique scene which is not
  933.     # one of these, YOU MUST SET UP THE 'SECTION X: Custom Scene Change' section
  934.     # which is found late in the script.  This will be further explained in Section
  935.     # 6.
  936.     #===========================================================================
  937.    
  938.     TITLE_COMMANDS = {
  939.    
  940.     0 => {:graphic => "NewGame",
  941.           :scene => "scene_map"},
  942.          
  943.     1 => {:graphic => "Continue",
  944.           :scene => "scene_file"},
  945.          
  946.     2 => {:graphic => "Credits",
  947.           :scene => "scene_credits"},
  948.          
  949.     3 => {:graphic => "Exit",
  950.           :scene => nil},
  951.          
  952.     }
  953.    
  954.     # -command placement-
  955.     #
  956.     # With these three variables, you set up the placement of where you want the
  957.     # commands of the title scene to appear.  Here's how it works, you set up the
  958.     # x coordinate for where you want the commands to line up and the y coordinate
  959.     # for where the FIRST COMMAND will appear.  The others, will appear directly
  960.     # below the first spaced equally apart.  Finally, you set up the z placement
  961.     # to set the viewport for how close you want the images to appear.  This is
  962.     # important, as if you want the commands to appear above everything else in the
  963.     # scene, you need to provide a value that verifies that, else you may end up
  964.     # with commands that are overlapped by planes, extras, etc.
  965.    
  966.     # the x where the commands line up
  967.     TITLE_COMMAND_X = 220
  968.    
  969.     # the y of the first command
  970.     TITLE_COMMAND_Y = 160
  971.    
  972.     # the z of the viewport which holds the commands
  973.     TITLE_COMMAND_Z = 100
  974.    
  975.     #===========================================================================
  976.     #
  977.     # 5e.  Title : Planes
  978.     #
  979.     # The title planes are like those of the Intro planes, however, in the
  980.     # title scene, there can be multiple planes running in different directions
  981.     # at different speeds on the scene at the same time.  For the planes, you need
  982.     # to set up each with an 'id' for the hash key and then set up the properties:
  983.     #
  984.     #    plane_id => {:graphic => filename,
  985.     #                 :direction => directional_value, (see Intro planes direction)
  986.     #                 :speed => pixels_to_move_per_frame,
  987.     #                 :opacity => transparency (0-255) 0 is invisible
  988.     #                 :z => z_placement, (how close the image should appear)
  989.     #
  990.     #===========================================================================
  991.    
  992.     TITLE_PLANES = {
  993.    
  994.     0 => {:graphic => "TitlePlane",
  995.           :direction => 3,
  996.           :speed => 2,
  997.           :opacity => 200,
  998.           :z => 0},
  999.          
  1000.     1 => {:graphic => "TitlePlane",
  1001.           :direction => 4,
  1002.           :speed => 2,
  1003.           :opacity => 200,
  1004.           :z => 0},
  1005.          
  1006.     }
  1007.    
  1008.     #===========================================================================
  1009.     #
  1010.     # 5f.   Title : Background
  1011.     #
  1012.     # There is only one background which can be displayed on the title.  It always
  1013.     # appears z 0 (zero) and always places itself at the upper left hand corner.
  1014.     # Background images can have a 'wave' effect applied to them.  This
  1015.     # makes it look as if the image is moving.  To make the title have this
  1016.     # effect, set the 'TITLE_WAVE' value to 'true' and set up the next three
  1017.     # variables to control the appearance of the effect.  
  1018.     #
  1019.     #===========================================================================
  1020.    
  1021.     # The graphic used for the background
  1022.     TITLE_BACKGROUND = "TitleBack"
  1023.    
  1024.     # Use a wave effect?
  1025.     TITLE_WAVE = true
  1026.    
  1027.     # - title wave -
  1028.     #
  1029.     # If TITLE_WAVE is true, then these are the properties.  You may need to
  1030.     # adjust and maneuver these around a bit upon playtesting to get the effect
  1031.     # you looking for.   The AMP and LENGTH are measured in pixels.  The amp
  1032.     # effect causes the image to be skewed on its horizontal x position, and
  1033.     # these control how many pixels they move.  SPEED controls how fast the
  1034.     # movement occurs.
  1035.    
  1036.     TITLE_BACKGROUND_WAVE_AMP = 35
  1037.     TITLE_BACKGROUND_WAVE_LENGTH = 15
  1038.     TITLE_BACKGROUND_WAVE_SPEED = 14
  1039.    
  1040.     #===========================================================================
  1041.     # 5g.   Title : Extras
  1042.     #
  1043.     # Extras are any other image that you want to display in the scene.  You can
  1044.     # have unlimited amounts of extra images. Each has its own properties.  Unlike
  1045.     # other images, the 'extras' are moveable.  So in the second part of the section
  1046.     # you will set up the boundaries, speeds, etc. which controls their movement.
  1047.     # Extras have many values to set, the graphic, the opacity (transparency),
  1048.     # wave effect (See - title wave - above for details), and x and y placement,
  1049.     # a zoom_x and zoom_y which controls the height and width of the image and
  1050.     # the viewport_z which is used to set up the closeness of where the extras
  1051.     # viewport is placed.  This is used to clarify which extras overlap which other
  1052.     # extras.   Give each extra an 'id' in the hash as the hash key and set up
  1053.     # the required properties.  The id of the extra image is used to reference it
  1054.     # at runtime.
  1055.     #
  1056.     # -zoom values-
  1057.     #
  1058.     # For :zoom_x and :zoom_y, you need to supply the value as a floating point
  1059.     # value (or decimal point value) which states how large you want the image
  1060.     # to be.  When zooming, 1.0 represents actual size of the image, while
  1061.     # larger values, like 3.0 or 4.5 grow the sprite, while lesser ones, like
  1062.     # 0.4 shrink it.
  1063.     #
  1064.     # The zoom values can be controlled through a moving extra, which will explained
  1065.     # in section 5g(1).
  1066.     #
  1067.     # -extra viewports-
  1068.     #
  1069.     # Extra images each have their own viewport upon creation.  That allows you to
  1070.     # set the z value of each through their viewport and causes certain extras
  1071.     # to overlap others.  The higher the viewport_z value you give, the more
  1072.     # others it will overlap.
  1073.     #
  1074.     #===========================================================================
  1075.    
  1076.     TITLE_EXTRA_IMAGES = {
  1077.    
  1078.     0 => {:image => "Fojjy",
  1079.           :opacity => 255,
  1080.           :wave => [],
  1081.           :x => 40,
  1082.           :y => 190,
  1083.           :zoom_x => 1.0,
  1084.           :zoom_y => 1.0,
  1085.           :viewport_z => 100},
  1086.          
  1087.     1 => {:image => "Ghost",
  1088.           :opacity => 255,
  1089.           :wave => [2, 3, 13],
  1090.           :x => 140,
  1091.           :y => 140,
  1092.           :zoom_x => 1.0,
  1093.           :zoom_y => 1.0,
  1094.           :viewport_z => 50},
  1095.          
  1096.     2 => {:image => "Ghost",
  1097.           :opacity => 255,
  1098.           :wave => [2, 3, 13],
  1099.           :x => 400,
  1100.           :y => 140,
  1101.           :zoom_x => 1.5,
  1102.           :zoom_y => 1.5,
  1103.           :viewport_z => 75},
  1104.          
  1105.     3 => {:image => "Sullendolf",
  1106.           :opacity => 255,
  1107.           :wave => [],
  1108.           :x => 30,
  1109.           :y => 90,
  1110.           :zoom_x => 0.6,
  1111.           :zoom_y => 0.6,
  1112.           :viewport_z => 15},
  1113.          
  1114.     4 => {:image => "FriedaGhost",
  1115.           :opacity => 128,
  1116.           :wave => [2, 3, 8],
  1117.           :x => 100,
  1118.           :y => 140,
  1119.           :zoom_x => 0.8,
  1120.           :zoom_y => 0.8,
  1121.           :viewport_z => 30},
  1122.          
  1123.   }
  1124.  
  1125.   #=============================================================================
  1126.   # 5g(1)
  1127.   #
  1128.   # -Moving Extras-
  1129.   #
  1130.   # Extra images can be told to move.  Right now, the script only allows random
  1131.   # movement, with the values you provide used to set the boundaries of each
  1132.   # direction which the image can move.  
  1133.   #
  1134.   #=============================================================================
  1135.  
  1136.   # This array can be left empty if don't want any extra images to move.  This
  1137.   # will render them all stationary.  You reference which images you want to move,
  1138.   # by placing their ids (from the TITLE_EXTRA_IMAGES hash above) into the
  1139.   # array.  For instance, [1, 3, 5, 6] would make it so that the images you
  1140.   # created with ids of 1, 3, 5, 6 were set to move.
  1141.   MOVING_EXTRAS = [1, 2]
  1142.  
  1143.   # These two variables set the boundaries in which a randomly moving
  1144.   # extra image will move (This is still pretty glitchy right now, as moving
  1145.   # images tend to disappear completely sometimes).  For both of these
  1146.   # values, you need to set a low and high coordinate for how far the
  1147.   # image can move before it's considered out of bounds.  This is supposed to
  1148.   # create movements which are illegal and tell the image to travel in another
  1149.   # direction.
  1150.   MOVING_EXTRAS_X_BOUNDARIES = [10, 502] # [low_x_coordinate, high_x_coordinate]
  1151.   MOVING_EXTRAS_Y_BOUNDARIES = [10, 374] # [low_y_coordinate, high_y_coordinate]
  1152.  
  1153.   # These are the same as the X/Y boundaries, except they control the zoom effect
  1154.   # of the extra in question.  so, if the extra reaches the low or high values
  1155.   # in their current zoom_x or zoom_y, they will be unable to continue shrinking or
  1156.   # growing respectively.
  1157.   MOVING_EXTRAS_ZOOM_BOUNDARIES = [0.1, 5.0]
  1158.  
  1159.   # This determines how fast the image moves from left to right, up and down
  1160.   MOVING_EXTRAS_PARALLEL_MOVE_RATE = 6
  1161.  
  1162.   # This controls how fast the image zooms in and out
  1163.   MOVING_EXTRAS_DISTANCE_MOVE_RATE = 0.1
  1164.  
  1165.   #=============================================================================
  1166.   #
  1167.   # 5h.  Title : Cursor
  1168.   #
  1169.   # This variable simply gives the filename of the cursor.  This is a mandatory
  1170.   # graphic.  It's the graphic which is used to move from command to command
  1171.   # in the Title scene.
  1172.   #=============================================================================
  1173.   TITLE_CURSOR_GRAPHIC = "BellCursor"
  1174.  
  1175.   #=============================================================================
  1176.   #
  1177.   # SECTION 6:
  1178.   #
  1179.   # Calling Custom Scenes
  1180.   #
  1181.   # If you have set up the commands in section 5c to reference scenes that are
  1182.   # not new_game, continue and shutdown, you must jump to the SECTION X section
  1183.   # which is located near line 2300, and is part of the method called
  1184.   # 'determine_scene_change'
  1185.   #=============================================================================
  1186.  
  1187.   #=============================================================================
  1188.   # SECTION 7:
  1189.   #
  1190.   # Preset Switches and Variables
  1191.   #
  1192.   # This section gives you the ability to toggle switches and variables prior
  1193.   # the first map of a new game.
  1194.   #=============================================================================
  1195.  
  1196.   # -preset switches-
  1197.   #
  1198.   # Simply place the id of the switches you want to be preset in the array.
  1199.   PRESET_SWITCHES = [82, 84, 87]
  1200.  
  1201.   # -preset variables-
  1202.   #
  1203.   # In the following hash, you need to place the variable you wish to alter as
  1204.   # the hash key, and the amount you want to set it to as the value. Like this:
  1205.   #
  1206.   #               10 => 28,#
  1207.   #
  1208.   # That would set variable 10 to a value of 28.
  1209.   PRESET_VARIABLES = {
  1210.  
  1211.   31 => 100,
  1212.   32 => 500,
  1213.   33 => 1000,
  1214.  
  1215.   }
  1216.  
  1217.  
  1218.  
  1219.   ##############################################################################
  1220.   #*****************************************************************************
  1221.   #               DON'T EDIT BELOW THIS LINE, UNLESS REQUIRED TO!
  1222.   #*****************************************************************************
  1223.   ##############################################################################
  1224.    
  1225.   end
  1226.  
  1227. end
  1228.  
  1229. ################################################################################
  1230. #                              Cache
  1231. ################################################################################
  1232. module Cache
  1233.  
  1234.   def self.production(filename)
  1235.     load_bitmap("Graphics/Production/", filename)
  1236.   end
  1237.  
  1238.   def self.animated_object(folder, filename)
  1239.     load_bitmap("Graphics/Production/" + folder + "/", filename)
  1240.   end
  1241.  
  1242. end
  1243.  
  1244.  
  1245. ################################################################################
  1246. #                        TITLE PRODUCTION
  1247. ################################################################################
  1248. class Title_Production
  1249.  
  1250.   attr_reader :frame_count
  1251.   attr_reader :flag_count
  1252.   attr_reader :wait_count
  1253.   attr_reader :production
  1254.   attr_reader :production_end
  1255.   attr_accessor :intro_complete
  1256.  
  1257.   def initialize
  1258.     @frame_count = 0
  1259.     @flag_count = 0
  1260.     @wait_count = 0
  1261.     @intro_complete = false
  1262.     @plane_base = Ixfuru::TitleProduction::INTRO_PLANES
  1263.     @production = Ixfuru::TitleProduction::PRODUCTION
  1264.     @production_end = false
  1265.     @animated_objects = {}
  1266.     @animation_running = false
  1267.     create_viewports
  1268.     start_step
  1269.   end
  1270.  
  1271.   #-----------------------------------------------------------------------------
  1272.   # Create Viewports
  1273.   #-----------------------------------------------------------------------------
  1274.   def create_viewports
  1275.     @plane_viewport = Viewport.new(0, 0, 544, 416)
  1276.     @plane_viewport.z = Ixfuru::TitleProduction::INTRO_PLANE_VIEWPORT_Z
  1277.     @background_viewport = Viewport.new(0, 0, 544, 416)
  1278.     @background_viewport.z = 0
  1279.     @logo_text_viewport = Viewport.new(0, 0, 544, 416)
  1280.     @logo_text_viewport.z = Ixfuru::TitleProduction::INTRO_LOGO_TEXT_Z
  1281.     @ao_viewport = Viewport.new(0, 0, 544, 416)
  1282.     @ao_viewport.z = Ixfuru::TitleProduction::ANIMATED_OBJECTS_VIEWPORT_Z
  1283.   end
  1284.  
  1285.   #-----------------------------------------------------------------------------
  1286.   # Start Step
  1287.   #-----------------------------------------------------------------------------
  1288.   def start_step
  1289.     case @production[@flag_count][:step][0]
  1290.     when nil
  1291.       @wait_count = @production[@flag_count][:for_frames]
  1292.       return
  1293.     when "ilogos"
  1294.       create_logo
  1295.     when "itexts"
  1296.       create_texts
  1297.     when "iback"
  1298.       create_background
  1299.     when "iplane"
  1300.       create_plane
  1301.     when "iao"
  1302.       create_animated_object
  1303.     when "ibgs"
  1304.       start_bgs
  1305.     when "ibgm"
  1306.       start_bgm
  1307.     end
  1308.     @wait_count = @production[@flag_count][:for_frames]
  1309.   end
  1310.  
  1311.   #-----------------------------------------------------------------------------
  1312.   # Create Animated Object
  1313.   #-----------------------------------------------------------------------------
  1314.   def create_animated_object
  1315.     obj_id = @production[@flag_count][:step][1][0]
  1316.     obj_base = Ixfuru::TitleProduction::ANIMATED_OBJECTS[obj_id]
  1317.     sprite = Sprite_Base.new(@ao_viewport)
  1318.     index = 0
  1319.     sprite.bitmap = Cache.animated_object(obj_base[:folder], index.to_s)
  1320.     frame = obj_base[:frames][index]
  1321.     sprite.x = frame[:x]
  1322.     sprite.y = frame[:y]
  1323.     sprite.opacity = frame[:opacity]
  1324.     sprite.zoom_x = frame[:zoom]
  1325.     sprite.zoom_y = frame[:zoom]
  1326.     if frame[:se] != nil
  1327.       play_production_se(frame[:se])
  1328.     end
  1329.     if frame[:animation] != nil
  1330.       sprite.start_animation($data_animations[frame[:animation]])
  1331.     end
  1332.     if frame[:flash_self] != nil
  1333.       color = Color.new(frame[:flash_self][0], frame[:flash_self][1], frame[:flash_self][2])
  1334.       sprite.flash(color, frame[:flash_self][1])
  1335.     end
  1336.     if frame[:flash_viewport] != nil
  1337.       color = Color.new(frame[:flash_viewport][0], frame[:flash_viewport][1], frame[:flash_viewport][2])
  1338.       @ao_viewport.flash(color, frame[:flash_viewport][1])
  1339.     end
  1340.     @animated_objects[obj_id] = {:index => index, :max_index => obj_base[:frames].size,
  1341.     :frame_count => 0, :max_frames => frame[:time], :keep_current => frame[:stay],
  1342.     :end_keep => obj_base[:linger], :sprites => [sprite]}
  1343.     @animation_running = true
  1344.   end
  1345.  
  1346.   #-----------------------------------------------------------------------------
  1347.   # Create Logo
  1348.   #-----------------------------------------------------------------------------
  1349.   def create_logo
  1350.     if @logo != nil && !@logo.disposed?
  1351.       dispose_logo
  1352.     end
  1353.     @logo = Sprite.new(@logo_text_viewport)
  1354.     properties = @production[@flag_count][:step][1]
  1355.     if properties == nil
  1356.       @logo.dispose
  1357.       new_flag
  1358.       return
  1359.     end
  1360.     pl = Ixfuru::TitleProduction::INTRO_LOGOS[properties[0]]
  1361.     @logo.bitmap = Cache.production(pl)
  1362.     @logo.x = properties[1]
  1363.     @logo.y = properties[2]
  1364.     unless properties[3] == nil
  1365.       play_production_se(properties[3])
  1366.     end
  1367.   end
  1368.  
  1369.  
  1370.   #-----------------------------------------------------------------------------
  1371.   # Create Plane
  1372.   #-----------------------------------------------------------------------------
  1373.   def create_plane
  1374.     if @plane != nil && !@plane.disposed?
  1375.       dispose_plane
  1376.     end
  1377.     @plane = Plane.new(@plane_viewport)
  1378.     @plane_id = @production[@flag_count][:step][1][0]
  1379.     properties = @plane_base[@plane_id]
  1380.     if properties == nil
  1381.       @plane.dispose
  1382.       new_flag
  1383.       return
  1384.     end
  1385.     @plane.bitmap = Cache.production(properties[:graphic])
  1386.     @plane.z = properties[:z]
  1387.     @plane.opacity = properties[:opacity]
  1388.   end
  1389.  
  1390.   #-----------------------------------------------------------------------------
  1391.   # Create Background
  1392.   #-----------------------------------------------------------------------------
  1393.   def create_background
  1394.     if @background != nil && !@background.disposed?
  1395.       dispose_background
  1396.     end
  1397.     @background = Sprite.new(@background_viewport)
  1398.     properties = @production[@flag_count][:step][1]
  1399.     if properties == nil
  1400.       @background.dispose
  1401.       new_flag
  1402.       return
  1403.     end
  1404.     bg = Ixfuru::TitleProduction::INTRO_BACKGROUNDS[properties[0]]
  1405.     @background.bitmap = Cache.production(bg)
  1406.     @background.x = 0
  1407.     @background.y = 0
  1408.     if properties[1] != nil
  1409.       play_production_se(properties[1])
  1410.     end
  1411.   end
  1412.  
  1413.   #-----------------------------------------------------------------------------
  1414.   # Create Texts
  1415.   #-----------------------------------------------------------------------------
  1416.   def create_texts
  1417.     if @texts != nil && !@texts.disposed?
  1418.       dispose_texts
  1419.     end
  1420.     @texts = Sprite.new(@logo_text_viewport)
  1421.     properties = @production[@flag_count][:step][1]
  1422.     @old_texts_properties = properties
  1423.     if properties == nil
  1424.       @texts.dispose
  1425.       new_flag
  1426.       return
  1427.     end
  1428.     it = Ixfuru::TitleProduction::INTRO_TEXTS[properties[0]]
  1429.     @texts.bitmap = Cache.production(it)
  1430.     @texts.x = properties[1]
  1431.     @texts.y = properties[2]
  1432.     unless properties[3] == nil
  1433.       play_production_se(properties[3])
  1434.     end
  1435.     if properties[5] # Fadein?
  1436.       @texts.opacity = 0
  1437.       until @texts.opacity >= 255
  1438.         @texts.opacity += 255 / properties[7] #FadeFrames
  1439.         i = 0
  1440.         until i >= properties[8] * 60 #FadeSpeed
  1441.           i += 1
  1442.         end
  1443.       end
  1444.     else
  1445.       @texts.opacity = 255
  1446.     end
  1447.   end
  1448.  
  1449.   #-----------------------------------------------------------------------------
  1450.   # Start BGM
  1451.   #-----------------------------------------------------------------------------
  1452.   def start_bgm
  1453.     RPG::BGM.stop
  1454.     music_id = @production[@flag_count][:step][1][0]
  1455.     song = Ixfuru::TitleProduction::SOUNDS[:bgm][music_id]
  1456.     RPG::BGM.new(song[0], song[1], song[2]).play
  1457.   end
  1458.  
  1459.   #-----------------------------------------------------------------------------
  1460.   # Start BGS
  1461.   #-----------------------------------------------------------------------------
  1462.   def start_bgs
  1463.     RPG::BGS.stop
  1464.     sound_id = @production[@flag_count][:step][1][0]
  1465.     sound = Ixfuru::TitleProduction::SOUNDS[:bgs][sound_id]
  1466.     RPG::BGS.new(sound[0], sound[1], sound[2]).play
  1467.   end
  1468.  
  1469.   #------------------------------------------------------------------------------
  1470.   # New Flag
  1471.   #-----------------------------------------------------------------------------
  1472.   def new_flag
  1473.     @frame_count = 0
  1474.     @flag_count += 1
  1475.     if @flag_count >= @production.size
  1476.       @production_end = true
  1477.       return
  1478.     end
  1479.     start_step
  1480.   end
  1481.  
  1482.   #-----------------------------------------------------------------------------
  1483.   # Frame Update
  1484.   #-----------------------------------------------------------------------------
  1485.   def update
  1486.     if @production_end
  1487.       end_scene
  1488.       transition_to_title
  1489.     else
  1490.       if @animation_running
  1491.         update_animated_object
  1492.       else
  1493.         update_production
  1494.       end
  1495.     end
  1496.     update_plane
  1497.     update_background
  1498.     update_logo
  1499.     update_texts
  1500.   end
  1501.  
  1502.   #-----------------------------------------------------------------------------
  1503.   # Update Production
  1504.   #-----------------------------------------------------------------------------
  1505.   def update_production
  1506.     @frame_count += 1
  1507.     if @frame_count >= @wait_count
  1508.       end_step
  1509.       new_flag
  1510.     end
  1511.   end
  1512.  
  1513.   #-----------------------------------------------------------------------------
  1514.   # Update Animated Object
  1515.   # This method is called only when an 'Animated Object' is being displayed,
  1516.   # it is used in order to keep the intro scene from advaning frames until the
  1517.   # entire animation has run its course.
  1518.   #
  1519.   # @animated_objects[obj_id] = {:index => index, :max_index => frames.size,
  1520. #~     :frame_count => 0, :max_frames => frame[:time], :keep_current => frame[:stay],
  1521. #~     :end_keep => obj_base[:linger], :sprites = sprite}
  1522.   #-----------------------------------------------------------------------------
  1523.   def update_animated_object
  1524.     @ao_viewport.update
  1525.     return if @animated_objects.empty?
  1526.     obj_id = @production[@flag_count][:step][1][0]
  1527.     ao = @animated_objects[obj_id]
  1528.     obj_base = Ixfuru::TitleProduction::ANIMATED_OBJECTS[obj_id]
  1529.     ao = @animated_objects[obj_id]
  1530.     for sprite in ao[:sprites]
  1531.       sprite.update
  1532.       if sprite.bitmap == Cache.animated_object(obj_base[:folder], ao[:index].to_s)
  1533.         old_sprite = sprite
  1534.       end
  1535.     end
  1536.     ao[:frame_count] += 1
  1537.     if ao[:frame_count] >= ao[:max_frames]
  1538.       if ao[:keep_current]
  1539.         ao[:index] += 1
  1540.         if ao[:index] >= ao[:max_index]
  1541.           if ao[:end_keep]
  1542.             @animation_running = false
  1543.             return
  1544.           else
  1545.             for sprite in ao[:sprites]
  1546.               sprite.dispose
  1547.             end
  1548.             @animation_running = false
  1549.             return
  1550.           end
  1551.         end
  1552.         frame = obj_base[:frames][ao[:index]]
  1553.         new_sprite = Sprite_Base.new(@ao_viewport)
  1554.         new_sprite.bitmap = Cache.animated_object(obj_base[:folder], ao[:index].to_s)
  1555.         new_sprite.x = frame[:x]
  1556.         new_sprite.y = frame[:y]
  1557.         new_sprite.zoom_x = frame[:zoom]
  1558.         new_sprite.zoom_y = frame[:zoom]
  1559.         new_sprite.opacity = frame[:opacity]
  1560.         if frame[:se] != nil
  1561.           play_production_se(frame[:se])
  1562.         end
  1563.         if frame[:animation] != nil
  1564.           new_sprite.start_animation($data_animations[frame[:animation]])
  1565.         end
  1566.         if frame[:flash_self] != nil
  1567.           color = Color.new(frame[:flash_self][0][0], frame[:flash_self][0][1], frame[:flash_self][0][2])
  1568.           new_sprite.flash(color, frame[:flash_self][1])
  1569.         end
  1570.         if frame[:flash_viewport] != nil
  1571.           color = Color.new(frame[:flash_viewport][0][0], frame[:flash_viewport][0][1], frame[:flash_viewport][0][2])
  1572.           @ao_viewport.flash(color, frame[:flash_viewport][1])
  1573.         end
  1574.         ao[:sprites].push(new_sprite)
  1575.         ao[:frame_count] = 0
  1576.         ao[:max_frames] = frame[:time]
  1577.         ao[:keep_current] = frame[:stay]
  1578.       else
  1579.         ao[:index] += 1
  1580.         if ao[:index] >= ao[:max_index]
  1581.           if ao[:end_keep]
  1582.             @animation_running = false
  1583.             return
  1584.           else
  1585.             for sprite in ao[:sprites]
  1586.               sprite.dispose
  1587.             end
  1588.             @animation_running = false
  1589.             return
  1590.           end
  1591.         end
  1592.         old_sprite.bitmap = Cache.animated_object(obj_base[:folder], ao[:index].to_s)
  1593.         frame = obj_base[:frames][ao[:index]]
  1594.         old_sprite.x = frame[:x]
  1595.         old_sprite.y = frame[:y]
  1596.         old_sprite.zoom_x = frame[:zoom]
  1597.         old_sprite.zoom_y = frame[:zoom]
  1598.         old_sprite.opacity = frame[:opacity]
  1599.         if frame[:se] != nil
  1600.           play_production_se(frame[:se])
  1601.         end
  1602.         if frame[:animation] != nil
  1603.           old_sprite.start_animation($data_animations[frame[:animation]])
  1604.         end
  1605.         if frame[:flash_self] != nil
  1606.           color = Color.new(frame[:flash_self][0][0], frame[:flash_self][0][1], frame[:flash_self][0][2])
  1607.           old_sprite.flash(color, frame[:flash_self][1])
  1608.         end
  1609.         if frame[:flash_viewport] != nil
  1610.           color = Color.new(frame[:flash_viewport][0][0], frame[:flash_viewport][0][1], frame[:flash_viewport][0][2])
  1611.           @ao_viewport.flash(color, frame[:flash_viewport][1])
  1612.         end
  1613.         ao[:frame_count] = 0
  1614.         ao[:max_frames] = frame[:time]
  1615.         ao[:keep_current] = frame[:stay]
  1616.       end
  1617.     end
  1618.   end
  1619.  
  1620.   #-----------------------------------------------------------------------------
  1621.   # Update Plane
  1622.   #-----------------------------------------------------------------------------
  1623.   def update_plane
  1624.     return if @plane == nil || @plane.disposed?
  1625.     properties = @plane_base[@plane_id]
  1626.     spd = properties[:speed]
  1627.     dir = properties[:direction]
  1628.     scroll_plane(dir, spd)
  1629.   end
  1630.  
  1631.   #-----------------------------------------------------------------------------
  1632.   # Update Background
  1633.   #-----------------------------------------------------------------------------
  1634.   def update_background
  1635.     return if @background == nil || @background.disposed?
  1636.     @background.update
  1637.   end
  1638.  
  1639.   #-----------------------------------------------------------------------------
  1640.   # Update Logo
  1641.   #-----------------------------------------------------------------------------
  1642.   def update_logo
  1643.     return if @logo == nil || @logo.disposed?
  1644.     @logo.update
  1645.   end
  1646.  
  1647.   #-----------------------------------------------------------------------------
  1648.   # Update Texts
  1649.   #-----------------------------------------------------------------------------
  1650.   def update_texts
  1651.     return if @texts == nil || @texts.disposed?
  1652.     @texts.update
  1653.   end
  1654.  
  1655.   #-----------------------------------------------------------------------------
  1656.   # End Step
  1657.   #-----------------------------------------------------------------------------
  1658.   def end_step
  1659.     case @production[@flag_count][:step][0]
  1660.     when "ilogos"
  1661.       se_id = @production[@flag_count][:step][1][4]
  1662.       unless se_id == nil
  1663.         play_production_se(se_id)
  1664.       end
  1665.       dispose_logo
  1666.     when "itexts"
  1667.       se_id = @production[@flag_count][:step][1][4]
  1668.       unless se_id == nil
  1669.         play_production_se(se_id)
  1670.       end
  1671.       dispose_texts
  1672.     end
  1673.   end
  1674.  
  1675.   #-----------------------------------------------------------------------------
  1676.   # End Scene
  1677.   #-----------------------------------------------------------------------------
  1678.   def end_scene
  1679.     dispose_background
  1680.     dispose_plane
  1681.     dispose_texts
  1682.     dispose_logo
  1683.     dispose_animated_objects
  1684.   end
  1685.  
  1686.   #-----------------------------------------------------------------------------
  1687.   # Dispose Animated Objects
  1688.   #-----------------------------------------------------------------------------
  1689.   def dispose_animated_objects
  1690.     return if @animated_objects.empty?
  1691.     @animated_objects.each { |obj_id, properties|
  1692.     return if properties[:sprites].empty?
  1693.     for sprite in properties[:sprites]
  1694.       sprite.dispose
  1695.     end
  1696.     }
  1697.   end
  1698.  
  1699.   #------------------------------------------------------------------------------
  1700.   # Transition to Title
  1701.   #-----------------------------------------------------------------------------
  1702.   def transition_to_title
  1703.     unless Ixfuru::TitleProduction::INTRO_TRANSITION == "" ||
  1704.       Ixfuru::TitleProduction::INTRO_TRANSITION == nil
  1705.       transition = Ixfuru::TitleProduction::INTRO_TRANSITION
  1706.       Graphics.freeze
  1707.       Graphics.transition(80, "Graphics/Production/" + transition, 80)
  1708.     end
  1709.     RPG::BGM.stop
  1710.     RPG::BGS.stop
  1711.     end_scene
  1712.     @intro_complete = true
  1713.   end
  1714.  
  1715.   #-----------------------------------------------------------------------------
  1716.   # Dispose Plane
  1717.   #-----------------------------------------------------------------------------
  1718.   def dispose_plane
  1719.     return if @plane == nil || @plane.disposed?
  1720.     @plane.dispose
  1721.   end
  1722.  
  1723.   #-----------------------------------------------------------------------------
  1724.   # Dispose Background
  1725.   #-----------------------------------------------------------------------------
  1726.   def dispose_background
  1727.     return if @background == nil || @background.disposed?
  1728.     @background.dispose
  1729.   end
  1730.  
  1731.   #-----------------------------------------------------------------------------
  1732.   # Dispose Logo
  1733.   #-----------------------------------------------------------------------------
  1734.   def dispose_logo
  1735.     return if @logo == nil || @logo.disposed?
  1736.     @logo.dispose
  1737.   end
  1738.  
  1739.   #-----------------------------------------------------------------------------
  1740.   # Dispose Texts
  1741.   #-----------------------------------------------------------------------------
  1742.   def dispose_texts
  1743.     return if @texts == nil || @texts.disposed?
  1744.     if @old_texts_properties[6]
  1745.       until @texts.opacity <= 0
  1746.         @texts.opacity -= @old_texts_properties[7]
  1747.         i = 0
  1748.         until i >= @old_texts_properties[8] * 60 #FadeSpeed
  1749.           i += 1
  1750.         end
  1751.       end
  1752.       @texts.dispose
  1753.     else
  1754.       @texts.dispose
  1755.     end
  1756.   end
  1757.  
  1758.   #-----------------------------------------------------------------------------
  1759.   # Scroll Plane
  1760.   #-----------------------------------------------------------------------------
  1761.   def scroll_plane(direction, speed)
  1762.     case direction
  1763.     when 0 # UpperLeft to LowerRight
  1764.       @plane.ox += speed
  1765.       @plane.oy += speed
  1766.     when 1 # Top to Bottom
  1767.       @plane.oy += speed
  1768.     when 2 # UpperRight to LowerLeft
  1769.       @plane.ox -= speed
  1770.       @plane.oy += speed
  1771.     when 3 # Left to Right
  1772.       @plane.ox += speed
  1773.     when 4 # Right to Left
  1774.       @plane.ox -= speed
  1775.     when 5 # LowerLeft to UpperRight
  1776.       @plane.ox += speed
  1777.       @plane.oy -= speed
  1778.     when 6 # Bottom to Top
  1779.       @plane.oy -= speed
  1780.     when 7 # LowerRight to UpperLeft
  1781.       @plane.ox -= speed
  1782.       @plane.oy -= speed
  1783.     end
  1784.   end
  1785.  
  1786.   #-----------------------------------------------------------------------------
  1787.   # Play Pfoduction SE
  1788.   #-----------------------------------------------------------------------------
  1789.   def play_production_se(sound_id)
  1790.     return if sound_id == nil
  1791.     se = Ixfuru::TitleProduction::SOUNDS[:se][sound_id]
  1792.     RPG::SE.new(se[0], se[1], se[2]).play
  1793.   end
  1794.  
  1795. end
  1796.  
  1797. ################################################################################
  1798. #                             SCENE TITLE
  1799. ################################################################################
  1800. class Scene_Title < Scene_Base
  1801.  
  1802.   def initialize(from_file = false)
  1803.     @production = Title_Production.new
  1804.     if from_file
  1805.       @production.intro_complete = true
  1806.     end
  1807.     @title_ready = false
  1808.     @title_index = 0
  1809.     @moving_extras = []
  1810.   end
  1811.  
  1812.   #--------------------------------------------------------------------------
  1813.   # * Start processing
  1814.   #--------------------------------------------------------------------------
  1815.   def start
  1816.     super
  1817.     load_database                     # Load database
  1818.     create_game_objects               # Create game objects
  1819.     check_continue                    # Determine if continue is enabled
  1820.   end
  1821.  
  1822.   #--------------------------------------------------------------------------
  1823.   # * Post-Start Processing
  1824.   #--------------------------------------------------------------------------
  1825.   def post_start
  1826.   end
  1827.   #--------------------------------------------------------------------------
  1828.   # * Pre-termination Processing
  1829.   #--------------------------------------------------------------------------
  1830.   def pre_terminate
  1831.   end
  1832.  
  1833.   #--------------------------------------------------------------------------
  1834.   # * Termination Processing
  1835.   #--------------------------------------------------------------------------
  1836.   def terminate
  1837.     super
  1838.     dispose_commands
  1839.     dispose_planes
  1840.     dispose_background
  1841.     dispose_logo
  1842.     dispose_subtitle
  1843.     dispose_extras
  1844.     dispose_cursor
  1845.     snapshot_for_background
  1846.   end
  1847.  
  1848.   #--------------------------------------------------------------------------
  1849.   # * Frame Update
  1850.   #--------------------------------------------------------------------------
  1851.   def update
  1852.     super
  1853.     if Ixfuru::TitleProduction::SKIP_INTRO && !@production.intro_complete
  1854.       @production.intro_complete = true
  1855.     elsif !@production.intro_complete
  1856.       @production.update
  1857.     else
  1858.       if @title_ready
  1859.         update_background
  1860.         update_planes
  1861.         update_logo
  1862.         update_subtitle
  1863.         update_extras
  1864.         update_commands
  1865.       else
  1866.         start_title
  1867.       end
  1868.     end
  1869.   end
  1870.  
  1871.   #-----------------------------------------------------------------------------
  1872.   # Start Title
  1873.   #-----------------------------------------------------------------------------
  1874.   def start_title
  1875.     create_background
  1876.     create_planes
  1877.     create_logo
  1878.     create_subtitle
  1879.     create_extras
  1880.     create_commands
  1881.     create_cursor
  1882.     start_bgs
  1883.     start_bgm
  1884.     @title_ready = true
  1885.   end
  1886.  
  1887.   #-----------------------------------------------------------------------------
  1888.   # Create_background
  1889.   #-----------------------------------------------------------------------------
  1890.   def create_background
  1891.     @background_viewport = Viewport.new(0, 0, 544, 416)
  1892.     @background = Sprite.new(@background_viewport)
  1893.     @background.bitmap = Cache.production(Ixfuru::TitleProduction::TITLE_BACKGROUND)
  1894.     if Ixfuru::TitleProduction::TITLE_WAVE
  1895.       @background.wave_amp = Ixfuru::TitleProduction::TITLE_BACKGROUND_WAVE_AMP
  1896.       @background.wave_length = Ixfuru::TitleProduction::TITLE_BACKGROUND_WAVE_LENGTH
  1897.       @background.wave_speed = Ixfuru::TitleProduction::TITLE_BACKGROUND_WAVE_SPEED
  1898.     end
  1899.   end
  1900.  
  1901.   #-----------------------------------------------------------------------------
  1902.   # Create Planes
  1903.   #-----------------------------------------------------------------------------
  1904.   def create_planes
  1905.     @planes = {}
  1906.     tp = Ixfuru::TitleProduction::TITLE_PLANES
  1907.     return if tp.empty?
  1908.     tp.each { |plane_id, properties|
  1909.     vp = Viewport.new(0, 0, 544, 416)
  1910.     vp.z = properties[:z]
  1911.     plane = Plane.new(vp)
  1912.     plane.bitmap = Cache.production(properties[:graphic])
  1913.     plane.opacity = properties[:opacity]
  1914.     @planes[plane_id] = plane
  1915.     }
  1916.   end
  1917.  
  1918.   #-----------------------------------------------------------------------------
  1919.   # Create Logo
  1920.   #-----------------------------------------------------------------------------
  1921.   def create_logo
  1922.     @logo_viewport = Viewport.new(0, 0, 544, 416)
  1923.     @logo = Sprite.new(@logo_viewport)
  1924.     @logo.bitmap = Cache.production(Ixfuru::TitleProduction::TITLE_LOGO)
  1925.     @logo.x = Ixfuru::TitleProduction::TITLE_LOGO_X
  1926.     @logo.y = Ixfuru::TitleProduction::TITLE_LOGO_Y
  1927.   end
  1928.  
  1929.   #-----------------------------------------------------------------------------
  1930.   # Create Subtitle
  1931.   #-----------------------------------------------------------------------------
  1932.   def create_subtitle
  1933.     return unless Ixfuru::TitleProduction::TITLE_SUBTITLE != ""
  1934.     @subtitle_viewport = Viewport.new(0, 0, 544, 416)
  1935.     @subtitle = Sprite.new(@subtitle_viewport)
  1936.     @subtitle.bitmap = Cache.production(Ixfuru::TitleProduction::TITLE_SUBTITLE)
  1937.     @subtitle.x = Ixfuru::TitleProduction::TITLE_SUBTITLE_X
  1938.     @subtitle.y = Ixfuru::TitleProduction::TITLE_SUBTITLE_Y
  1939.   end
  1940.  
  1941.   #-----------------------------------------------------------------------------
  1942.   # Create Extras
  1943.   #-----------------------------------------------------------------------------
  1944.   def create_extras
  1945.     @extras = []
  1946.     tei = Ixfuru::TitleProduction::TITLE_EXTRA_IMAGES
  1947.     return if Ixfuru::TitleProduction::TITLE_EXTRA_IMAGES.empty?
  1948.     tei.each { |tei_id, properties|
  1949.     vp = Viewport.new(0, 0, 544, 416)
  1950.     vp.z = properties[:viewport_z]
  1951.     extra = Sprite.new(vp)
  1952.     extra.bitmap = Cache.production(properties[:image])
  1953.     extra.x = properties[:x]
  1954.     extra.y = properties[:y]
  1955.     extra.opacity = properties[:opacity]
  1956.     unless properties[:wave].empty?
  1957.       extra.wave_amp = properties[:wave][0]
  1958.       extra.wave_length = properties[:wave][1]
  1959.       extra.wave_speed = properties[:wave][2]
  1960.     end
  1961.     extra.zoom_x = properties[:zoom_x]
  1962.     extra.zoom_y = properties[:zoom_y]
  1963.     @extras.push(extra)
  1964.     if Ixfuru::TitleProduction::MOVING_EXTRAS.include?(tei_id)
  1965.       @moving_extras.push(extra)
  1966.     end
  1967.     }
  1968.   end
  1969.  
  1970.   #-----------------------------------------------------------------------------
  1971.   # Create Commands
  1972.   #-----------------------------------------------------------------------------
  1973.   def create_commands
  1974.     @commands = {}
  1975.     @cursor_ys = {}
  1976.     comms = Ixfuru::TitleProduction::TITLE_COMMANDS
  1977.     @command_x = Ixfuru::TitleProduction::TITLE_COMMAND_X
  1978.     cy = Ixfuru::TitleProduction::TITLE_COMMAND_Y
  1979.     @commands_viewport = Viewport.new(0, 0, 544, 416)
  1980.     @commands_viewport.z = Ixfuru::TitleProduction::TITLE_COMMAND_Z
  1981.     comms.each { |command_id, properties|
  1982.     comm = Sprite.new(@commands_viewport)
  1983.     comm.bitmap = Cache.production(properties[:graphic])
  1984.     @cursor_ys[command_id] = cy
  1985.     comm.x = @command_x
  1986.     comm.y = cy
  1987.     cy += comm.height
  1988.     @commands[command_id] = comm
  1989.     }
  1990.   end
  1991.  
  1992.   #-----------------------------------------------------------------------------
  1993.   # Create Cursor
  1994.   #-----------------------------------------------------------------------------
  1995.   def create_cursor
  1996.     @cursor = Sprite.new(@commands_viewport)
  1997.     @cursor.bitmap = Cache.production(Ixfuru::TitleProduction::TITLE_CURSOR_GRAPHIC)
  1998.     @cursor.x = @command_x - (@cursor.width + 4)
  1999.     @cursor.y = @cursor_ys[0]
  2000.   end
  2001.  
  2002.   #-----------------------------------------------------------------------------
  2003.   # Start Background Sound
  2004.   #-----------------------------------------------------------------------------
  2005.   def start_bgs
  2006.     bgs_id = Ixfuru::TitleProduction::TITLE_SOUND_IDS[:bgs]
  2007.     bgs = Ixfuru::TitleProduction::SOUNDS[:bgs][bgs_id]
  2008.     RPG::BGS.new(bgs[0], bgs[1], bgs[2]).play
  2009.   end
  2010.  
  2011.   #-----------------------------------------------------------------------------
  2012.   # Start Background Music
  2013.   #-----------------------------------------------------------------------------
  2014.   def start_bgm
  2015.     bgm_id = Ixfuru::TitleProduction::TITLE_SOUND_IDS[:bgm]
  2016.     bgm = Ixfuru::TitleProduction::SOUNDS[:bgm][bgm_id]
  2017.     RPG::BGM.new(bgm[0], bgm[1], bgm[2]).play
  2018.   end
  2019.  
  2020.   #-----------------------------------------------------------------------------
  2021.   # Update Commands
  2022.   #-----------------------------------------------------------------------------
  2023.   def update_commands
  2024.     @commands.each_value { |c|
  2025.     c.update
  2026.     }
  2027.     @cursor.update
  2028.     if Input.trigger?(Input::C)
  2029.       comm = Ixfuru::TitleProduction::TITLE_COMMANDS[@title_index]
  2030.       if comm[:scene] == "scene_file" && !@continue_enabled
  2031.         Sound.play_buzzer
  2032.       else
  2033.         Sound.play_decision
  2034.         determine_scene_change
  2035.       end
  2036.     elsif Input.trigger?(Input::UP)
  2037.       Sound.play_cursor
  2038.       if @title_index == 0
  2039.         @title_index = @commands.size - 1
  2040.         update_cursor_position
  2041.       else
  2042.         @title_index -= 1
  2043.         update_cursor_position
  2044.       end
  2045.     elsif Input.trigger?(Input::DOWN)
  2046.       Sound.play_cursor
  2047.       if @title_index == @commands.size - 1
  2048.         @title_index = 0
  2049.         update_cursor_position
  2050.       else
  2051.         @title_index += 1
  2052.         update_cursor_position
  2053.       end
  2054.     end
  2055.   end
  2056.  
  2057.   #-----------------------------------------------------------------------------
  2058.   # Update Cursor Position
  2059.   #-----------------------------------------------------------------------------
  2060.   def update_cursor_position
  2061.     @cursor.y = @cursor_ys[@title_index]
  2062.   end
  2063.  
  2064.   #-----------------------------------------------------------------------------
  2065.   # Update Background
  2066.   #-----------------------------------------------------------------------------
  2067.   def update_background
  2068.     @background.update
  2069.   end
  2070.  
  2071.   #-----------------------------------------------------------------------------
  2072.   # Update Planes
  2073.   #-----------------------------------------------------------------------------
  2074.   def update_planes
  2075.     tp = Ixfuru::TitleProduction::TITLE_PLANES
  2076.     return if tp.empty?
  2077.     @planes.each { |plane_id, plane|
  2078.     scroll_plane(plane_id, plane)
  2079.     }
  2080.   end
  2081.  
  2082.   #-----------------------------------------------------------------------------
  2083.   # Scroll Plane
  2084.   #-----------------------------------------------------------------------------
  2085.   def scroll_plane(plane_id, plane)
  2086.     tp = Ixfuru::TitleProduction::TITLE_PLANES
  2087.     properties = tp[plane_id]
  2088.     speed = properties[:speed]
  2089.     case properties[:direction]
  2090.     when 0 # UpperLeft to LowerRight
  2091.       plane.ox += speed
  2092.       plane.oy += speed
  2093.     when 1 # Top to Bottom
  2094.       plane.oy += speed
  2095.     when 2 # UpperRight to LowerLeft
  2096.       plane.ox -= speed
  2097.       plane.oy += speed
  2098.     when 3 # Left to Right
  2099.       plane.ox += speed
  2100.     when 4 # Right to Left
  2101.       plane.ox -= speed
  2102.     when 5 # LowerLeft to UpperRight
  2103.       plane.ox += speed
  2104.       plane.oy -= speed
  2105.     when 6 # Bottom to Top
  2106.       plane.oy -= speed
  2107.     when 7 # LowerRight to UpperLeft
  2108.       plane.ox -= speed
  2109.       plane.oy -= speed
  2110.     end
  2111.   end
  2112.  
  2113.   #-----------------------------------------------------------------------------
  2114.   # Update Logo
  2115.   #-----------------------------------------------------------------------------
  2116.   def update_logo
  2117.     @logo.update
  2118.   end
  2119.  
  2120.   #-----------------------------------------------------------------------------
  2121.   # Update Subtitle
  2122.   #-----------------------------------------------------------------------------
  2123.   def update_subtitle
  2124.     return if @subtitle == nil
  2125.     @subtitle.update
  2126.   end
  2127.  
  2128.   #-----------------------------------------------------------------------------
  2129.   # Update Extras
  2130.   #-----------------------------------------------------------------------------
  2131.   def update_extras
  2132.     return if @extras.empty?
  2133.     for extra in @extras
  2134.       extra.update
  2135.       if @moving_extras.include?(extra)
  2136.         update_moving_extra(extra)
  2137.       end
  2138.     end
  2139.   end
  2140.  
  2141.   #-----------------------------------------------------------------------------
  2142.   # Update Moving Extras
  2143.   #-----------------------------------------------------------------------------
  2144.   def update_moving_extra(sprite)
  2145.     sx = sprite.x
  2146.     sy = sprite.y
  2147.     sz = sprite.zoom_x
  2148.     move_type = 0
  2149.     case move_type
  2150.     when 0
  2151.       ppm = [0, 1, 2, 3] #possible parallel moves (left, right, up, down)
  2152.       pdm = [0, 1] # possible distance moves (zoom grow, zooms shrink)
  2153.       xbounds = Ixfuru::TitleProduction::MOVING_EXTRAS_X_BOUNDARIES
  2154.       ybounds = Ixfuru::TitleProduction::MOVING_EXTRAS_Y_BOUNDARIES
  2155.       zbounds = Ixfuru::TitleProduction::MOVING_EXTRAS_ZOOM_BOUNDARIES
  2156.       pmove = Ixfuru::TitleProduction::MOVING_EXTRAS_PARALLEL_MOVE_RATE
  2157.       dmove = Ixfuru::TitleProduction::MOVING_EXTRAS_DISTANCE_MOVE_RATE
  2158.       if sx - pmove <= xbounds[0]
  2159.         ppm.delete(0)
  2160.       elsif sx + pmove >= xbounds[1]
  2161.         ppm.delete(1)
  2162.       end
  2163.       if sy - pmove <= ybounds[0]
  2164.         ppm.delete(2)
  2165.       elsif sy + pmove >= ybounds[1]
  2166.         ppm.delete(3)
  2167.       end
  2168.       if sz - dmove <= zbounds[0]
  2169.         pdm.delete(1)
  2170.       elsif  sz + dmove >= zbounds[1]
  2171.         pdm.delete(1)
  2172.       end
  2173.       next_move = rand(3)
  2174.       if next_move < 2
  2175.         move = ppm[rand(ppm.size)]
  2176.         move_parallel(sprite, move, pmove)
  2177.       else
  2178.         move = pdm[rand(pdm.size)]
  2179.         move_distance(sprite, move, dmove)
  2180.       end
  2181.     end
  2182.   end
  2183.  
  2184.   #-----------------------------------------------------------------------------
  2185.   # Move Parallel
  2186.   #-----------------------------------------------------------------------------
  2187.   def move_parallel(sprite, direction, amount)
  2188.     case direction
  2189.     when 0
  2190.       sprite.x += amount
  2191.     when 1
  2192.       sprite.x -= amount
  2193.     when 2
  2194.       sprite.y += amount
  2195.     when 3
  2196.       sprite.y -= amount
  2197.     end
  2198.   end
  2199.  
  2200.   #-----------------------------------------------------------------------------
  2201.   # Move Distance
  2202.   #-----------------------------------------------------------------------------
  2203.   def move_distance(sprite, direction, amount)
  2204.     case direction
  2205.     when 0
  2206.       sprite.zoom_x += amount
  2207.       sprite.zoom_y += amount
  2208.     when 1
  2209.       sprite.zoom_x -= amount
  2210.       sprite.zoom_y -= amount
  2211.     end
  2212.   end
  2213.  
  2214.   #-----------------------------------------------------------------------------
  2215.   # Dispose Background
  2216.   #-----------------------------------------------------------------------------
  2217.   def dispose_background
  2218.     @background.dispose
  2219.   end
  2220.  
  2221.   #-----------------------------------------------------------------------------
  2222.   # Dispose Planes
  2223.   #-----------------------------------------------------------------------------
  2224.   def dispose_planes
  2225.     return if @planes.empty?
  2226.     @planes.each_value { |plane|
  2227.     plane.dispose
  2228.     }
  2229.   end
  2230.  
  2231.   #-----------------------------------------------------------------------------
  2232.   # Dispose Logo
  2233.   #-----------------------------------------------------------------------------
  2234.   def dispose_logo
  2235.     @logo.dispose
  2236.   end
  2237.  
  2238.   #-----------------------------------------------------------------------------
  2239.   # Dispose Subtitle
  2240.   #-----------------------------------------------------------------------------
  2241.   def dispose_subtitle
  2242.     return if @subtitle == nil
  2243.     @subtitle.dispose
  2244.   end
  2245.  
  2246.   #-----------------------------------------------------------------------------
  2247.   # Dispose Extras
  2248.   #-----------------------------------------------------------------------------
  2249.   def dispose_extras
  2250.     return if @extras.empty?
  2251.     for extra in @extras
  2252.       extra.dispose
  2253.     end
  2254.   end
  2255.  
  2256.   #-----------------------------------------------------------------------------
  2257.   # Dispose_Commands
  2258.   #-----------------------------------------------------------------------------
  2259.   def dispose_commands
  2260.     @commands.each_value { |command|
  2261.     command.dispose
  2262.     }
  2263.   end
  2264.  
  2265.   #-----------------------------------------------------------------------------
  2266.   # Dispose Cursor
  2267.   #-----------------------------------------------------------------------------
  2268.   def dispose_cursor
  2269.     @cursor.dispose
  2270.   end
  2271.  
  2272.   #--------------------------------------------------------------------------
  2273.   # * Determine if Continue is Enabled
  2274.   #--------------------------------------------------------------------------
  2275.   def check_continue
  2276.     @continue_enabled = (Dir.glob('Save*.rvdata').size > 0)
  2277.   end
  2278.  
  2279.   #--------------------------------------------------------------------------
  2280.   # * Check Player Start Location Existence
  2281.   #--------------------------------------------------------------------------
  2282.   def confirm_player_location
  2283.     if $data_system.start_map_id == 0
  2284.       print "Player start location not set."
  2285.       exit
  2286.     end
  2287.   end
  2288.  
  2289.   #-----------------------------------------------------------------------------
  2290.   # Determine Scene Change
  2291.   #-----------------------------------------------------------------------------
  2292.   def determine_scene_change
  2293.     comms = Ixfuru::TitleProduction::TITLE_COMMANDS
  2294.     new_scene = comms[@title_index][:scene]
  2295.     case new_scene
  2296.     when "scene_map"
  2297.       command_new_game
  2298.     when "scene_file"
  2299.       command_continue
  2300.     when nil
  2301.       command_shutdown
  2302.     ##**************************************************************************
  2303.     ## SECTION X:
  2304.     ##
  2305.     ## Custom SCene Changes
  2306.     ##
  2307.     ## For each custom scene you referenced in your command setup, you need to
  2308.     ## alter this scene to call the method which will take you there.  To do
  2309.     ## that, use this:
  2310.     ##
  2311.     ##               when string_reference
  2312.     ##                  method_name
  2313.     ##
  2314.     ## for 'string_reference', you need to give the exact double-quoted ("")
  2315.     ## string (word) you provided in section 5c for the :scene property.
  2316.     ## for 'method_name' you can give anything, but by rule, you should
  2317.     ## use 'command_' to prefix the method's name.  Like 'command_credits' or
  2318.     ## 'command_options', etc.
  2319.     ##
  2320.     ## Once you've finished this preliminary call, you need to skip down to the
  2321.     ## last section SECTION X2: Custom Methods in order to create the actual
  2322.     ## method which will take you to your new scene.
  2323.     ##**************************************************************************
  2324.     when "scene_credits"
  2325.       command_credits
  2326.     end
  2327.   end
  2328.  
  2329.   #--------------------------------------------------------------------------
  2330.   # * Command: New Game (OVERWRITTEN)
  2331.   #--------------------------------------------------------------------------
  2332.   def command_new_game
  2333.     confirm_player_location
  2334.     Sound.play_decision
  2335.     $game_party.setup_starting_members            # Initial party
  2336.     $game_map.setup($data_system.start_map_id)    # Initial map position
  2337.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  2338.     $game_player.refresh
  2339.     $scene = Scene_Map.new
  2340.     RPG::BGM.fade(1500)
  2341.     RPG::BGS.fade(1500)
  2342.     Graphics.fadeout(60)
  2343.     Graphics.wait(40)
  2344.     Graphics.frame_count = 0
  2345.     RPG::BGM.stop
  2346.     RPG::BGS.stop
  2347.     toggle_preset_switches
  2348.     alter_preset_variables
  2349.     $game_map.autoplay
  2350.   end
  2351.  
  2352.   #-----------------------------------------------------------------------------
  2353.   # Toggle Preset Switches
  2354.   #-----------------------------------------------------------------------------
  2355.   def toggle_preset_switches
  2356.     switches = Ixfuru::TitleProduction::PRESET_SWITCHES
  2357.     return if switches == nil || switches.empty?
  2358.     for switch in switches
  2359.       $game_switches[switch] = true
  2360.     end
  2361.   end
  2362.  
  2363.   #-----------------------------------------------------------------------------
  2364.   # Alter Preset Variables
  2365.   #-----------------------------------------------------------------------------
  2366.   def alter_preset_variables
  2367.     variables = Ixfuru::TitleProduction::PRESET_VARIABLES
  2368.     return if variables == nil || variables.empty?
  2369.     variables.each { |var_id, amount|
  2370.     $game_variables[var_id] = amount
  2371.     }
  2372.   end
  2373.  
  2374.   #--------------------------------------------------------------------------
  2375.   # * Command: Continue
  2376.   #--------------------------------------------------------------------------
  2377.   def command_continue
  2378.     if @continue_enabled
  2379.       RPG::BGS.stop
  2380.       RPG::BGM.stop
  2381.       Sound.play_decision
  2382.       $scene = Scene_File.new(false, true, false)
  2383.     else
  2384.       Sound.play_buzzer
  2385.     end
  2386.   end
  2387.  
  2388.   ##============================================================================
  2389.   ##
  2390.   ## SECTION X2:
  2391.   ##
  2392.   ## Custom Methods
  2393.   ##
  2394.   ## By default, I've prepared a little method for you to follow here if all you
  2395.   ## want to do is call a new scene.  Just make sure, when you create yours,
  2396.   ## you put the RPG::BGS.stop, RPG::BGM.stop and the $scene = parts in your
  2397.   ## new method, as that alone will take you where you want to go and assure
  2398.   ## you that you have no lingering sounds from the Title Scene.  Here's an
  2399.   ## example, besides the command_credits I've given you.
  2400.   ##
  2401.   ##   def command_options
  2402.   ##     RPG::BGS.stop
  2403.   ##     RPG::BGM.stop
  2404.   ##     $scene = Scene_Options.new
  2405.   ##   end
  2406.   ##
  2407.   ##^^^^^^^^^^^^^VERY IMPORTANT^^^^^^^^^^^^^^^^^^^^^
  2408.   ##
  2409.   ## Two things, first of all choosing the credits command in the default WILL
  2410.   ## throw an error, because no such scene exists.  And secondly, placing a new
  2411.   ## method DOES NOT AUTOMATICALLY MAKE THE SCENE appear.  You must have the
  2412.   ## scene you want to call created in one of your scripts!
  2413.   ##
  2414.   ##============================================================================
  2415.   #-----------------------------------------------------------------------------
  2416.   # Command: Credits
  2417.   #-----------------------------------------------------------------------------
  2418.   def command_credits
  2419.     RPG::BGS.fade(1500)
  2420.     RPG::BGM.fade(1500)
  2421.     Graphics.fadeout(60)
  2422.     Graphics.wait(40)
  2423.     RPG::BGS.stop
  2424.     RPG::BGM.stop
  2425.     $scene = Scene_Credits.new(title)
  2426.   end
  2427.  
  2428.   # place your new methods HERE!
  2429.  
  2430.   ##############################################################################
  2431.   #*****************************************************************************
  2432.   #             DON'T EDIT BELOW HERE
  2433.   #*****************************************************************************
  2434.   ##############################################################################
  2435.  
  2436. end
  2437.  
  2438. ################################################################################
  2439. #                       SCENE FILE
  2440. ################################################################################
  2441. class Scene_File < Scene_Base
  2442.  
  2443.   #--------------------------------------------------------------------------
  2444.   # * Return to Original Screen (Aliased)`
  2445.   #--------------------------------------------------------------------------
  2446.   def return_scene
  2447.     if @from_title
  2448.       $scene = Scene_Title.new(true)
  2449.     elsif @from_event
  2450.       $scene = Scene_Map.new
  2451.     else
  2452.       $scene = Scene_Menu.new(4)
  2453.     end
  2454.   end
  2455.  
  2456. end
Advertisement
Add Comment
Please, Sign In to add comment