Advertisement
diamondandplatinum3

Story-Entwined Splash Screen Map

Jun 7th, 2014
581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 8.56 KB | None | 0 0
  1. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. #             Story-Entwined Splash Screen Map
  3. #             Version: 1.0
  4. #             Author: DiamondandPlatinum3
  5. #             Date: June 7, 2014
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. #  Description:
  8. #
  9. #    This script allows you to start your game on various different Splash
  10. #     Maps upon GameStart.
  11. #
  12. #    This means that you can use these maps to show a splash screen or a
  13. #     backstory (or anything else) before the Title Screen is shown.
  14. #
  15. #    In addition, this script is based upon story progress. So these Splash
  16. #     Maps may be shown when the player has unlocked them
  17. #
  18. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  19. #------------------------------------------------------------------------------
  20. #  Instructions:
  21. #
  22. #  ~  Modify Editable Region to your liking.
  23. #
  24. #  ~  When Transferring to the Map, the map begins in a screen_fadeout state.
  25. #       This is to allow you to set up the map behind the scenes.
  26. #       When the map is ready to view, use the "Fadein Screen" Event.
  27. #
  28. #  ~  When finished eventing on a Splash Map. Make sure the
  29. #       "Return to Title Screen" event is used.
  30. #
  31. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  32. ($diamondandplatinum3_scripts ||= {})[:StoryEntwinedSplashScreenMap] = true
  33. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  34. module DiamondandPlatinum3
  35.   module StoryEntwinedSplashScreenMap
  36.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  37.     #                                                        -=
  38.     #                 Editable Region        ////            ==
  39.     #                                                        =-
  40.     #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  41.    
  42.     # The Variable which will contain the data for the Splash Screen Map.
  43.     # By default this variable 100, which means that as variable 100 changes
  44.     # numbers, so too could the splash screen map, if you allow it.
  45.     VariableID = 100
  46.    
  47.    
  48.     # Reset Splash Screen Map Back to Default Splash Screen Map if starting
  49.     # a new game?
  50.     ResetSplashScreenMapOnNewGame = true
  51.    
  52.    
  53.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  54.     Splash_Screen_Maps = {              # <= Do not touch this line
  55.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  56.    
  57.     # Variable Value => Splash_Map_ID ,
  58.    
  59.    
  60.       0 =>  1 ,  # This is your default Splash Screen Map ID
  61.       1 =>  1 ,
  62.       2 =>  3 ,
  63.       4 =>  4 ,
  64.       5 =>  5 ,
  65.  
  66.      
  67.      
  68.      
  69.       # Add as many as you want.
  70.    
  71.      
  72.     #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  73.     #                                           \/
  74.     #               End of Editable Region      /\
  75.     #                                           \/
  76.     #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  77.     }
  78.    
  79.    
  80.    
  81.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  82.     # * New Class Variables
  83.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  84.     @@can_display_splash_screen_map = true
  85.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  86.     # * New Class Method: Can Display Splash Screen Map?
  87.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  88.     def self.can_display?
  89.       return @@can_display_splash_screen_map
  90.     end
  91.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  92.     # * New Class Method: Set Display Value
  93.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  94.     def self.set_display_value(val)
  95.       @@can_display_splash_screen_map = val
  96.     end    
  97.   end
  98. end
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107. #==============================================================================
  108. # ** DataManager
  109. #------------------------------------------------------------------------------
  110. #  This module manages the database and game objects. Almost all of the
  111. # global variables used by the game are initialized by this module.
  112. #==============================================================================
  113.  
  114. module DataManager
  115.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  116.   # *= Alias Listings
  117.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  118.   class << self
  119.     alias_method(:dp3_storyentss_dataman_setupnewgame,       :setup_new_game)
  120.   end
  121.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  122.   # * Aliased Method: Set Up New Game
  123.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  124.   def self.setup_new_game(*args)
  125.     dp3_storyentss_dataman_setupnewgame(*args)
  126.     save_storyentwinedsplashscreen_data() if DiamondandPlatinum3::StoryEntwinedSplashScreenMap::ResetSplashScreenMapOnNewGame
  127.   end
  128.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  129.   # * New Method: Save Story Entwined Title Screen Data
  130.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  131.   def self.save_storyentwinedsplashscreen_data()
  132.     variable = $game_variables[DiamondandPlatinum3::StoryEntwinedSplashScreenMap::VariableID]
  133.     save_data(variable, "Data/Story-Entwined-Splash-Screen.rvdata2")
  134.   end
  135.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  136.   # * New Method: Save Story Entwined Title Screen Data
  137.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  138.   def self.load_storyentwinedsplashscreen_data()
  139.     return load_data("Data/Story-Entwined-Splash-Screen.rvdata2") rescue 0
  140.   end
  141. end
  142.  
  143.  
  144.  
  145. #==============================================================================
  146. # ** SceneManager
  147. #------------------------------------------------------------------------------
  148. #  This module manages scene transitions. For example, it can handle
  149. # hierarchical structures such as calling the item screen from the main menu
  150. # or returning from the item screen to the main menu.
  151. #==============================================================================
  152.  
  153. module SceneManager
  154.   class << self
  155.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  156.     # *= Alias Listings
  157.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  158.     alias_method(:dp3_storyentss_scnman_firstsceneclass,  :first_scene_class)
  159.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  160.     # * Get First Scene Class
  161.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  162.     def first_scene_class(*args)
  163.       if DiamondandPlatinum3::StoryEntwinedSplashScreenMap::can_display?
  164.         # Stop Allowing Display. So F12 Resetting doesn't cause a Splash Map to show up again
  165.         DiamondandPlatinum3::StoryEntwinedSplashScreenMap::set_display_value(false)
  166.         # Look through Available Maps, finding the appropriate map to goto
  167.         maps = DiamondandPlatinum3::StoryEntwinedSplashScreenMap::Splash_Screen_Maps.sort.reverse
  168.         variable = DataManager.load_storyentwinedsplashscreen_data()
  169.         maps.each do |info|
  170.           if variable >= info[0]
  171.             DataManager.create_game_objects()
  172.             $game_map.setup(info[1])
  173.             $game_player.moveto(0, 0)
  174.             $game_map.autoplay()
  175.             $game_map.screen.start_fadeout(1)
  176.             return Scene_Map
  177.           end
  178.         end
  179.       end
  180.       return dp3_storyentss_scnman_firstsceneclass(*args)
  181.     end
  182.   end
  183. end
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191. #==============================================================================
  192. # ** Scene_Save
  193. #------------------------------------------------------------------------------
  194. #  This class performs save screen processing.
  195. #==============================================================================
  196.  
  197. class Scene_Save < Scene_File
  198.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  199.   # *= Alias Listings
  200.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  201.   alias_method(:dp3_storyentss_scnsave_onsavesuccess,       :on_save_success)
  202.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  203.   # * Alias Method: On Save Success
  204.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  205.   def on_save_success(*args)
  206.     DataManager.save_storyentwinedsplashscreen_data()
  207.     dp3_storyentss_scnsave_onsavesuccess(*args)
  208.   end
  209. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement