CrowMakerVX

TitleProduction1.0

Jan 20th, 2014
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 72.39 KB | None | 0 0
  1. ################################################################################
  2. #                        TITLE PRODUCTION 1.0
  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.     #===========================================================================
  215.     # 3b.  Intro : Production
  216.     #
  217.     # Okay, so you've now created the images which will be used as the performers
  218.     # in your big intro scene, now its time to put them to work, by giving them
  219.     # direction and roles to fill.  
  220.     #
  221.     # The production part of the script is the most complex and MOST CRUCIAL to
  222.     # developing a great intro. The entire thing is stored in a massive hash called
  223.     # 'PRODUCTION'.  Within the hash, you will set up each phaze of the intro, by
  224.     # using step names to call in the given images at the given times.
  225.     # When you call upon them, do so in string form, double-quoted, ("").  The
  226.     # following lists each 'step_name' and displays the settings each specific
  227.     # step is required to have to make it valid.
  228.     #
  229.     #---------------------------------------------------------------------------
  230.     #                               3b(1)
  231.     #---------------------------------------------------------------------------
  232.     #
  233.     # "ilogos" : this calls in an INTRO_LOGOS graphic.  
  234.     #
  235.     #                           -properties-
  236.     #
  237.     #          id : this refers to the element of the INTRO_LOGOS where the
  238.     #               graphic is located.
  239.     #          x : the x coordinate where the logo should be placed(0-544)
  240.     #          y : the y coordinate where the logo should be placed(0-416)
  241.     #          se_in : the sound which should be played when the logo appears;
  242.     #                  set this 'nil' if you don't want a sound effect. The value
  243.     #                  you set here refers to the 'SOUNDS' hash in the section
  244.     #                  4, and refers to the id given in the :se part of the hash.
  245.     #          se_out : the sound effect you wish to play when logo disappears;
  246.     #                   set to nil, for no se.
  247.     #
  248.     #                             -array form-
  249.     #        
  250.     #                     [id, x, y, se_in, se_out]
  251.     #
  252.     #---------------------------------------------------------------------------
  253.     #
  254.     # "itexts" : this calls one of the INTRO_TEXTS graphics into play.
  255.     #
  256.     #                          -properties-
  257.     #
  258.     #            id : this refers to the element of the INTRO_TEXTS array where
  259.     #                 the graphic is located.  
  260.     #             x : the x coordinate of the image
  261.     #             y : the y coordinate of the image
  262.     #             se_in : sound effect upon appearing
  263.     #             se_out : sound effect upon disappearing
  264.     #             fadein : should the text fade in? (true or false)
  265.     #             fadeout :should the text_fade out? (true or false)
  266.     #             fade_frames : frames it takes to fade in or out
  267.     #             fade_speed : opacity gained or reduced per frame when fading
  268.     #
  269.     #                             -array form-
  270.     #        
  271.     #     [id, x, y, se_in, se_out, fadein, fadeout, fade_frames, fade_speed]
  272.     #
  273.     #---------------------------------------------------------------------------
  274.     #
  275.     # "iplane" : this calls one of the INTRO_PLANES into the scene.  
  276.     #
  277.     #                           -properties-
  278.     #
  279.     #            id : id of the plane you want to call, refers to the hash key
  280.     #                 of the INTRO_PLANES hash which refers to the given plane.
  281.     #
  282.     #                             -array form-
  283.     #        
  284.     #                                 [id]
  285.     #
  286.     #---------------------------------------------------------------------------
  287.     #
  288.     # "iback" : this calls one of the INTRO_BACKGROUNDS into play
  289.     #
  290.     #                           -properties-
  291.     #
  292.     #            id : refers to the element of the INTRO_BACKGROUNDS array, where
  293.     #                 the image name is located.
  294.     #            se_in : sound effect to play when appearing
  295.     #            se_out : sound effect to play when disappearing
  296.     #
  297.     #                           -array form-
  298.     #        
  299.     #                          [id, se_in, se_out]
  300.     #
  301.     #---------------------------------------------------------------------------
  302.     #
  303.     # "ibgm" : this calls for a new background music
  304.     #
  305.     #                        -properties-
  306.     #
  307.     #              id : refers to the hash key, or reference value of the
  308.     #                   background you wish to call, located in the SOUNDS hash
  309.     #                  of section 4, under the :bgm property.
  310.     #
  311.     #                        -array form-
  312.     #        
  313.     #                            [id]
  314.     #
  315.     #---------------------------------------------------------------------------
  316.     #
  317.     # "ibgs" : calls in a new background sound
  318.     #
  319.     #                       -properties-
  320.     #
  321.     #              id : refers to the hash key of the SOUNDS :bgs you wish to
  322.     #                   start playing
  323.     #
  324.     #                        -array form-
  325.     #        
  326.     #                            [id]
  327.     #
  328.     #---------------------------------------------------------------------------
  329.     #
  330.     # "ise" : calls in a sound effect
  331.     #
  332.     #                        -properties-
  333.     #            
  334.     #               id : refers to the hash key of the SOUNDS :se hash for the
  335.     #                    sound effect you wish to play
  336.     #
  337.     #                        -array form-
  338.     #        
  339.     #                            [id]
  340.     #
  341.     #---------------------------------------------------------------------------
  342.     #
  343.     # nil :  using nil as the step call, tells the system not to add any new
  344.     #        images or sounds, but to just wait
  345.     #
  346.     #                       -properties-
  347.     #                
  348.     #                           none
  349.     #
  350.     #                       -array form-
  351.     #
  352.     #                           none
  353.     #
  354.     #---------------------------------------------------------------------------
  355.     #                               3b(2)
  356.     #---------------------------------------------------------------------------
  357.     #
  358.     # For each part of the PRODUCTION hash, you give an chronological id and
  359.     # link it to the properties for each step call.  This is the formula for
  360.     # each entry:
  361.     #
  362.     #    chronological_id => {:for_frames => amount_of_frames
  363.     #                         :step => [step_call_string, [properties]]
  364.     #
  365.     # chronological_id : this value is set to an integer.  It must start at 0 (zero)
  366.     #                    and each id much be one more than the last.  You can
  367.     #                    add as many segments to the intro scene as you want and
  368.     #                    therefor there is no max limit.
  369.     #
  370.     # :for_frames : for the 'amount_of_frames' part, replace it with an integer
  371.     #               value which states how long this segment of the scene lasts.
  372.     #               The :for_frames property is used to tell the system when to
  373.     #               advance to the next step_id and call in the next part of the
  374.     #               scene.  So, if you set this to 180, the scene will wait 180
  375.     #               frames before progressing to the next chronological_id.  The
  376.     #               counter will not begin until the new image or section's
  377.     #               call is completely fulfilled, so don't worry about items
  378.     #               which may take a little longer to fulfill than others.
  379.     #
  380.     # :step : this property is where you will actually insert the step call string
  381.     #         and an array of the various properties each step requires as listed
  382.     #         above in section 3b(1).  The set up for this property is as follows
  383.     #            
  384.     #                   step => [step_call_string, [properties]]
  385.     #
  386.     #         And here is an example of a valid call:
  387.     #
  388.     #                  :step => ["iback", [2, "Slash1", "Slash2"]],
  389.     #
  390.     #         In the example above, we call for a background, the graphic's name
  391.     #         is the 2nd element of the INTRO_BACKGROUNDS array.  When the
  392.     #         background appears, we play the sound effect, "Slash1" and when it
  393.     #         disappears, we play "Slash2".
  394.     #
  395.     #         Example of a simple wait:
  396.     #
  397.     #                 :step => [nil]
  398.     #
  399.     #          That's the proper way to call for a wait.  Since nil has no
  400.     #          properties, we can omit the array as the second element of the
  401.     #          :step array.  Refer to section 3b(1) for the proper array set
  402.     #          up for the given step call.
  403.     #
  404.     #*******IXFURUS TRICKS************
  405.     # Got a few pictures that make up an animation.  Though, the system doesn't
  406.     # incorporate animations, you can make one by placing all the images you
  407.     # want to use as a logo, background or text image and play them successively
  408.     # quickly, like this  (for background):
  409.     #
  410.     # 0 => {:for_frames => 3,
  411.     #       :step => ["iback", [0, "Sword1", nil]},
  412.     #
  413.     # 1 => {:for_frames => 3,
  414.     #       :step => ["iback", [1, "Sword2", nil]},
  415.     #
  416.     # 2 => {:for_frames => 3,
  417.     #       :step => ["iback", [2, "Sword3", nil]},
  418.     #
  419.     # If you've been following along, you would see that each one of these
  420.     # images would appear 3 frames apart, and it would call a different
  421.     # graphic from the INTRO_BACKGROUNDS array each time. (The sound effects,
  422.     # "Sword1", "Sword2", etc.  aren't meaningful in this sequence, but shows
  423.     # that you can play a different sound each image of the 'animation'.
  424.     #*************************************
  425.     #
  426.     #===========================================================================
  427.  
  428.     PRODUCTION = {
  429.    
  430.     #flag_id => {:for_frames => frames_to_run_flagstep,
  431.     #            :step => [prodcution_string, properties]}
  432.    
  433.     0 => {:for_frames => 20,
  434.           :step => [nil]},
  435.    
  436.     # START_BGS
  437.     1 => {:for_frames => 10,
  438.           :step => ["ibgs", [1]]},
  439.          
  440.     # SHOW BACKGROUND
  441.     2 => {:for_frames => 10,
  442.           :step => ["iback", [0, nil, nil]]},
  443.          
  444.     # SHOW PLANE
  445.     3 => {:for_frames => 10,
  446.           :step => ["iplane", [0]]},
  447.          
  448.     # SHOW INTRO LOGO
  449.     4 => {:for_frames => 270,
  450.           :step => ["ilogos", [0, 80, 160, 1, nil]]},
  451.    
  452.     # SHOW FIRST TEXT
  453.     5 => {:for_frames => 180,
  454.           :step => ["itexts", [0, 80, 160, 0, nil, true, true, 75, 1]]},
  455.          
  456.     # BETWEEN TEXT
  457.     6 => {:for_frames => 60,
  458.           :step => [nil]},
  459.          
  460.     # SHOW SECOND TEXT
  461.     7 => {:for_frames => 180,
  462.           :step => ["itexts", [1, 80, 160, 0, nil, true, true, 75, 1]]},
  463.          
  464.     # BETWEEN TEXT
  465.     8 => {:for_frames => 60,
  466.           :step => [nil]},
  467.          
  468.     # SHOW LAST TEXT
  469.     9 => {:for_frames => 180,
  470.           :step => ["itexts", [2, 80, 160, 0, nil, true, true, 75, 1]]},
  471.          
  472.     # FINAL WAIT
  473.     10 => {:for_frames => 90,
  474.            :step => [nil]}
  475.          
  476.     }
  477.    
  478.     #===========================================================================
  479.     #
  480.     # SECTION 4:
  481.     #
  482.     # Sounds
  483.     #
  484.     # There are three types of sounds used in the system, BGMs (background music),
  485.     # BGS (background sound) and SE (sound effects).   The following hash
  486.     # is used to store all the sounds that you will be using.  This includes those
  487.     # you wish to use in the Intro (and referred to in the PRODUCTION hash) and
  488.     # those you wish to use in the Title scene, which is set up in SECTION 5.
  489.     # To set up the hash, fill in those sounds which you wish to use, giving
  490.     # them each an 'id' or reference value for the hash key and then a three
  491.     # element array which is used to store the actual sound and its properties
  492.     # that you wish to use.  There are three sub-hashes, one for the BGMs, called
  493.     # :bgm, one for the BGSs, called :bgs and one for the SEs, called :se.
  494.     # In each, the formula is the same:
  495.     #
  496.     #          sound_id => [sound_filename, volume, pitch],
  497.     #
  498.     # For the 'sound_filename', just make sure you are referencing an audio file
  499.     # from the appropriate subhash.  In other words, don't call a BGM audio file
  500.     # to play in the SE section.
  501.     #
  502.     #===========================================================================
  503.    
  504.     SOUNDS = {
  505.    
  506.     :bgm => {0 => ["Realm of Sirs", 80, 100]},
  507.    
  508.     :bgs => {0 => ["Wind", 40, 100],
  509.             1 => ["ambience", 40, 100]},
  510.    
  511.     :se => {0 => ["Magic", 100, 50],
  512.             1 => ["Normal Item Get", 100, 80]}
  513.            
  514.     }
  515.    
  516.     # -title sounds-
  517.     #
  518.     # Though the sounds are stored above and you can use multiple bgms, bgs
  519.     # in the Intro, you must designate a specific bgm and bgs for use in the title
  520.     # scene.  You do this by putting the sound_id for the sound you wish to
  521.     # use as defined in the SOUNDS hash.
  522.    
  523.     TITLE_SOUND_IDS = {
  524.    
  525.     :bgm => 0,
  526.     :bgs => 0,
  527.    
  528.     }
  529.    
  530.     #===========================================================================
  531.     #
  532.     # SECTION 5:
  533.     #
  534.     # The Title Scene
  535.     #
  536.     # There are several sections you can customize in the title scene.  This
  537.     # includes the logo, subtitle logo, commands images, cursor image, planes
  538.     # and 'extra' images.  Each section has specific values which must be setup
  539.     # in order to make the scene valid.  Follow the instructions for each.
  540.     #
  541.     #===========================================================================
  542.    
  543.     #===========================================================================
  544.     #
  545.     # 5a.  Title : Logo
  546.     #
  547.     # The title logo is the actual image which represents the name of the game.
  548.     # It is a necessary part of the scene.  You can only have one Title logo and
  549.     # it cannot be changed.  The only properties you can change for the logo are
  550.     # the x and y coordinates
  551.     #===========================================================================
  552.    
  553.     # Refers to the graphic's filename you wish to use
  554.     TITLE_LOGO = "Logo"
  555.    
  556.     # Refers to the x and y placement of the logo image
  557.     TITLE_LOGO_X = 95
  558.     TITLE_LOGO_Y = 10
  559.    
  560.     #===========================================================================
  561.     #
  562.     # 5b.   Title : Subtitle
  563.     #
  564.     # It is NOT necessary to have a subtitle.  But this image will be used to
  565.     # display the subtitle to the game, or any other image you may wish to display
  566.     # as 'part of' the logo.   Like the Logo, you only need to set up the
  567.     # x and y placement here.  Use 'nil' or an empty string, "" for this value
  568.     # to bypass using it.
  569.     #===========================================================================
  570.    
  571.     # The Graphic
  572.     TITLE_SUBTITLE = ""
  573.    
  574.     # The coordinates
  575.     TITLE_SUBTITLE_X = 120
  576.     TITLE_SUBTITLE_Y = 70
  577.    
  578.     #===========================================================================
  579.     #
  580.     # 5c.   Title : Commands
  581.     #
  582.     # The commands images are what replaces the little window which shows
  583.     # the options for the player when he/she first loads up the title scene
  584.     # in the default system.  In this script, you get a different command
  585.     # for each of the commands.  And You CAN HAVE UNLIMITED commands, as long
  586.     # as you can make them fit on the screen AND provided they all have the same
  587.     # height.  This is important, as they need to look structured in some sort of
  588.     # way for when the cursor image moves amongst them awaiting user selection.
  589.     # So again, you can have however many you want, but they MUST be the same
  590.     # height.  
  591.     #
  592.     # The commands properties are stored in a hash.  This hash holds three
  593.     # important properties.  The hash key represents the order in which they
  594.     # will be displayed.  So, you need to start at zero and advance upwards
  595.     # by one with each new command.  This value is used by the cursor for
  596.     # command index.
  597.     #
  598.     #   command_index => {:graphic => filename,
  599.     #                     :scene => string_reference_to_new_scene},
  600.     #
  601.     # Replace 'filename' for the :graphic property with the name of the
  602.     # image you wish to use for the given command.  Then replace the
  603.     # 'string_reference_to_new_scene' with a double-quoted ("") string (word)
  604.     # which references to the scene you wish to change to when the player selects
  605.     # the given command.  
  606.     #
  607.     #^^^^^^^^^^^^VERY IMPORTANT^^^^^^^^^^^^^^^^
  608.     #
  609.     # You MUST have a command which references "scene_map" for when the player
  610.     # wants to start a new game, "scene_file" for when the player wants to
  611.     # continue their saved game and advance to the file scene.  And a 'nil',
  612.     # without the quotes for when the player wants to exit the program.  The
  613.     # order of them is not crucial, and you can reference other scenes from
  614.     # here if you want to.  Even custom scenes like options/credits/minigame, etc.
  615.     # Just as long as you create one for each of the mandatory ones just
  616.     # described.
  617.     #
  618.     #^^^^^^^^^^^^VERY IMPORTANT^^^^^^^^^^^^^^^^^
  619.     #
  620.     # Though the functions required to move to the mandatory scenes are
  621.     # part of the script, if you reference a new or unique scene which is not
  622.     # one of these, YOU MUST SET UP THE 'SECTION X: Custom Scene Change' section
  623.     # which is found late in the script.  This will be further explained in Section
  624.     # 6.
  625.     #===========================================================================
  626.    
  627.     TITLE_COMMANDS = {
  628.    
  629.     0 => {:graphic => "NewGame",
  630.           :scene => "scene_map"},
  631.          
  632.     1 => {:graphic => "Continue",
  633.           :scene => "scene_file"},
  634.          
  635.     2 => {:graphic => "Credits",
  636.           :scene => "scene_credits"},
  637.          
  638.     3 => {:graphic => "Exit",
  639.           :scene => nil},
  640.          
  641.     }
  642.    
  643.     # -command placement-
  644.     #
  645.     # With these three variables, you set up the placement of where you want the
  646.     # commands of the title scene to appear.  Here's how it works, you set up the
  647.     # x coordinate for where you want the commands to line up and the y coordinate
  648.     # for where the FIRST COMMAND will appear.  The others, will appear directly
  649.     # below the first spaced equally apart.  Finally, you set up the z placement
  650.     # to set the viewport for how close you want the images to appear.  This is
  651.     # important, as if you want the commands to appear above everything else in the
  652.     # scene, you need to provide a value that verifies that, else you may end up
  653.     # with commands that are overlapped by planes, extras, etc.
  654.    
  655.     # the x where the commands line up
  656.     TITLE_COMMAND_X = 220
  657.    
  658.     # the y of the first command
  659.     TITLE_COMMAND_Y = 160
  660.    
  661.     # the z of the viewport which holds the commands
  662.     TITLE_COMMAND_Z = 100
  663.    
  664.     #===========================================================================
  665.     #
  666.     # 5e.  Title : Planes
  667.     #
  668.     # The title planes are like those of the Intro planes, however, in the
  669.     # title scene, there can be multiple planes running in different directions
  670.     # at different speeds on the scene at the same time.  For the planes, you need
  671.     # to set up each with an 'id' for the hash key and then set up the properties:
  672.     #
  673.     #    plane_id => {:graphic => filename,
  674.     #                 :direction => directional_value, (see Intro planes direction)
  675.     #                 :speed => pixels_to_move_per_frame,
  676.     #                 :opacity => transparency (0-255) 0 is invisible
  677.     #                 :z => z_placement, (how close the image should appear)
  678.     #
  679.     #===========================================================================
  680.    
  681.     TITLE_PLANES = {
  682.    
  683.     0 => {:graphic => "TitlePlane",
  684.           :direction => 3,
  685.           :speed => 2,
  686.           :opacity => 200,
  687.           :z => 0},
  688.          
  689.     1 => {:graphic => "TitlePlane",
  690.           :direction => 4,
  691.           :speed => 2,
  692.           :opacity => 200,
  693.           :z => 0},
  694.          
  695.     }
  696.    
  697.     #===========================================================================
  698.     #
  699.     # 5f.   Title : Background
  700.     #
  701.     # There is only one background which can be displayed on the title.  It always
  702.     # appears z 0 (zero) and always places itself at the upper left hand corner.
  703.     # Background images can have a 'wave' effect applied to them.  This
  704.     # makes it look as if the image is moving.  To make the title have this
  705.     # effect, set the 'TITLE_WAVE' value to 'true' and set up the next three
  706.     # variables to control the appearance of the effect.  
  707.     #
  708.     #===========================================================================
  709.    
  710.     # The graphic used for the background
  711.     TITLE_BACKGROUND = "TitleBack"
  712.    
  713.     # Use a wave effect?
  714.     TITLE_WAVE = true
  715.    
  716.     # - title wave -
  717.     #
  718.     # If TITLE_WAVE is true, then these are the properties.  You may need to
  719.     # adjust and maneuver these around a bit upon playtesting to get the effect
  720.     # you looking for.   The AMP and LENGTH are measured in pixels.  The amp
  721.     # effect causes the image to be skewed on its horizontal x position, and
  722.     # these control how many pixels they move.  SPEED controls how fast the
  723.     # movement occurs.
  724.    
  725.     TITLE_BACKGROUND_WAVE_AMP = 35
  726.     TITLE_BACKGROUND_WAVE_LENGTH = 15
  727.     TITLE_BACKGROUND_WAVE_SPEED = 14
  728.    
  729.     #===========================================================================
  730.     # 5g.   Title : Extras
  731.     #
  732.     # Extras are any other image that you want to display in the scene.  You can
  733.     # have unlimited amounts of extra images. Each has its own properties.  Unlike
  734.     # other images, the 'extras' are moveable.  So in the second part of the section
  735.     # you will set up the boundaries, speeds, etc. which controls their movement.
  736.     # Extras have many values to set, the graphic, the opacity (transparency),
  737.     # wave effect (See - title wave - above for details), and x and y placement,
  738.     # a zoom_x and zoom_y which controls the height and width of the image and
  739.     # the viewport_z which is used to set up the closeness of where the extras
  740.     # viewport is placed.  This is used to clarify which extras overlap which other
  741.     # extras.   Give each extra an 'id' in the hash as the hash key and set up
  742.     # the required properties.  The id of the extra image is used to reference it
  743.     # at runtime.
  744.     #
  745.     # -zoom values-
  746.     #
  747.     # For :zoom_x and :zoom_y, you need to supply the value as a floating point
  748.     # value (or decimal point value) which states how large you want the image
  749.     # to be.  When zooming, 1.0 represents actual size of the image, while
  750.     # larger values, like 3.0 or 4.5 grow the sprite, while lesser ones, like
  751.     # 0.4 shrink it.
  752.     #
  753.     # The zoom values can be controlled through a moving extra, which will explained
  754.     # in section 5g(1).
  755.     #
  756.     # -extra viewports-
  757.     #
  758.     # Extra images each have their own viewport upon creation.  That allows you to
  759.     # set the z value of each through their viewport and causes certain extras
  760.     # to overlap others.  The higher the viewport_z value you give, the more
  761.     # others it will overlap.
  762.     #
  763.     #===========================================================================
  764.    
  765.     TITLE_EXTRA_IMAGES = {
  766.    
  767.     0 => {:image => "Fojjy",
  768.           :opacity => 255,
  769.           :wave => [],
  770.           :x => 40,
  771.           :y => 190,
  772.           :zoom_x => 1.0,
  773.           :zoom_y => 1.0,
  774.           :viewport_z => 100},
  775.          
  776.     1 => {:image => "Ghost",
  777.           :opacity => 255,
  778.           :wave => [2, 3, 13],
  779.           :x => 140,
  780.           :y => 140,
  781.           :zoom_x => 1.0,
  782.           :zoom_y => 1.0,
  783.           :viewport_z => 50},
  784.          
  785.     2 => {:image => "Ghost",
  786.           :opacity => 255,
  787.           :wave => [2, 3, 13],
  788.           :x => 400,
  789.           :y => 140,
  790.           :zoom_x => 1.5,
  791.           :zoom_y => 1.5,
  792.           :viewport_z => 75},
  793.          
  794.     3 => {:image => "Sullendolf",
  795.           :opacity => 255,
  796.           :wave => [],
  797.           :x => 30,
  798.           :y => 90,
  799.           :zoom_x => 0.6,
  800.           :zoom_y => 0.6,
  801.           :viewport_z => 15},
  802.          
  803.     4 => {:image => "FriedaGhost",
  804.           :opacity => 128,
  805.           :wave => [2, 3, 8],
  806.           :x => 100,
  807.           :y => 140,
  808.           :zoom_x => 0.8,
  809.           :zoom_y => 0.8,
  810.           :viewport_z => 30},
  811.          
  812.   }
  813.  
  814.   #=============================================================================
  815.   # 5g(1)
  816.   #
  817.   # -Moving Extras-
  818.   #
  819.   # Extra images can be told to move.  Right now, the script only allows random
  820.   # movement, with the values you provide used to set the boundaries of each
  821.   # direction which the image can move.  
  822.   #
  823.   #=============================================================================
  824.  
  825.   # This array can be left empty if don't want any extra images to move.  This
  826.   # will render them all stationary.  You reference which images you want to move,
  827.   # by placing their ids (from the TITLE_EXTRA_IMAGES hash above) into the
  828.   # array.  For instance, [1, 3, 5, 6] would make it so that the images you
  829.   # created with ids of 1, 3, 5, 6 were set to move.
  830.   MOVING_EXTRAS = [1, 2]
  831.  
  832.   # These two variables set the boundaries in which a randomly moving
  833.   # extra image will move (This is still pretty glitchy right now, as moving
  834.   # images tend to disappear completely sometimes).  For both of these
  835.   # values, you need to set a low and high coordinate for how far the
  836.   # image can move before it's considered out of bounds.  This is supposed to
  837.   # create movements which are illegal and tell the image to travel in another
  838.   # direction.
  839.   MOVING_EXTRAS_X_BOUNDARIES = [10, 502] # [low_x_coordinate, high_x_coordinate]
  840.   MOVING_EXTRAS_Y_BOUNDARIES = [10, 374] # [low_y_coordinate, high_y_coordinate]
  841.  
  842.   # These are the same as the X/Y boundaries, except they control the zoom effect
  843.   # of the extra in question.  so, if the extra reaches the low or high values
  844.   # in their current zoom_x or zoom_y, they will be unable to continue shrinking or
  845.   # growing respectively.
  846.   MOVING_EXTRAS_ZOOM_BOUNDARIES = [0.1, 5.0]
  847.  
  848.   # This determines how fast the image moves from left to right, up and down
  849.   MOVING_EXTRAS_PARALLEL_MOVE_RATE = 6
  850.  
  851.   # This controls how fast the image zooms in and out
  852.   MOVING_EXTRAS_DISTANCE_MOVE_RATE = 0.1
  853.  
  854.   #=============================================================================
  855.   #
  856.   # 5h.  Title : Cursor
  857.   #
  858.   # This variable simply gives the filename of the cursor.  This is a mandatory
  859.   # graphic.  It's the graphic which is used to move from command to command
  860.   # in the Title scene.
  861.   #=============================================================================
  862.   TITLE_CURSOR_GRAPHIC = "BellCursor"
  863.  
  864.   #=============================================================================
  865.   #
  866.   # SECTION 6:
  867.   #
  868.   # Calling Custom Scenes
  869.   #
  870.   # If you have set up the commands in section 5c to reference scenes that are
  871.   # not new_game, continue and shutdown, you must jump to the SECTION X section
  872.   # which is located near line 1770, and is part of the method called
  873.   # 'determine_scene_change'
  874.   #=============================================================================
  875.  
  876.  
  877.   ##############################################################################
  878.   #*****************************************************************************
  879.   #               DON'T EDIT BELOW THIS LINE, UNLESS REQUIRED TO!
  880.   #*****************************************************************************
  881.   ##############################################################################
  882.    
  883.   end
  884.  
  885. end
  886.  
  887. ################################################################################
  888. #                              Cache
  889. ################################################################################
  890. module Cache
  891.  
  892.   def self.production(filename)
  893.     load_bitmap("Graphics/Production/", filename)
  894.   end
  895.  
  896. end
  897.  
  898.  
  899. ################################################################################
  900. #                        TITLE PRODUCTION
  901. ################################################################################
  902. class Title_Production
  903.  
  904.   attr_reader :frame_count
  905.   attr_reader :flag_count
  906.   attr_reader :wait_count
  907.   attr_reader :production
  908.   attr_reader :production_end
  909.   attr_accessor :intro_complete
  910.  
  911.   def initialize
  912.     @frame_count = 0
  913.     @flag_count = 0
  914.     @wait_count = 0
  915.     @intro_complete = false
  916.     @plane_base = Ixfuru::TitleProduction::INTRO_PLANES
  917.     @production = Ixfuru::TitleProduction::PRODUCTION
  918.     @production_end = false
  919.     create_viewports
  920.     start_step
  921.   end
  922.  
  923.   #-----------------------------------------------------------------------------
  924.   # Create Viewports
  925.   #-----------------------------------------------------------------------------
  926.   def create_viewports
  927.     @plane_viewport = Viewport.new(0, 0, 544, 416)
  928.     @plane_viewport.z = Ixfuru::TitleProduction::INTRO_PLANE_VIEWPORT_Z
  929.     @background_viewport = Viewport.new(0, 0, 544, 416)
  930.     @background_viewport.z = 0
  931.     @logo_text_viewport = Viewport.new(0, 0, 544, 416)
  932.     @logo_text_viewport.z = Ixfuru::TitleProduction::INTRO_LOGO_TEXT_Z
  933.   end
  934.  
  935.   #-----------------------------------------------------------------------------
  936.   # Start Step
  937.   #-----------------------------------------------------------------------------
  938.   def start_step
  939.     case @production[@flag_count][:step][0]
  940.     when nil
  941.       @wait_count = @production[@flag_count][:for_frames]
  942.       return
  943.     when "ilogos"
  944.       create_logo
  945.     when "itexts"
  946.       create_texts
  947.     when "iback"
  948.       create_background
  949.     when "iplane"
  950.       create_plane
  951.     when "ibgs"
  952.       start_bgs
  953.     when "ibgm"
  954.       start_bgm
  955.     end
  956.     @wait_count = @production[@flag_count][:for_frames]
  957.   end
  958.  
  959.   #-----------------------------------------------------------------------------
  960.   # Create Logo
  961.   #-----------------------------------------------------------------------------
  962.   def create_logo
  963.     if @logo != nil && !@logo.disposed?
  964.       dispose_logo
  965.     end
  966.     @logo = Sprite.new(@logo_text_viewport)
  967.     properties = @production[@flag_count][:step][1]
  968.     if properties == nil
  969.       @logo.dispose
  970.       new_flag
  971.       return
  972.     end
  973.     pl = Ixfuru::TitleProduction::INTRO_LOGOS[properties[0]]
  974.     @logo.bitmap = Cache.production(pl)
  975.     @logo.x = properties[1]
  976.     @logo.y = properties[2]
  977.     unless properties[3] == nil
  978.       play_production_se(properties[3])
  979.     end
  980.   end
  981.  
  982.  
  983.   #-----------------------------------------------------------------------------
  984.   # Create Plane
  985.   #-----------------------------------------------------------------------------
  986.   def create_plane
  987.     if @plane != nil && !@plane.disposed?
  988.       dispose_plane
  989.     end
  990.     @plane = Plane.new(@plane_viewport)
  991.     @plane_id = @production[@flag_count][:step][1][0]
  992.     properties = @plane_base[@plane_id]
  993.     if properties == nil
  994.       @plane.dispose
  995.       new_flag
  996.       return
  997.     end
  998.     @plane.bitmap = Cache.production(properties[:graphic])
  999.     @plane.z = properties[:z]
  1000.     @plane.opacity = properties[:opacity]
  1001.   end
  1002.  
  1003.   #-----------------------------------------------------------------------------
  1004.   # Create Background
  1005.   #-----------------------------------------------------------------------------
  1006.   def create_background
  1007.     if @background != nil && !@background.disposed?
  1008.       dispose_background
  1009.     end
  1010.     @background = Sprite.new(@background_viewport)
  1011.     properties = @production[@flag_count][:step][1]
  1012.     if properties == nil
  1013.       @background.dispose
  1014.       new_flag
  1015.       return
  1016.     end
  1017.     bg = Ixfuru::TitleProduction::INTRO_BACKGROUNDS[properties[0]]
  1018.     @background.bitmap = Cache.production(bg)
  1019.     @background.x = 0
  1020.     @background.y = 0
  1021.     if properties[1] != nil
  1022.       play_production_se(properties[1])
  1023.     end
  1024.   end
  1025.  
  1026.   #-----------------------------------------------------------------------------
  1027.   # Create Texts
  1028.   #-----------------------------------------------------------------------------
  1029.   def create_texts
  1030.     if @texts != nil && !@texts.disposed?
  1031.       dispose_texts
  1032.     end
  1033.     @texts = Sprite.new(@logo_text_viewport)
  1034.     properties = @production[@flag_count][:step][1]
  1035.     @old_texts_properties = properties
  1036.     if properties == nil
  1037.       @texts.dispose
  1038.       new_flag
  1039.       return
  1040.     end
  1041.     it = Ixfuru::TitleProduction::INTRO_TEXTS[properties[0]]
  1042.     @texts.bitmap = Cache.production(it)
  1043.     @texts.x = properties[1]
  1044.     @texts.y = properties[2]
  1045.     unless properties[3] == nil
  1046.       play_production_se(properties[3])
  1047.     end
  1048.     if properties[5] # Fadein?
  1049.       @texts.opacity = 0
  1050.       until @texts.opacity >= 255
  1051.         @texts.opacity += 255 / properties[7] #FadeFrames
  1052.         i = 0
  1053.         until i >= properties[8] * 60 #FadeSpeed
  1054.           i += 1
  1055.         end
  1056.       end
  1057.     else
  1058.       @texts.opacity = 255
  1059.     end
  1060.   end
  1061.  
  1062.   #-----------------------------------------------------------------------------
  1063.   # Start BGM
  1064.   #-----------------------------------------------------------------------------
  1065.   def start_bgm
  1066.     RPG::BGM.stop
  1067.     music_id = @production[@flag_count][:step][1][0]
  1068.     song = Ixfuru::TitleProduction::SOUNDS[:bgm][music_id]
  1069.     RPG::BGM.new(song[0], song[1], song[2]).play
  1070.   end
  1071.  
  1072.   #-----------------------------------------------------------------------------
  1073.   # Start BGS
  1074.   #-----------------------------------------------------------------------------
  1075.   def start_bgs
  1076.     RPG::BGS.stop
  1077.     sound_id = @production[@flag_count][:step][1][0]
  1078.     sound = Ixfuru::TitleProduction::SOUNDS[:bgs][sound_id]
  1079.     RPG::BGS.new(sound[0], sound[1], sound[2]).play
  1080.   end
  1081.  
  1082.   #------------------------------------------------------------------------------
  1083.   # New Flag
  1084.   #-----------------------------------------------------------------------------
  1085.   def new_flag
  1086.     @frame_count = 0
  1087.     @flag_count += 1
  1088.     if @flag_count >= @production.size
  1089.       @production_end = true
  1090.       return
  1091.     end
  1092.     start_step
  1093.   end
  1094.  
  1095.   #-----------------------------------------------------------------------------
  1096.   # Frame Update
  1097.   #-----------------------------------------------------------------------------
  1098.   def update
  1099.     if @production_end
  1100.       end_scene
  1101.       transition_to_title
  1102.     else
  1103.       update_production
  1104.     end
  1105.     update_plane
  1106.     update_background
  1107.     update_logo
  1108.     update_texts
  1109.   end
  1110.  
  1111.   #-----------------------------------------------------------------------------
  1112.   # Update Production
  1113.   #-----------------------------------------------------------------------------
  1114.   def update_production
  1115.     @frame_count += 1
  1116.     if @frame_count >= @wait_count
  1117.       end_step
  1118.       new_flag
  1119.     end
  1120.   end
  1121.  
  1122.   #-----------------------------------------------------------------------------
  1123.   # Update Plane
  1124.   #-----------------------------------------------------------------------------
  1125.   def update_plane
  1126.     return if @plane == nil || @plane.disposed?
  1127.     properties = @plane_base[@plane_id]
  1128.     spd = properties[:speed]
  1129.     dir = properties[:direction]
  1130.     scroll_plane(dir, spd)
  1131.   end
  1132.  
  1133.   #-----------------------------------------------------------------------------
  1134.   # Update Background
  1135.   #-----------------------------------------------------------------------------
  1136.   def update_background
  1137.     return if @background == nil || @background.disposed?
  1138.     @background.update
  1139.   end
  1140.  
  1141.   #-----------------------------------------------------------------------------
  1142.   # Update Logo
  1143.   #-----------------------------------------------------------------------------
  1144.   def update_logo
  1145.     return if @logo == nil || @logo.disposed?
  1146.     @logo.update
  1147.   end
  1148.  
  1149.   #-----------------------------------------------------------------------------
  1150.   # Update Texts
  1151.   #-----------------------------------------------------------------------------
  1152.   def update_texts
  1153.     return if @texts == nil || @texts.disposed?
  1154.     @texts.update
  1155.   end
  1156.  
  1157.   #-----------------------------------------------------------------------------
  1158.   # End Step
  1159.   #-----------------------------------------------------------------------------
  1160.   def end_step
  1161.     case @production[@flag_count][:step][0]
  1162.     when "ilogos"
  1163.       se_id = @production[@flag_count][:step][1][4]
  1164.       unless se_id == nil
  1165.         play_production_se(se_id)
  1166.       end
  1167.       dispose_logo
  1168.     when "itexts"
  1169.       se_id = @production[@flag_count][:step][1][4]
  1170.       unless se_id == nil
  1171.         play_production_se(se_id)
  1172.       end
  1173.       dispose_texts
  1174.     end
  1175.   end
  1176.  
  1177.   #-----------------------------------------------------------------------------
  1178.   # End Scene
  1179.   #-----------------------------------------------------------------------------
  1180.   def end_scene
  1181.     dispose_background
  1182.     dispose_plane
  1183.     dispose_texts
  1184.     dispose_logo
  1185.   end
  1186.  
  1187.   #------------------------------------------------------------------------------
  1188.   # Transition to Title
  1189.   #-----------------------------------------------------------------------------
  1190.   def transition_to_title
  1191.     unless Ixfuru::TitleProduction::INTRO_TRANSITION == "" ||
  1192.       Ixfuru::TitleProduction::INTRO_TRANSITION == nil
  1193.       transition = Ixfuru::TitleProduction::INTRO_TRANSITION
  1194.       Graphics.freeze
  1195.       Graphics.transition(80, "Graphics/Production/" + transition, 80)
  1196.     end
  1197.     RPG::BGM.stop
  1198.     RPG::BGS.stop
  1199.     end_scene
  1200.     @intro_complete = true
  1201.   end
  1202.  
  1203.   #-----------------------------------------------------------------------------
  1204.   # Dispose Plane
  1205.   #-----------------------------------------------------------------------------
  1206.   def dispose_plane
  1207.     return if @plane == nil || @plane.disposed?
  1208.     @plane.dispose
  1209.   end
  1210.  
  1211.   #-----------------------------------------------------------------------------
  1212.   # Dispose Background
  1213.   #-----------------------------------------------------------------------------
  1214.   def dispose_background
  1215.     return if @background == nil || @background.disposed?
  1216.     @background.dispose
  1217.   end
  1218.  
  1219.   #-----------------------------------------------------------------------------
  1220.   # Dispose Logo
  1221.   #-----------------------------------------------------------------------------
  1222.   def dispose_logo
  1223.     return if @logo == nil || @logo.disposed?
  1224.     @logo.dispose
  1225.   end
  1226.  
  1227.   #-----------------------------------------------------------------------------
  1228.   # Dispose Texts
  1229.   #-----------------------------------------------------------------------------
  1230.   def dispose_texts
  1231.     return if @texts == nil || @texts.disposed?
  1232.     if @old_texts_properties[6]
  1233.       until @texts.opacity <= 0
  1234.         @texts.opacity -= @old_texts_properties[7]
  1235.         i = 0
  1236.         until i >= @old_texts_properties[8] * 60 #FadeSpeed
  1237.           i += 1
  1238.         end
  1239.       end
  1240.       @texts.dispose
  1241.     else
  1242.       @texts.dispose
  1243.     end
  1244.   end
  1245.  
  1246.   #-----------------------------------------------------------------------------
  1247.   # Scroll Plane
  1248.   #-----------------------------------------------------------------------------
  1249.   def scroll_plane(direction, speed)
  1250.     case direction
  1251.     when 0 # UpperLeft to LowerRight
  1252.       @plane.ox += speed
  1253.       @plane.oy += speed
  1254.     when 1 # Top to Bottom
  1255.       @plane.oy += speed
  1256.     when 2 # UpperRight to LowerLeft
  1257.       @plane.ox -= speed
  1258.       @plane.oy += speed
  1259.     when 3 # Left to Right
  1260.       @plane.ox += speed
  1261.     when 4 # Right to Left
  1262.       @plane.ox -= speed
  1263.     when 5 # LowerLeft to UpperRight
  1264.       @plane.ox += speed
  1265.       @plane.oy -= speed
  1266.     when 6 # Bottom to Top
  1267.       @plane.oy -= speed
  1268.     when 7 # LowerRight to UpperLeft
  1269.       @plane.ox -= speed
  1270.       @plane.oy -= speed
  1271.     end
  1272.   end
  1273.  
  1274.   #-----------------------------------------------------------------------------
  1275.   # Play Pfoduction SE
  1276.   #-----------------------------------------------------------------------------
  1277.   def play_production_se(sound_id)
  1278.     return if sound_id == nil
  1279.     se = Ixfuru::TitleProduction::SOUNDS[:se][sound_id]
  1280.     RPG::SE.new(se[0], se[1], se[2]).play
  1281.   end
  1282.  
  1283. end
  1284.  
  1285. ################################################################################
  1286. #                             SCENE TITLE
  1287. ################################################################################
  1288. class Scene_Title < Scene_Base
  1289.  
  1290.   def initialize(from_file = false)
  1291.     @production = Title_Production.new
  1292.     if from_file
  1293.       @production.intro_complete = true
  1294.     end
  1295.     @title_ready = false
  1296.     @title_index = 0
  1297.     @moving_extras = []
  1298.   end
  1299.  
  1300.   #--------------------------------------------------------------------------
  1301.   # * Start processing
  1302.   #--------------------------------------------------------------------------
  1303.   def start
  1304.     super
  1305.     load_database                     # Load database
  1306.     create_game_objects               # Create game objects
  1307.     check_continue                    # Determine if continue is enabled
  1308.   end
  1309.  
  1310.   #--------------------------------------------------------------------------
  1311.   # * Post-Start Processing
  1312.   #--------------------------------------------------------------------------
  1313.   def post_start
  1314.   end
  1315.   #--------------------------------------------------------------------------
  1316.   # * Pre-termination Processing
  1317.   #--------------------------------------------------------------------------
  1318.   def pre_terminate
  1319.   end
  1320.  
  1321.   #--------------------------------------------------------------------------
  1322.   # * Termination Processing
  1323.   #--------------------------------------------------------------------------
  1324.   def terminate
  1325.     super
  1326.     dispose_commands
  1327.     dispose_planes
  1328.     dispose_background
  1329.     dispose_logo
  1330.     dispose_subtitle
  1331.     dispose_extras
  1332.     dispose_cursor
  1333.     snapshot_for_background
  1334.   end
  1335.  
  1336.   #--------------------------------------------------------------------------
  1337.   # * Frame Update
  1338.   #--------------------------------------------------------------------------
  1339.   def update
  1340.     super
  1341.     if Ixfuru::TitleProduction::SKIP_INTRO && !@production.intro_complete
  1342.       @production.intro_complete = true
  1343.     elsif !@production.intro_complete
  1344.       @production.update
  1345.     else
  1346.       if @title_ready
  1347.         update_background
  1348.         update_planes
  1349.         update_logo
  1350.         update_subtitle
  1351.         update_extras
  1352.         update_commands
  1353.       else
  1354.         start_title
  1355.       end
  1356.     end
  1357.   end
  1358.  
  1359.   #-----------------------------------------------------------------------------
  1360.   # Start Title
  1361.   #-----------------------------------------------------------------------------
  1362.   def start_title
  1363.     create_background
  1364.     create_planes
  1365.     create_logo
  1366.     create_subtitle
  1367.     create_extras
  1368.     create_commands
  1369.     create_cursor
  1370.     start_bgs
  1371.     start_bgm
  1372.     @title_ready = true
  1373.   end
  1374.  
  1375.   #-----------------------------------------------------------------------------
  1376.   # Create_background
  1377.   #-----------------------------------------------------------------------------
  1378.   def create_background
  1379.     @background_viewport = Viewport.new(0, 0, 544, 416)
  1380.     @background = Sprite.new(@background_viewport)
  1381.     @background.bitmap = Cache.production(Ixfuru::TitleProduction::TITLE_BACKGROUND)
  1382.     if Ixfuru::TitleProduction::TITLE_WAVE
  1383.       @background.wave_amp = Ixfuru::TitleProduction::TITLE_BACKGROUND_WAVE_AMP
  1384.       @background.wave_length = Ixfuru::TitleProduction::TITLE_BACKGROUND_WAVE_LENGTH
  1385.       @background.wave_speed = Ixfuru::TitleProduction::TITLE_BACKGROUND_WAVE_SPEED
  1386.     end
  1387.   end
  1388.  
  1389.   #-----------------------------------------------------------------------------
  1390.   # Create Planes
  1391.   #-----------------------------------------------------------------------------
  1392.   def create_planes
  1393.     @planes = {}
  1394.     tp = Ixfuru::TitleProduction::TITLE_PLANES
  1395.     return if tp.empty?
  1396.     tp.each { |plane_id, properties|
  1397.     vp = Viewport.new(0, 0, 544, 416)
  1398.     vp.z = properties[:z]
  1399.     plane = Plane.new(vp)
  1400.     plane.bitmap = Cache.production(properties[:graphic])
  1401.     plane.opacity = properties[:opacity]
  1402.     @planes[plane_id] = plane
  1403.     }
  1404.   end
  1405.  
  1406.   #-----------------------------------------------------------------------------
  1407.   # Create Logo
  1408.   #-----------------------------------------------------------------------------
  1409.   def create_logo
  1410.     @logo_viewport = Viewport.new(0, 0, 544, 416)
  1411.     @logo = Sprite.new(@logo_viewport)
  1412.     @logo.bitmap = Cache.production(Ixfuru::TitleProduction::TITLE_LOGO)
  1413.     @logo.x = Ixfuru::TitleProduction::TITLE_LOGO_X
  1414.     @logo.y = Ixfuru::TitleProduction::TITLE_LOGO_Y
  1415.   end
  1416.  
  1417.   #-----------------------------------------------------------------------------
  1418.   # Create Subtitle
  1419.   #-----------------------------------------------------------------------------
  1420.   def create_subtitle
  1421.     return unless Ixfuru::TitleProduction::TITLE_SUBTITLE != ""
  1422.     @subtitle_viewport = Viewport.new(0, 0, 544, 416)
  1423.     @subtitle = Sprite.new(@subtitle_viewport)
  1424.     @subtitle.bitmap = Cache.production(Ixfuru::TitleProduction::TITLE_SUBTITLE)
  1425.     @subtitle.x = Ixfuru::TitleProduction::TITLE_SUBTITLE_X
  1426.     @subtitle.y = Ixfuru::TitleProduction::TITLE_SUBTITLE_Y
  1427.   end
  1428.  
  1429.   #-----------------------------------------------------------------------------
  1430.   # Create Extras
  1431.   #-----------------------------------------------------------------------------
  1432.   def create_extras
  1433.     @extras = []
  1434.     tei = Ixfuru::TitleProduction::TITLE_EXTRA_IMAGES
  1435.     return if Ixfuru::TitleProduction::TITLE_EXTRA_IMAGES.empty?
  1436.     tei.each { |tei_id, properties|
  1437.     vp = Viewport.new(0, 0, 544, 416)
  1438.     vp.z = properties[:viewport_z]
  1439.     extra = Sprite.new(vp)
  1440.     extra.bitmap = Cache.production(properties[:image])
  1441.     extra.x = properties[:x]
  1442.     extra.y = properties[:y]
  1443.     extra.opacity = properties[:opacity]
  1444.     unless properties[:wave].empty?
  1445.       extra.wave_amp = properties[:wave][0]
  1446.       extra.wave_length = properties[:wave][1]
  1447.       extra.wave_speed = properties[:wave][2]
  1448.     end
  1449.     extra.zoom_x = properties[:zoom_x]
  1450.     extra.zoom_y = properties[:zoom_y]
  1451.     @extras.push(extra)
  1452.     if Ixfuru::TitleProduction::MOVING_EXTRAS.include?(tei_id)
  1453.       @moving_extras.push(extra)
  1454.     end
  1455.     }
  1456.   end
  1457.  
  1458.   #-----------------------------------------------------------------------------
  1459.   # Create Commands
  1460.   #-----------------------------------------------------------------------------
  1461.   def create_commands
  1462.     @commands = {}
  1463.     @cursor_ys = {}
  1464.     comms = Ixfuru::TitleProduction::TITLE_COMMANDS
  1465.     @command_x = Ixfuru::TitleProduction::TITLE_COMMAND_X
  1466.     cy = Ixfuru::TitleProduction::TITLE_COMMAND_Y
  1467.     @commands_viewport = Viewport.new(0, 0, 544, 416)
  1468.     @commands_viewport.z = Ixfuru::TitleProduction::TITLE_COMMAND_Z
  1469.     comms.each { |command_id, properties|
  1470.     comm = Sprite.new(@commands_viewport)
  1471.     comm.bitmap = Cache.production(properties[:graphic])
  1472.     @cursor_ys[command_id] = cy
  1473.     comm.x = @command_x
  1474.     comm.y = cy
  1475.     cy += comm.height
  1476.     @commands[command_id] = comm
  1477.     }
  1478.   end
  1479.  
  1480.   #-----------------------------------------------------------------------------
  1481.   # Create Cursor
  1482.   #-----------------------------------------------------------------------------
  1483.   def create_cursor
  1484.     @cursor = Sprite.new(@commands_viewport)
  1485.     @cursor.bitmap = Cache.production(Ixfuru::TitleProduction::TITLE_CURSOR_GRAPHIC)
  1486.     @cursor.x = @command_x - (@cursor.width + 4)
  1487.     @cursor.y = @cursor_ys[0]
  1488.   end
  1489.  
  1490.   #-----------------------------------------------------------------------------
  1491.   # Start Background Sound
  1492.   #-----------------------------------------------------------------------------
  1493.   def start_bgs
  1494.     bgs_id = Ixfuru::TitleProduction::TITLE_SOUND_IDS[:bgs]
  1495.     bgs = Ixfuru::TitleProduction::SOUNDS[:bgs][bgs_id]
  1496.     RPG::BGS.new(bgs[0], bgs[1], bgs[2]).play
  1497.   end
  1498.  
  1499.   #-----------------------------------------------------------------------------
  1500.   # Start Background Music
  1501.   #-----------------------------------------------------------------------------
  1502.   def start_bgm
  1503.     bgm_id = Ixfuru::TitleProduction::TITLE_SOUND_IDS[:bgm]
  1504.     bgm = Ixfuru::TitleProduction::SOUNDS[:bgm][bgm_id]
  1505.     RPG::BGM.new(bgm[0], bgm[1], bgm[2]).play
  1506.   end
  1507.  
  1508.   #-----------------------------------------------------------------------------
  1509.   # Update Commands
  1510.   #-----------------------------------------------------------------------------
  1511.   def update_commands
  1512.     @commands.each_value { |c|
  1513.     c.update
  1514.     }
  1515.     @cursor.update
  1516.     if Input.trigger?(Input::C)
  1517.       comm = Ixfuru::TitleProduction::TITLE_COMMANDS[@title_index]
  1518.       if comm[:scene] == "scene_file" && !@continue_enabled
  1519.         Sound.play_buzzer
  1520.       else
  1521.         Sound.play_decision
  1522.         determine_scene_change
  1523.       end
  1524.     elsif Input.trigger?(Input::UP)
  1525.       Sound.play_cursor
  1526.       if @title_index == 0
  1527.         @title_index = @commands.size - 1
  1528.         update_cursor_position
  1529.       else
  1530.         @title_index -= 1
  1531.         update_cursor_position
  1532.       end
  1533.     elsif Input.trigger?(Input::DOWN)
  1534.       Sound.play_cursor
  1535.       if @title_index == @commands.size - 1
  1536.         @title_index = 0
  1537.         update_cursor_position
  1538.       else
  1539.         @title_index += 1
  1540.         update_cursor_position
  1541.       end
  1542.     end
  1543.   end
  1544.  
  1545.   #-----------------------------------------------------------------------------
  1546.   # Update Cursor Position
  1547.   #-----------------------------------------------------------------------------
  1548.   def update_cursor_position
  1549.     @cursor.y = @cursor_ys[@title_index]
  1550.   end
  1551.  
  1552.   #-----------------------------------------------------------------------------
  1553.   # Update Background
  1554.   #-----------------------------------------------------------------------------
  1555.   def update_background
  1556.     @background.update
  1557.   end
  1558.  
  1559.   #-----------------------------------------------------------------------------
  1560.   # Update Planes
  1561.   #-----------------------------------------------------------------------------
  1562.   def update_planes
  1563.     tp = Ixfuru::TitleProduction::TITLE_PLANES
  1564.     return if tp.empty?
  1565.     @planes.each { |plane_id, plane|
  1566.     scroll_plane(plane_id, plane)
  1567.     }
  1568.   end
  1569.  
  1570.   #-----------------------------------------------------------------------------
  1571.   # Scroll Plane
  1572.   #-----------------------------------------------------------------------------
  1573.   def scroll_plane(plane_id, plane)
  1574.     tp = Ixfuru::TitleProduction::TITLE_PLANES
  1575.     properties = tp[plane_id]
  1576.     speed = properties[:speed]
  1577.     case properties[:direction]
  1578.     when 0 # UpperLeft to LowerRight
  1579.       plane.ox += speed
  1580.       plane.oy += speed
  1581.     when 1 # Top to Bottom
  1582.       plane.oy += speed
  1583.     when 2 # UpperRight to LowerLeft
  1584.       plane.ox -= speed
  1585.       plane.oy += speed
  1586.     when 3 # Left to Right
  1587.       plane.ox += speed
  1588.     when 4 # Right to Left
  1589.       plane.ox -= speed
  1590.     when 5 # LowerLeft to UpperRight
  1591.       plane.ox += speed
  1592.       plane.oy -= speed
  1593.     when 6 # Bottom to Top
  1594.       plane.oy -= speed
  1595.     when 7 # LowerRight to UpperLeft
  1596.       plane.ox -= speed
  1597.       plane.oy -= speed
  1598.     end
  1599.   end
  1600.  
  1601.   #-----------------------------------------------------------------------------
  1602.   # Update Logo
  1603.   #-----------------------------------------------------------------------------
  1604.   def update_logo
  1605.     @logo.update
  1606.   end
  1607.  
  1608.   #-----------------------------------------------------------------------------
  1609.   # Update Subtitle
  1610.   #-----------------------------------------------------------------------------
  1611.   def update_subtitle
  1612.     return if @subtitle == nil
  1613.     @subtitle.update
  1614.   end
  1615.  
  1616.   #-----------------------------------------------------------------------------
  1617.   # Update Extras
  1618.   #-----------------------------------------------------------------------------
  1619.   def update_extras
  1620.     return if @extras.empty?
  1621.     for extra in @extras
  1622.       extra.update
  1623.       if @moving_extras.include?(extra)
  1624.         update_moving_extra(extra)
  1625.       end
  1626.     end
  1627.   end
  1628.  
  1629.   #-----------------------------------------------------------------------------
  1630.   # Update Moving Extras
  1631.   #-----------------------------------------------------------------------------
  1632.   def update_moving_extra(sprite)
  1633.     sx = sprite.x
  1634.     sy = sprite.y
  1635.     sz = sprite.zoom_x
  1636.     move_type = 0
  1637.     case move_type
  1638.     when 0
  1639.       ppm = [0, 1, 2, 3] #possible parallel moves (left, right, up, down)
  1640.       pdm = [0, 1] # possible distance moves (zoom grow, zooms shrink)
  1641.       xbounds = Ixfuru::TitleProduction::MOVING_EXTRAS_X_BOUNDARIES
  1642.       ybounds = Ixfuru::TitleProduction::MOVING_EXTRAS_Y_BOUNDARIES
  1643.       zbounds = Ixfuru::TitleProduction::MOVING_EXTRAS_ZOOM_BOUNDARIES
  1644.       pmove = Ixfuru::TitleProduction::MOVING_EXTRAS_PARALLEL_MOVE_RATE
  1645.       dmove = Ixfuru::TitleProduction::MOVING_EXTRAS_DISTANCE_MOVE_RATE
  1646.       if sx - pmove <= xbounds[0]
  1647.         ppm.delete(0)
  1648.       elsif sx + pmove >= xbounds[1]
  1649.         ppm.delete(1)
  1650.       end
  1651.       if sy - pmove <= ybounds[0]
  1652.         ppm.delete(2)
  1653.       elsif sy + pmove >= ybounds[1]
  1654.         ppm.delete(3)
  1655.       end
  1656.       if sz - dmove <= zbounds[0]
  1657.         pdm.delete(1)
  1658.       elsif  sz + dmove >= zbounds[1]
  1659.         pdm.delete(1)
  1660.       end
  1661.       next_move = rand(3)
  1662.       if next_move < 2
  1663.         move = ppm[rand(ppm.size)]
  1664.         move_parallel(sprite, move, pmove)
  1665.       else
  1666.         move = pdm[rand(pdm.size)]
  1667.         move_distance(sprite, move, dmove)
  1668.       end
  1669.     end
  1670.   end
  1671.  
  1672.   #-----------------------------------------------------------------------------
  1673.   # Move Parallel
  1674.   #-----------------------------------------------------------------------------
  1675.   def move_parallel(sprite, direction, amount)
  1676.     case direction
  1677.     when 0
  1678.       sprite.x += amount
  1679.     when 1
  1680.       sprite.x -= amount
  1681.     when 2
  1682.       sprite.y += amount
  1683.     when 3
  1684.       sprite.y -= amount
  1685.     end
  1686.   end
  1687.  
  1688.   #-----------------------------------------------------------------------------
  1689.   # Move Distance
  1690.   #-----------------------------------------------------------------------------
  1691.   def move_distance(sprite, direction, amount)
  1692.     case direction
  1693.     when 0
  1694.       sprite.zoom_x += amount
  1695.       sprite.zoom_y += amount
  1696.     when 1
  1697.       sprite.zoom_x -= amount
  1698.       sprite.zoom_y -= amount
  1699.     end
  1700.   end
  1701.  
  1702.   #-----------------------------------------------------------------------------
  1703.   # Dispose Background
  1704.   #-----------------------------------------------------------------------------
  1705.   def dispose_background
  1706.     @background.dispose
  1707.   end
  1708.  
  1709.   #-----------------------------------------------------------------------------
  1710.   # Dispose Planes
  1711.   #-----------------------------------------------------------------------------
  1712.   def dispose_planes
  1713.     return if @planes.empty?
  1714.     @planes.each_value { |plane|
  1715.     plane.dispose
  1716.     }
  1717.   end
  1718.  
  1719.   #-----------------------------------------------------------------------------
  1720.   # Dispose Logo
  1721.   #-----------------------------------------------------------------------------
  1722.   def dispose_logo
  1723.     @logo.dispose
  1724.   end
  1725.  
  1726.   #-----------------------------------------------------------------------------
  1727.   # Dispose Subtitle
  1728.   #-----------------------------------------------------------------------------
  1729.   def dispose_subtitle
  1730.     return if @subtitle == nil
  1731.     @subtitle.dispose
  1732.   end
  1733.  
  1734.   #-----------------------------------------------------------------------------
  1735.   # Dispose Extras
  1736.   #-----------------------------------------------------------------------------
  1737.   def dispose_extras
  1738.     return if @extras.empty?
  1739.     for extra in @extras
  1740.       extra.dispose
  1741.     end
  1742.   end
  1743.  
  1744.   #-----------------------------------------------------------------------------
  1745.   # Dispose_Commands
  1746.   #-----------------------------------------------------------------------------
  1747.   def dispose_commands
  1748.     @commands.each_value { |command|
  1749.     command.dispose
  1750.     }
  1751.   end
  1752.  
  1753.   #-----------------------------------------------------------------------------
  1754.   # Dispose Cursor
  1755.   #-----------------------------------------------------------------------------
  1756.   def dispose_cursor
  1757.     @cursor.dispose
  1758.   end
  1759.  
  1760.   #--------------------------------------------------------------------------
  1761.   # * Determine if Continue is Enabled
  1762.   #--------------------------------------------------------------------------
  1763.   def check_continue
  1764.     @continue_enabled = (Dir.glob('Save*.rvdata').size > 0)
  1765.   end
  1766.  
  1767.   #--------------------------------------------------------------------------
  1768.   # * Check Player Start Location Existence
  1769.   #--------------------------------------------------------------------------
  1770.   def confirm_player_location
  1771.     if $data_system.start_map_id == 0
  1772.       print "Player start location not set."
  1773.       exit
  1774.     end
  1775.   end
  1776.  
  1777.   #-----------------------------------------------------------------------------
  1778.   # Determine Scene Change
  1779.   #-----------------------------------------------------------------------------
  1780.   def determine_scene_change
  1781.     comms = Ixfuru::TitleProduction::TITLE_COMMANDS
  1782.     new_scene = comms[@title_index][:scene]
  1783.     case new_scene
  1784.     when "scene_map"
  1785.       command_new_game
  1786.     when "scene_file"
  1787.       command_continue
  1788.     when nil
  1789.       command_shutdown
  1790.     ##**************************************************************************
  1791.     ## SECTION X:
  1792.     ##
  1793.     ## Custom SCene Changes
  1794.     ##
  1795.     ## For each custom scene you referenced in your command setup, you need to
  1796.     ## alter this scene to call the method which will take you there.  To do
  1797.     ## that, use this:
  1798.     ##
  1799.     ##               when string_reference
  1800.     ##                  method_name
  1801.     ##
  1802.     ## for 'string_reference', you need to give the exact double-quoted ("")
  1803.     ## string (word) you provided in section 5c for the :scene property.
  1804.     ## for 'method_name' you can give anything, but by rule, you should
  1805.     ## use 'command_' to prefix the method's name.  Like 'command_credits' or
  1806.     ## 'command_options', etc.
  1807.     ##
  1808.     ## Once you've finished this preliminary call, you need to skip down to the
  1809.     ## last section SECTION X2: Custom Methods in order to create the actual
  1810.     ## method which will take you to your new scene.
  1811.     ##**************************************************************************
  1812.     when "scene_credits"
  1813.       command_credits
  1814.     end
  1815.   end
  1816.  
  1817.   #--------------------------------------------------------------------------
  1818.   # * Command: New Game (OVERWRITTEN)
  1819.   #--------------------------------------------------------------------------
  1820.   def command_new_game
  1821.     confirm_player_location
  1822.     Sound.play_decision
  1823.     $game_party.setup_starting_members            # Initial party
  1824.     $game_map.setup($data_system.start_map_id)    # Initial map position
  1825.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  1826.     $game_player.refresh
  1827.     $scene = Scene_Map.new
  1828.     RPG::BGM.fade(1500)
  1829.     RPG::BGS.fade(1500)
  1830.     Graphics.fadeout(60)
  1831.     Graphics.wait(40)
  1832.     Graphics.frame_count = 0
  1833.     RPG::BGM.stop
  1834.     RPG::BGS.stop
  1835.     $game_map.autoplay
  1836.   end
  1837.  
  1838.   #--------------------------------------------------------------------------
  1839.   # * Command: Continue
  1840.   #--------------------------------------------------------------------------
  1841.   def command_continue
  1842.     if @continue_enabled
  1843.       RPG::BGS.stop
  1844.       RPG::BGM.stop
  1845.       Sound.play_decision
  1846.       $scene = Scene_File.new(false, true, false)
  1847.     else
  1848.       Sound.play_buzzer
  1849.     end
  1850.   end
  1851.  
  1852.   ##============================================================================
  1853.   ##
  1854.   ## SECTION X2:
  1855.   ##
  1856.   ## Custom Methods
  1857.   ##
  1858.   ## By default, I've prepared a little method for you to follow here if all you
  1859.   ## want to do is call a new scene.  Just make sure, when you create yours,
  1860.   ## you put the RPG::BGS.stop, RPG::BGM.stop and the $scene = parts in your
  1861.   ## new method, as that alone will take you where you want to go and assure
  1862.   ## you that you have no lingering sounds from the Title Scene.  Here's an
  1863.   ## example, besides the command_credits I've given you.
  1864.   ##
  1865.   ##   def command_options
  1866.   ##     RPG::BGS.stop
  1867.   ##     RPG::BGM.stop
  1868.   ##     $scene = Scene_Options.new
  1869.   ##   end
  1870.   ##
  1871.   ##^^^^^^^^^^^^^VERY IMPORTANT^^^^^^^^^^^^^^^^^^^^^
  1872.   ##
  1873.   ## Two things, first of all choosing the credits command in the default WILL
  1874.   ## throw an error, because no such scene exists.  And secondly, placing a new
  1875.   ## method DOES NOT AUTOMATICALLY MAKE THE SCENE appear.  You must have the
  1876.   ## scene you want to call created in one of your scripts!
  1877.   ##
  1878.   ##============================================================================
  1879.   #-----------------------------------------------------------------------------
  1880.   # Command: Credits
  1881.   #-----------------------------------------------------------------------------
  1882.   def command_credits
  1883.     RPG::BGS.fade(1500)
  1884.     RPG::BGM.fade(1500)
  1885.     Graphics.fadeout(60)
  1886.     Graphics.wait(40)
  1887.     RPG::BGS.stop
  1888.     RPG::BGM.stop
  1889.     $scene = Scene_Credits.new(title)
  1890.   end
  1891.  
  1892.   # place your new methods HERE!
  1893.  
  1894.   ##############################################################################
  1895.   #*****************************************************************************
  1896.   #             DON'T EDIT BELOW HERE
  1897.   #*****************************************************************************
  1898.   ##############################################################################
  1899.  
  1900. end
  1901.  
  1902. ################################################################################
  1903. #                       SCENE FILE
  1904. ################################################################################
  1905. class Scene_File < Scene_Base
  1906.  
  1907.   #--------------------------------------------------------------------------
  1908.   # * Return to Original Screen (Aliased)`
  1909.   #--------------------------------------------------------------------------
  1910.   def return_scene
  1911.     if @from_title
  1912.       $scene = Scene_Title.new(true)
  1913.     elsif @from_event
  1914.       $scene = Scene_Map.new
  1915.     else
  1916.       $scene = Scene_Menu.new(4)
  1917.     end
  1918.   end
  1919.  
  1920. end
Advertisement
Add Comment
Please, Sign In to add comment