Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #===============================================================================
  2. # ** Biography
  3. # Version: 1.0
  4. # Author: VianoceGames
  5. # Date: February , 2015
  6. #-------------------------------------------------------------------------------
  7. # Description:
  8. # This scene creates a new window command in the main menu. This new command
  9. # opens a scene that displays detailed information about each character the
  10. # players of your game encouter through out the story. You can have it so
  11. # only playable characters are found in the biography or any NPCs you deam
  12. # worthy of their own biography. The choice is up to you.
  13. #
  14. #-------------------------------------------------------------------------------
  15. # Instruction:
  16. # Scroll down to the bottom and edit the character array with the information
  17. # about each character you want display in the biography when the game starts.
  18. # You can add more characters in a script call during events. The method of
  19. # doing so is as follows.
  20. #
  21. # By default there are two characters so adding nth = 2, then 3 when you add
  22. # a 4th character and so on.
  23. #
  24. # In a script call write:
  25. # $game_system.biography_chararray[nth] = Array.new
  26. # $game_system.biography_chararray[nth][0] = "Name"
  27. # $game_system.biography_chararray[nth][1] = number <~~ this must number no quotation marks
  28. # $game_system.biography_chararray[nth][2] = "Date of birth" My games have a time system from secs to years.
  29. # $game_system.biography_chararray[nth][3] = "Place of birth"
  30. # $game_system.biography_chararray[nth][4] = "height" ie: "5'3''"
  31. # $game_system.biography_chararray[nth][5] = "class/job/role"
  32. # $game_system.biography_chararray[nth][6] = "Mortality" or whatever you want here.
  33. # $game_system.biography_chararray[nth][7] = "Name of picture in picture folder"
  34. # $game_system.biography_chararray[nth][8] = "Name of picture in picture folder"
  35. # In a future version background will
  36. # be changable per character.
  37. # $game_system.biography_chararray[nth][9] = "Information about the character relavent
  38. # to the progress in the story."
  39. #
  40. # Notes: Changing any information for any character you just use the desired
  41. # line above replacing nth with the number for the desired character in
  42. # the array. It would be wise to keep notes for quick reference.
  43. #
  44. # Character picture images file dimentions are 272 x 288.
  45. #
  46. #-------------------------------------------------------------------------------
  47. # Thanks:
  48. # I would like to give thanks to Pacman for helping me with this script. You
  49. # were a huge help.
  50. #
  51. #===============================================================================
  52.  
  53. class Scene_Biography < Scene_Base
  54. #-----------------------------------------------------------------------------
  55. # * Start Processing
  56. #-----------------------------------------------------------------------------
  57. def start
  58. super()
  59.  
  60. @char_index_array = 0
  61.  
  62. #------------------------------------------------------------------------
  63. # Background Image
  64. #------------------------------------------------------------------------
  65. @background_sprite = Sprite.new()
  66. @background_sprite.bitmap = Cache.picture("CrossedSwords")#background_image)
  67. @background_sprite.x = 0
  68. @background_sprite.y = 0
  69. @background_sprite.z = 0
  70. @background_sprite.zoom_x = Graphics.width.to_f / @background_sprite.bitmap.width
  71. @background_sprite.zoom_y = Graphics.height.to_f / @background_sprite.bitmap.height
  72. @background_sprite.opacity = 255
  73. @background_sprite.visible = true
  74. #------------------------------------------------------------------------
  75.  
  76. #------------------------------------------------------------------------
  77. # Windows
  78. #------------------------------------------------------------------------
  79. @window_biography_name = Window_Biography_Name.new()
  80. @window_biography_image = Window_Biography_image.new()
  81. @window_biography_bios = Window_Biography_Bios.new()
  82. @window_biography_cgs = Window_Biography_CGS.new()
  83. #------------------------------------------------------------------------
  84.  
  85. end
  86. #--------------------------------------------------------------------------
  87. # * Post-Start Processing
  88. #--------------------------------------------------------------------------
  89. def post_start
  90. super()
  91. end
  92. #--------------------------------------------------------------------------
  93. # * Frame Update
  94. #--------------------------------------------------------------------------
  95. def update
  96. super()
  97.  
  98. return_scene() if Input.trigger?(:B)
  99. cancel_se() if Input.trigger?(:B)
  100. scroll_right() if Input.trigger?(:RIGHT)
  101. scroll_left() if Input.trigger?(:LEFT)
  102. end
  103. end
  104.  
  105. def cancel_se
  106. cancel_sound = "Cancel2"
  107. RPG::SE.new(cancel_sound, 70, 100).play
  108.  
  109. end
  110.  
  111. def scroll_right
  112. scroll_se = "Decision3"
  113. RPG::SE::new(scroll_se, 70, 100).play
  114.  
  115. return unless $game_system.char_index_array < $game_system.biography_chararray.size - 1
  116. $game_system.char_index_array += 1
  117.  
  118. @window_biography_name.refresh
  119. @window_biography_image.refresh
  120. @window_biography_bios.refresh
  121. @window_biography_cgs.refresh
  122. end
  123.  
  124. def scroll_left
  125. scroll_se = "Decision3"
  126. RPG::SE::new(scroll_se, 70, 100).play
  127.  
  128. return unless $game_system.char_index_array > 0
  129. $game_system.char_index_array -= 1
  130.  
  131. @window_biography_name.refresh
  132. @window_biography_image.refresh
  133. @window_biography_bios.refresh
  134. @window_biography_cgs.refresh
  135. end
  136. #--------------------------------------------------------------------------
  137. # * Pre-Termination Processing
  138. #--------------------------------------------------------------------------
  139. def pre_terminate
  140. @character_sprite.dispose()
  141. @character_sprite.bitmap.dispose()
  142. @background_sprite.dispose()
  143. @background_sprite.bitmap.dispose()
  144. end
  145. #--------------------------------------------------------------------------
  146. # * Termination Processing
  147. #--------------------------------------------------------------------------
  148. def terminate
  149. super()
  150. @window_biography_name.dispose()
  151. @window_biography_image.dispose()
  152. @window_biography_bios.dispose()
  153. @window_biography_cgs.dispose()
  154. end
  155.  
  156. #==============================================================================
  157. # ** Window_MenuCommand
  158. #------------------------------------------------------------------------------
  159. # This command window appears on the menu screen.
  160. #==============================================================================
  161.  
  162. class Window_MenuCommand < Window_Command
  163. #--------------------------------------------------------------------------
  164. # * For Adding Original Commands
  165. #--------------------------------------------------------------------------
  166. alias vg14_custscene_winmencmmd_addorigcmmd_74yrth add_original_commands
  167. #--------------------------------------------------------------------------
  168. def add_original_commands
  169. vg14_custscene_winmencmmd_addorigcmmd_74yrth() # Call original method
  170. add_command("Biography", :biography_scene, true)
  171. end
  172. end
  173.  
  174.  
  175.  
  176. #==============================================================================
  177. # ** Scene_Menu
  178. #------------------------------------------------------------------------------
  179. # This class performs the menu screen processing.
  180. #==============================================================================
  181.  
  182. class Scene_Menu < Scene_MenuBase
  183. #--------------------------------------------------------------------------
  184. # * Create Command Window
  185. #--------------------------------------------------------------------------
  186. alias vg14_custscene_scenemenu_createcmmdwindow_74yrth create_command_window
  187. #--------------------------------------------------------------------------
  188. def create_command_window
  189. vg14_custscene_scenemenu_createcmmdwindow_74yrth() # Call original method
  190. @command_window.set_handler(:biography_scene, method(:command_scenebiography))
  191. end
  192.  
  193. def command_scenebiography
  194. SceneManager.call(Scene_Biography)
  195. end
  196. end
  197.  
  198. #==============================================================================
  199. # ** Window_Biography_Name
  200. #------------------------------------------------------------------------------
  201. # This message window is used to display text
  202. #==============================================================================
  203.  
  204. class Window_Biography_Name < Window_Base
  205. def initialize()
  206. super(0, 0, (Graphics.width * 0.5) , (Graphics.height * 0.13))
  207. draw_name()
  208. end
  209.  
  210. def draw_name()
  211. text = $game_system.biography_chararray[$game_system.char_index_array][0]
  212. draw_text_ex(0, 0, text)
  213. end
  214.  
  215. def refresh()
  216. contents.clear
  217. draw_name()
  218. end
  219.  
  220. end
  221.  
  222. #==============================================================================
  223. # ** Window_Biography_image.
  224. #------------------------------------------------------------------------------
  225. # This message window is used to display text for the quest Desription.
  226. #==============================================================================
  227.  
  228. class Window_Biography_image < Window_Base
  229. def initialize()
  230. super((Graphics.width * 0.05), (Graphics.height * 0.2), (Graphics.width * 0.4), (Graphics.height * 0.4))
  231. draw_image()
  232. end
  233.  
  234. def draw_image
  235. #------------------------------------------------------------------------
  236. # Character Image
  237. #------------------------------------------------------------------------
  238. @character_sprite = Sprite.new()
  239. @character_sprite.bitmap = Cache.picture($game_system.biography_chararray[$game_system.char_index_array][7])#background_image)
  240. @character_sprite.x = 63
  241. @character_sprite.y = 88
  242. @character_sprite.z = 150
  243. @character_sprite.zoom_x = 272.0 * 0.54 / @character_sprite.bitmap.width
  244. @character_sprite.zoom_y = 288.0 * 0.54 / @character_sprite.bitmap.height
  245. @character_sprite.opacity = 255
  246. @character_sprite.visible = true
  247. #------------------------------------------------------------------------
  248. end
  249.  
  250. def refresh()
  251. @character_sprite.dispose()
  252. @character_sprite.bitmap.dispose()
  253. draw_image()
  254. end
  255.  
  256. end
  257.  
  258. #==============================================================================
  259. # ** Window_Biography_Bios
  260. #------------------------------------------------------------------------------
  261. # This message window is used to display text
  262. #==============================================================================
  263.  
  264. class Window_Biography_Bios < Window_Base
  265. def initialize()
  266. super((Graphics.width * 0.5), 0, (Graphics.width * 0.5), (Graphics.height * 0.7))
  267. draw_age() # Character's age
  268. draw_dob() # Character's date of birth
  269. draw_bp() # Character's place of birth
  270. draw_ht() # Character's height
  271. draw_clss() # Character's class
  272. draw_mort() # Character's mortality. You can edit this to be aleigence
  273. # or something if you wish. Just edit the method below to
  274. # display the desired lable (ie: "Mortality: ")
  275. end
  276.  
  277. def draw_age()
  278. text = "Age: " + $game_system.biography_chararray[$game_system.char_index_array][1].to_s
  279. draw_text_ex(5, 6, text)
  280. end
  281.  
  282. def draw_dob()
  283. text = "DOB: " + $game_system.biography_chararray[$game_system.char_index_array][2]
  284. draw_text_ex(5, 39, text)
  285. end
  286.  
  287. def draw_bp()
  288. text = "Birthplace: " + $game_system.biography_chararray[$game_system.char_index_array][3]
  289. draw_text_ex(5, 78, text)
  290. end
  291.  
  292. def draw_ht()
  293. text = "Height: " + $game_system.biography_chararray[$game_system.char_index_array][4]
  294. draw_text_ex( 5, 117, text)
  295. end
  296.  
  297. def draw_clss()
  298. text = "Class: " + $game_system.biography_chararray[$game_system.char_index_array][5]
  299. draw_text_ex( 5, 156, text)
  300. end
  301.  
  302. def draw_mort()
  303. text = "Mortality: " + $game_system.biography_chararray[$game_system.char_index_array][6]
  304. draw_text_ex( 5, 195, text)
  305. end
  306.  
  307. def refresh()
  308. contents.clear
  309. draw_age()
  310. draw_dob()
  311. draw_bp()
  312. draw_ht()
  313. draw_clss()
  314. draw_mort()
  315. end
  316.  
  317. end
  318.  
  319. #==============================================================================
  320. # ** Window_Biography_CGS
  321. #------------------------------------------------------------------------------
  322. # This message window is used to display text
  323. #==============================================================================
  324.  
  325. class Window_Biography_CGS < Window_Base
  326. def initialize()
  327. super(0, (Graphics.height * 0.7), Graphics.width, (Graphics.height * 0.3))
  328. draw_cgs()
  329. end
  330.  
  331. def draw_cgs()
  332. text = "Character Growth: \n" + $game_system.biography_chararray[$game_system.char_index_array][9]
  333. draw_text_ex( 0, 0, text)
  334. end
  335.  
  336. def refresh()
  337. contents.clear
  338. draw_cgs()
  339. end
  340.  
  341. end
  342.  
  343. #==============================================================================
  344. # ** Game_System
  345. #------------------------------------------------------------------------------
  346. # This class handles system data. It saves the disable state of saving and
  347. # menus. Instances of this class are referenced by $game_system.
  348. #==============================================================================
  349.  
  350. class Game_System
  351. #--------------------------------------------------------------------------
  352. # * Public Instance Variables
  353. #--------------------------------------------------------------------------
  354. attr_accessor :biography_chararray
  355. attr_accessor :char_index_array
  356. #--------------------------------------------------------------------------
  357. # * Object Initialization
  358. #--------------------------------------------------------------------------
  359. alias vg14_gamesystem_biography_initialize_435r initialize
  360. #--------------------------------------------------------------------------
  361. def initialize
  362. vg14_gamesystem_biography_initialize_435r() # Call original method
  363. @char_index_array = 0 # Gives variable value other than nil
  364. #===========================================================================
  365. # Character Database Array
  366. #---------------------------------------------------------------------------
  367.  
  368. @biography_chararray = [ # Don't touch this line
  369. #---------------------------------------------------------------------------
  370. # Editable Region
  371. #---------------------------------------------------------------------------
  372. # Name:0 Age:1 DOB:2 Birthplace:3 Height:4 Class:5 Mortality:6 CharImage:7 Background:8 CGS:9
  373. ["Ernesto", 2472, "Mon Day, Year", "Mt. Colib", "5'9''", "SpellBlade", "Immortal", "Actor4-5", "CrossedSwords", "Growth Description"],
  374. ["Benedict", 8473, "Mon Day, Year", "Unknown", "6'1''", "Vampire", "Immortal", "Benedict", "", ""],
  375. #---------------------------------------------------------------------------
  376. ]# End of Character Database Array \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
  377. #===========================================================================
  378.  
  379. end
  380. end