Guest User

Untitled

a guest
Apr 27th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.08 KB | None | 0 0
  1. =begin
  2. ===============================================================================
  3. Extra Start Options (18/1/2015)
  4. -------------------------------------------------------------------------------
  5. Created By: Shadowmaster/Shadowmaster9000/Shadowpasta
  6. (www.crimson-castle.co.uk)
  7.  
  8. ===============================================================================
  9. Information
  10. -------------------------------------------------------------------------------
  11. This script allows you to add extra alternate start options on the title
  12. screen that can send you to different maps. This can be useful to setting up
  13. all different kinds of features on the title screen, such as tutorial modes,
  14. credit screens and more.
  15.  
  16. ===============================================================================
  17. How to Use
  18. -------------------------------------------------------------------------------
  19. Place this script under Materials, and preferably under any other scripts
  20. that overwrite the command list and command window methods in Window_TitleCommand
  21. and Scene_Title. There is an array you can use to set up your extra start
  22. options below.
  23.  
  24. ===============================================================================
  25. Required
  26. -------------------------------------------------------------------------------
  27. Nothing.
  28.  
  29. ===============================================================================
  30. Change log
  31. -------------------------------------------------------------------------------
  32. v1.0: First release. (18/1/2015)
  33.  
  34. ===============================================================================
  35. Terms of Use
  36. -------------------------------------------------------------------------------
  37. * Free to use for both commercial and non-commerical projects.
  38. * Credit me if used.
  39. * Do not claim this as your own.
  40. * You're free to post this on other websites, but please credit me and keep
  41. the header intact.
  42. * If you want to release any modifications/add-ons for this script, the
  43. add-on script must use the same Terms of Use as this script uses. (But you
  44. can also require any users of your add-on script to credit you in their game
  45. if they use your add-on script.)
  46. * If you're making any compatibility patches or scripts to help this script
  47. work with other scripts, the Terms of Use for the compatibility patch does
  48. not matter so long as the compatibility patch still requires this script to
  49. run.
  50. * If you want to use your own seperate Terms of Use for your version or
  51. add-ons of this script, you must contact me at http://www.rpgmakervxace.net
  52. or www.crimson-castle.co.uk
  53.  
  54. ===============================================================================
  55. =end
  56. $imported = {} if $imported.nil?
  57. $imported["ExtraStartPos"] = true
  58.  
  59. module ExtraStartingPositions
  60.  
  61. #==============================================================================
  62. # ** Start Map Options
  63. #------------------------------------------------------------------------------
  64. # This is where you can insert how many extra start options you want on your
  65. # title screen. They are added as arrays with various attributes you can
  66. # customise. If you want to add more start options, insert an array such as
  67. # this one:
  68. #
  69. # ["Command Name", Map ID, X Co-Ord, Y Co-Ord, Menu Order, Transparent]
  70. #
  71. # Command Name is the string used for the name of the extra start option that
  72. # will be displayed in the title screen menu.
  73. #
  74. # Map ID is the ID of the map you want the player to be transported to when
  75. # this start option is selected.
  76. #
  77. # X Co-Ord and Y Co-Ord are the X and Y Co-ordinates you want the player to be
  78. # transported to on the chosen map.
  79. #
  80. # Menu Order is the order that you want the extra start option to be displayed
  81. # in the title screen menu. The lower the number, the higher up it will be
  82. # displayed in the menu (with 1 putting the option at the top). If you simply
  83. # want to put the extra start option at the bottom, use nil or 0.
  84. #
  85. # Transparent sets whether you want the player to be transparent or not when
  86. # the player is transported to that map from the title screen. You can always
  87. # use the default event commands afterwards to change the player's transparency
  88. # as normal.
  89. #
  90. #==============================================================================
  91.  
  92. StartMapOptions =[ # Do not remove!
  93. ["Tutorial", 2, 8, 6, 3, false, false],
  94. ["Credits", 3, 8, 6, 4, true, false],
  95. ] # Do not remove!
  96.  
  97. #==============================================================================
  98. # ** DO NOT edit anything below this unless if you know what you're doing!
  99. #==============================================================================
  100.  
  101. end
  102.  
  103. #==============================================================================
  104. # ** Window_TitleCommand
  105. #------------------------------------------------------------------------------
  106. # This window is for selecting New Game/Continue on the title screen.
  107. #==============================================================================
  108.  
  109. class Window_TitleCommand < Window_Command
  110. #--------------------------------------------------------------------------
  111. # * Create Command List
  112. #--------------------------------------------------------------------------
  113. alias sesp_make_command_list make_command_list
  114. def make_command_list
  115. sesp_make_command_list
  116. for option in ExtraStartingPositions::StartMapOptions
  117. if option[4] != nil && option[4] > 0
  118. extrastart = {:name=>option[0], :symbol =>:alt_start, :enabled=>true, :ext=>option}
  119. @list.insert(option[4]-1, extrastart)
  120. else
  121. add_command(option[0], :alt_start, true, option)
  122. end
  123. end
  124. end
  125. end
  126.  
  127.  
  128. #==============================================================================
  129. # ** Scene_Title
  130. #------------------------------------------------------------------------------
  131. # This class performs the title screen processing.
  132. #==============================================================================
  133.  
  134. class Scene_Title < Scene_Base
  135. #--------------------------------------------------------------------------
  136. # * Create Command Window
  137. #--------------------------------------------------------------------------
  138. alias sesp_create_command_window create_command_window
  139. def create_command_window
  140. sesp_create_command_window
  141. @command_window.set_handler(:alt_start, method(:command_alt_start))
  142. end
  143. #--------------------------------------------------------------------------
  144. # * [New Game using alternate Starting Position] Command
  145. #--------------------------------------------------------------------------
  146. def command_alt_start
  147. map = @command_window.current_ext
  148. DataManager.create_game_objects
  149. $game_party.setup_starting_members
  150. $game_map.setup(map[1])
  151. $game_player.moveto(map[2], map[3])
  152. if map[5] == true
  153. $game_player.transparent = true
  154. else
  155. $game_player.transparent = false
  156. end
  157. $game_player.refresh
  158. Graphics.frame_count = 0
  159. close_command_window
  160. fadeout_all
  161. $game_map.autoplay
  162. SceneManager.goto(Scene_Map)
  163. end
  164. end
Advertisement
Add Comment
Please, Sign In to add comment