Improved save

Image

Image

This script has been created with the idea to give the maxium freedom and
possibilities to the creator. I think this system open many new ways, but i may
take some work for you.

Anyway the script comes with a working default configuration for each feature and
also have the option to make autoconfigurations. Turning on/off a feature only
needs to changue one option.

Main systems:

-Autosave system with temporizer or/and map script calls. The autosave warns you
activating a switch everytime is autosaved. Use a reserved slot for this system
that can be protected.

-Quicksave system. This lets the player to save everywhere, with the condition that
the quick savegame will be erased. Use a reserved slot for this system, that can be
protected. It have a must load option that protect agains cheaters.

-One slots modes. They make all the save and load process automatically. Also exist
a Quicksaving one slot mode that works like roguelikes ones.

-Complete event save control system. You can now save, load, erase, check if
savegame exist, keep savegame information in event variables, quick save
and autosave with simple script calls. It also have a function to call the load
game menu.

-Very complex and complete graphic personalitzation. Now savegames can show:
steps
map description(based on maps id)
map name
gameplay time
date
description(a text thats saved with the game. Ex: "Chapter I")
money
completed game(based on event variable)

actors names
actors levels
actors graphics
actors faces

There are two graphic configuration modes. With the automatic you can set all that
things in two lines, but with the advanced you can select also every option position.
and other extra things.

It also add the follow features:
-Backwindows and backscene based on images
-You can configurate windows transparencys and visibility.
-Some control over the fonts.

Other features:
-You can select savegame folder, savegames names and extensions.
-Warning messages.
-Main menu quicksave entry
-Configurable slot number.
-Extended vocabulary configuration
-High compatibality. You can disable individually the changues to game_system,
title, end or main menu.

In progress features:
-Slot sort system
-Graphic mode with one actor games in mind.
-Improved slot visually identification.
-Definition of font for each text.
-Some compatibility improvements
-Graphics and interace improvements

Planned features:
-Use of icons
-New base graphic styles
-More complex save scene
-Screen captures
-Extended roguelike style support


This script is in development. I have been testing it , but in a huge system like this im sure that will show some bugs or mistakes... just ask.
Suggerences, critics, translation mistakes, etc... will be listened. Also compatiblity issues.

You have to add two scripts. The first one its the configurator, and the second the script code. You have to put they in this order before main script.

Configuration:

  1. #==============================================================================
  2. # Improved Save
  3. # By gerkrt/gerrtunk
  4. # Version: 1
  5. # License: GPL, credits
  6. #==============================================================================
  7.  
  8. =begin
  9.  
  10.  
  11. ----INTRODUCTION AND SCRIPT DESCRIPTION-----
  12.  
  13. This script has been created with the idea to give the maxium freedom and
  14. possibilities to the creator. I think this system open many new ways, but i may
  15. take some work for you.
  16.  
  17. Anyway the script comes with a working default configuration for each feature and
  18. also have the option to make autoconfigurations. Turning on/off a feature only
  19. needs to changue one option.
  20.  
  21. Main systems:
  22.  
  23. -Autosave system with temporizer or/and map script calls. The autosave warns you
  24. activating a switch everytime is autosaved. Use a reserved slot for this system
  25. that can be protected.
  26.  
  27. -Quicksave system. This lets the player to save everywhere, with the condition that
  28. the quick savegame will be erased. Use a reserved slot for this system, that can be
  29. protected. It have a must load option that protect agains cheaters.
  30.  
  31. -One slots modes. They make all the save and load process automatically. Also exist
  32. a Quicksaving one slot mode that works like roguelikes ones.
  33.  
  34. -Complete event save control system. You can now save, load, erase, check if
  35. savegame exist, keep savegame information in event variables, quick save
  36. and autosave with simple script calls. It also have a function to call the load
  37. game menu.
  38.  
  39. -Very complex and complete graphic personalitzation. Now savegames can show:
  40.   steps
  41.   map description(based on maps id)
  42.   map name
  43.   gameplay time
  44.   date
  45.   description(a text thats saved with the game. Ex: "Chapter I")
  46.   money
  47.   completed game(based on event variable)
  48.  
  49.   actors names
  50.   actors levels
  51.   actors graphics
  52.   actors faces
  53.  
  54. There are two graphic configuration modes. With the automatic you can set all that
  55. things in two lines, but with the advanced you can select also every option position.
  56. and other extra things.
  57.  
  58. It also add the follow features:
  59.   -Backwindows and backscene based on images
  60.   -You can configurate windows transparencys and visibility.
  61.   -Some control over the fonts.
  62.  
  63. -Other features:
  64.   -You can select savegame folder, savegames names and extensions.
  65.   -Warning messages.
  66.   -Main menu quicksave entry
  67.   -Configurable slot number.
  68.   -Extended vocabulary configuration
  69.   -High compatibality. You can disable individually the changues to game_system,
  70.   title, end or main menu.
  71.  
  72. -In progress features:
  73.   -Slot sort system
  74.   -Graphic mode with one actor games in mind.
  75.   -Improved slot visually identification.
  76.   -Definition of font for each text.
  77.   -Some compatibility improvements
  78.  
  79. -Planned features:
  80.   -Use of icons
  81.   -New base graphic styles
  82.   -More complex save scene
  83.   -Screen captures
  84.   -Extended roguelike style support
  85.  
  86. ----IMPORTANT INFORMATION-----
  87.  
  88. -Activate or desactive the first value of a system desactive all the other
  89. options. You dont have to changue nothing.
  90.  
  91. -You dont need to configurate nothing, it will just work in the more standard way.
  92.  
  93. -The configuration options are sorted by importance.
  94.  
  95. -You will find the configuration module after each module instructions.
  96.  
  97. This is the module index:
  98.  
  99.   -Quicksave
  100.   -Autosave
  101.   -One slot modes
  102.   -Graphic options
  103.   -General options
  104.   -Save controlled by events
  105.   -Vocabulary
  106.   -Compatibality
  107.  
  108. -----QUICKSAVE-------
  109.  
  110. To enable: Quicksave = true
  111.  
  112.  
  113. After_quicksave: If 0 the game will quit, if 1 it will go to title.
  114.  
  115. Quicksave_sep_slot: Protect the slot making that it cant be saved via save menu
  116.  
  117. Main_menu_quicksave: Enables the main menu quicksave entry.
  118.  
  119. Quicksave_warning_message: It will show a warning message telling that the quicksave
  120. have been compelted with exit.
  121.  
  122. Must_load: This make that if exist a quicksave slot, it will automatically load
  123. and erase it. The load menu is skipped.
  124.  
  125. $game_system.disabled_quicksave = true : This script call will disable the
  126. quicksave main menu entry.
  127.  
  128. $game_system.disabled_quicksave = false : This script call will enable the
  129. quicksave main menu entry.
  130.  
  131. =end
  132.  
  133. module Wep
  134.  
  135.   # Quicksave
  136.  
  137.   Quicksave = true
  138.  
  139.   After_quicksave = 0  
  140.   Must_load = true
  141.  
  142.   Quicksave_slot = 1
  143.   Quicksave_warning_message = true
  144.   Quicksave_sep_slot = true
  145.   Main_menu_quicksave = true
  146.  
  147. end
  148.  
  149.  
  150. =begin
  151.  
  152. -----AUTOSAVE-------
  153.  
  154. To enable: Autosave = true
  155.  
  156.  
  157. Autosave_type: Define the autosave work mode. If its 0 it will be automatically
  158. saved and also you can call script $game_system.map_autosave to force a autosave.
  159. If its 1 it will use script calls.
  160.  
  161. Switch_info: Defines the switch that its actived when the automatic save(with timer)
  162. is done.
  163.  
  164. Autosave_time: Frames between each autosave. Uses the same measure that wait command.
  165. 2 frames x second.`
  166.  
  167. Autosave_sep_slot: Protect autosave slot to being saved via menu.
  168.  
  169. $game_system.disabled_autosave = true : This script call will stop autosave timer.
  170. $game_system.disabled_autosave = false : This script call will start autosave timer.
  171. $game_system.restart_auto_save_count : This script call will restart autosave timer.
  172.  
  173. =end
  174.  
  175. module Wep
  176.  
  177.   # Autosave system
  178.   Autosave = true
  179.  
  180.   Autosave_type = 0 # 0: Time and calls. 1: Only user defined map calls  
  181.   Autosave_time = 30
  182.   Switch_info = 1
  183.  
  184.   Autosave_slot = 2
  185.   Autosave_sep_slot = true
  186. end
  187.  
  188.  
  189. =begin
  190.  
  191. -----ONE SLOT MODE-------
  192.  
  193. To active: One_slot_mode = true
  194.  
  195.  
  196. This mode was created with games that only need one slot. They can be cinematic,
  197. lineal or whatever...  the good thing is that with this system save and load
  198. are done automatically in the slot you defined, withou accesing any save meu.
  199.  
  200. One_slot_mode_slot: Here you define the sot where the game is saved in this mode.
  201.  
  202. -----QUICKSAVING ONE SLOT MODE-------
  203.  
  204. To active: One_slot_mode_quicksaving = true
  205.  
  206.  
  207. This mode work like the first, but the savegame will be erased when loaded. This
  208. system is used for example in roguelikes where you can only die one time, but you
  209. can save as long you dont die.
  210.  
  211. After_quicksaving: Defines the behavior of the post quicksave. 0 will quit, 1
  212. will return to title.
  213.  
  214. Quicksaving_warning_message: Actives a warning message that says that the save
  215. have done correctly.
  216.  
  217. This script will use the normal save vocabulary, but the internal
  218. functions are quicksave ones.
  219.  
  220. =end
  221.  
  222. module Wep
  223.  
  224.   # One slot modes
  225.   One_slot_mode = false
  226.   One_slot_mode_quicksaving = false
  227.    
  228.   After_quicksaving = 0  #Quit, scene end,scene tittle
  229.   Quicksaving_warning_message = true
  230.  
  231.   One_slot_mode_slot = 2
  232.  
  233. end
  234.  
  235. =begin
  236.  
  237. ------GRAPHIC CONFIGURATION--------
  238.  
  239. #########################
  240. ######## INDEX ##########
  241. #########################
  242.  
  243.   1- Image based back windows and general scene
  244.   2- Windows transparency
  245.   3- Font options
  246.   4- Other options
  247.   5- Save slot options to show
  248.   5.A- Novice(Automatic mode)
  249.   5.B- Advanced
  250.   6- Map descriptions, completed game % and textual description
  251.   7- Faces configuration
  252.  
  253. Advice: The normal will be that just using basic and novice options you are ok.
  254. You dont need to read or use the rest. If you only need to configure the options
  255. to show in savegames go to 6.
  256.  
  257.  
  258. #################################################################
  259. ######## 1- Image based back windows and general scene ##########
  260. #################################################################
  261.  
  262.  
  263. Save_windows_background, Help_windows_background
  264. Scene_background.
  265.  
  266. They should use the same sizes of the windows that default are:
  267. Save: 640,104
  268. Help: 640, 64
  269. General scene: 640, 480
  270.  
  271. To load a picture you have to changue the name in something different than "":
  272. Scene_background = "Scene.png"
  273.  
  274. Think that this images cant be showed if you dont adjust windws transparencys.
  275.  
  276.  
  277. ###########################################
  278. ######## 2- Windows transparency ##########
  279. ###########################################
  280.  
  281.  
  282. The variables are:
  283.   Save_windows_opacity = 255
  284.   Save_windows_back_opacity = 255
  285.   Help_windows_opacity = 255
  286.   Help_windows_back_opacity = 255
  287. The value must be in 0-255 range. 255 means totally shown.
  288.  
  289. The difference betwen opacity and back opacity is that back opacity only defines
  290. the back part of the window and normal opcity also defines the windows borders.
  291.  
  292.  
  293. ##################################
  294. ######## 3- Font options #########
  295. ##################################
  296.  
  297.  
  298. The variables are:
  299.   Basic_color: Defines the default color used for all normal texts.
  300.  
  301.   Description_color: This is used to improve the aestethics, for example, defines
  302.   the color of the text "Steps" that goes before the steps number. The default
  303.   color is based on the internal rgss system color.
  304.  
  305.   Description_bold: This option defines if it also uses a bold font.
  306.  
  307.   Save_window_font_name: Self explanatory
  308.   Help_window_font_name: Self explanatory
  309.   Slot_window_font_name: This defines the font of the small window that shows slot
  310.   number.
  311.  
  312.   General_info_font_size: Defines the font size of all the texts of general
  313.   informtion(like steps, gold...)
  314.  
  315.   Actor_info_font_size: Defines the font size of all the texts of actors
  316.   informtion(name and level)
  317.  
  318.  
  319. If you put "" in a font name it will use the default one.
  320.  
  321. Creating colors:
  322.  
  323. Basic_color = Color.new(255, 255, 255, 255)
  324. It means:
  325. Basic_color = Color.new(red, green, blue, alpha). Values beyond 0-255.
  326.  
  327.  
  328. ###################################
  329. ######## 4- Other options #########
  330. ###################################
  331.  
  332.  
  333. Warning_message_position = Warning messages position. x,y
  334. ´
  335. Identifier_text_position = The texts that are drawn in empty slots positions. x,y
  336.  
  337. Help_window_visible: Defines if the help window is visible or not.
  338.  
  339.  
  340.  
  341. #############################################
  342. ######## 5- Save slot options to show #######
  343. #############################################
  344.  
  345. #############################################
  346. ######## 5.A- Novice(Automatic mode) ########
  347. #############################################
  348.  
  349.  
  350. You only need to define what options do you want:
  351.  
  352. Quick_general_info = ['steps', 'map_description', 'time', 'description']
  353.  
  354. This will show the step number, map based description, gameplay time and
  355. a textual description. They will be draw in that order. All the other things
  356. are automatic, and with this modes you cant define any postion.
  357.  
  358. You can put less than 4 options or leave one blank writing the code ''
  359.  
  360. Code list:
  361.  
  362. steps
  363. map_description: map based description(read more above)
  364. map_name
  365. time
  366. date
  367. description: textual description (read more above)
  368. money
  369. completed_game: % of completed game(read more above)
  370.  
  371. Quick_actors_info = ['name', 'level', 'face']
  372.  
  373. This will show actors names, levels and faces(read more above). There is an extra
  374. option called 'graphic' that will show the actor map character graphic.
  375. The graphic and face options are incompatible. Works like the first quick setting
  376. but with any order.
  377.  
  378. The only configuration that you can do in this mode are:
  379.   Face_transparency
  380.   Face_separation
  381.  
  382.  
  383. #################################
  384. ######## 5.B- Advanced ##########
  385. #################################
  386.  
  387.  
  388. First you must know that you can use one of the two quick settings. Ex: If you define
  389. Quick_actors_info you will can define each option for general info.
  390. To put a quick setting of:
  391.  
  392. Quick_actors_info = false
  393.  
  394. Activating options and configurating positions:
  395.  
  396. Show_name = true
  397. Name_position = [108,4]
  398.  
  399. Now it enables show name and it will be drawed in the position x=108, y=4.
  400.  
  401. All the options are explained in the config module.
  402.  
  403. Advices to edit positions:
  404.  
  405. -In loop: The actor information is show with a loop. This means that the position x
  406. is relative, and that is value is defined by a complex formula that you can
  407. somewhat influence. As a basis the x is multiplied for the index of the actor
  408. in the party(starting by 0) to show one before other.
  409. -You can use negative values in the positions.
  410. -You can use blank spaces in the vocabulary to control the
  411. distance between them.
  412. -All default values are the same that areused internally by the automatic mode.
  413. -The y position of the general informations is calculated this way:
  414.   When first option the y is -9    
  415.   When second option the y is 11  
  416.   When third option the y is 30    
  417.   When four option the y is 46    
  418.  
  419.  
  420. #################################################################################
  421. ######## 6- Map descriptions, completed game % and textual description ##########
  422. #################################################################################
  423.  
  424.  
  425. Map descriptions:
  426.  
  427.   To add new descriptions you have to add a newline like this:
  428.   [[7,8,9,10,11], "Last boss"],
  429.  
  430.   The first are the maps ids, the second the description for they.
  431.   The last line cant have the , at the end. And must have a closing ]
  432.  
  433.   Map_descriptions = ["Default description",[[1,2,3], "Ahmbra forest"],
  434.   [[4,5,6], "Dragon dungeon"]]
  435.  
  436.   The default description will be used for all the maps that you dont specify
  437.   a new description.
  438.  
  439.   In this example it will have to be like this:
  440.  
  441.   Map_descriptions = ["Default description",[[1,2,3], "Ahmbra forest"],
  442.   [[4,5,6], "Dragon dungeon"],
  443.   [[7,8,9,10,11], "Last boss"]]
  444.  
  445.  
  446. Completed game %:
  447.  
  448.   Variable_completed_game: This is the id of event variable in wich is based
  449.   this option.
  450.  
  451. Textual description:
  452.  
  453.   This a text that is going to be saved in the savegame. A phrase. It can have
  454.   a lot of uses, for example, a game that works with argumental chapters can
  455.   also show they here.
  456.  
  457.   To define the text call this script:
  458.  
  459.   text = "Chapter I"
  460.   $game_system.save_description = text
  461.  
  462.   You can changue it anytime you want, and the value isnt reset when you quit
  463.   the game.
  464.  
  465.  
  466. ##########################################
  467. ######## 7- Faces configuration ##########
  468. ##########################################
  469.  
  470.  
  471. To load faces you will need to add pictures for each actor called
  472. Saveface_actorname
  473.  
  474. Ex:
  475.  
  476. Alexis--> Saveface_Alexis.png
  477.  
  478. The image can have any size between heigh 0-96 and width 0-96. Something like 96x96 is
  479. the standard.
  480.  
  481. Face_transparency: This defines the grade of opaciry of the image
  482.  
  483. Face_separation: A value in wich is based face image separation algorithm. You
  484. might want to use it when you are using faces with stranfe sizes.
  485.  
  486.  
  487. =end
  488.  
  489. module Wep
  490.  
  491.   # General
  492.   Scene_background = "" #
  493.   Warning_message_position = [220,200]
  494.   Identifier_text_position = [4,20]
  495.  
  496.   # Save windows
  497.   Save_windows_opacity = 255
  498.   Save_windows_back_opacity = 255
  499.   Save_windows_background = ""
  500.  
  501.   # Help windows
  502.   Help_windows_opacity = 255
  503.   Help_windows_back_opacity = 255
  504.   Help_window_background = ""
  505.   Help_window_visible = true
  506.  
  507.   # Font
  508.   Basic_color = Color.new(255, 255, 255, 255)
  509.   Description_color = Color.new(192, 224, 255, 255)
  510.   Description_bold = true
  511.   Save_window_font_name = "Times New Roman"
  512.   Help_window_font_name = "Times New Roman"
  513.   Slot_window_font_name = "Times New Roman"
  514.   General_info_font_size = 22
  515.   Actor_info_font_size = 22
  516.  
  517.   # Quick configurators
  518.   Quick_general_info = ['steps', 'description', 'time', 'map_description']
  519.   Quick_actors_info = ['name', 'level', 'graphic']
  520.  
  521.   # Advanced configurator
  522.  
  523.   # Actors information
  524.   Show_name = true # Names
  525.   Name_position = [108,48]
  526.   Show_level = true # Levels
  527.   Level_position = [108,30]
  528.  
  529.   Show_faces = true # Faces
  530.   Face_transparency =  75
  531.   Face_separation = 105
  532.   Face_position = [0,68]
  533.  
  534.   Show_graphic = false # Characters map graphics
  535.   Graphic_position = [160,54]
  536.  
  537.   # General information
  538.   Show_time = true # Gameplay time
  539.   Time_position = [0,-9]
  540.   Show_steps = false # Steps
  541.   Steps_position = [0,-9]
  542.   Show_date = false # Date
  543.   Date_position = [0,11]
  544.   Show_money = false # Money
  545.   Money_position = [0,11]
  546.  
  547.   Show_map_name = false # Map name
  548.   Map_name_position = [0,30]
  549.   Show_map_description = true # Map description
  550.   Map_description_position = [0,30]
  551.   Map_descriptions = ["Default description",[[1,2,3], "Ahmbra forest"],
  552.   [[4,5,6], "Dragon dungeon"]]
  553.   Show_completed_game = true # Completed game %
  554.   Completed_game_position = [0,47]
  555.   Variable_completed_game = 1
  556.   Show_description = true # Textual description
  557.   Description_position = [0,47]
  558.  
  559. end
  560.  
  561.  
  562. =begin
  563.  
  564. ------GENERAL OPTIONS--------
  565.  
  566. Save_folder: The name of the directory for save slots. Save_folder = ""
  567.  
  568. Max slots: Maxium slots to use. Max is 1000.
  569.  
  570. File_name: The name of the files created by the program.
  571.  
  572. Saves_extension: Defines the save files extension.
  573.  
  574. =end
  575.  
  576.  
  577.  
  578. module Wep
  579.  
  580.   # General options
  581.   Max_slots = 7
  582.    
  583.   Save_folder = "Saves"
  584.  
  585.   File_name = "Ranura"
  586.   Saves_extension = ".rxdata"
  587.  
  588. end
  589.  
  590.  
  591. =begin
  592.  
  593. -----EVENT SAVE CONTROL-------
  594.  
  595. Scripts calls:
  596.  
  597. $game_system.map_quicksave : Save the game in the quicksave slot.
  598.  
  599. $game_system.map_autosave : Save the game in the autosave slot.
  600.  
  601. $game_system.load_slot(X) : Load the game in slot X.
  602.  
  603. $game_system.save_slot(X) : Save the game in slot X.
  604.  
  605. $game_system.erase_slot(X) : Erase the game in slot X.
  606.  
  607. $game_system.slot_exist(X) : It tells you if slot X exist. Have two uses_:
  608.  
  609.   1-The script returns true/false, you can use it in a conditional branch script option.
  610.   2-Script also saves true/fase in the switch defined by Sw_file_exist.
  611.  
  612. $game_system.slot_info(X) : It save the slot information in the slots you defined.
  613.   -Date
  614.   -Time
  615.   -Steps
  616.   -Gold
  617.   -Group actors ids
  618.   -Group actors levels
  619.  
  620. $scene = Scene_Load.new(true): Call load menu in a map.
  621.  
  622. =end
  623.  
  624. module Wep
  625.  
  626.   Sw_file_exist = 2
  627.  
  628.   Vars_actors_ids = [1,2,3,4] # Group actors ids
  629.   Vars_actors_levels = [5,6,7,8] # Group actors levels
  630.   # Date: Year, Month, Day, Hour, Minute, Second
  631.   Vars_date = [9,10,11,12,13,14]
  632.   # Time: Hour, minute, second
  633.   Vars_time = [15,16,17]
  634.   Vars_money = 18 # Gold
  635.   Vars_steps = 19 # Steps
  636.  
  637. end
  638.  
  639.  
  640. =begin
  641.  
  642. -----VOCABULARY-------
  643.  
  644. Remember that you can use special signes, modify spaces or make it empty with
  645. text=""
  646.  
  647. =end
  648.  
  649. module Wep
  650.  
  651.   # Save menu
  652.   Save_description_text = "Select slot to save your game"
  653.   Load_description_text = "Select slot to load your game"
  654.   Money_text = "Money  "
  655.   Steps_text = "Steps  "
  656.   Level_text = "Lv."
  657.   Completed_game_text = "% completed"
  658.   Empty_slot = "Empty slot"
  659.   Slot = 'Slot '
  660.   Empty_quicksave_slot_text  = "Empty quicksave slot"
  661.   Empty_autosave_slot_text  = "Empty autosave slot"
  662.   Quicksave_slot_text = "Quicksave"
  663.   Autosave_slot_text  = "Autosave"
  664.   Slot_dont_exist = "Nonexistent slot"
  665.  
  666.   # Main menu (Scene_Menu)
  667.   Warning_message_text = "Quicksave completed"
  668.   Warning_message_one_slot_text = "Save completed"
  669.  
  670.   Main_menu_quicksave_text = "Quicksave"
  671.   Main_menu_status_text = "Status"
  672.   Main_menu_quit_text = "Exit"
  673.   Main_menu_save_text = "Save"
  674.  
  675.   # Title (Scene_Title)
  676.   Title_quickload = "Quickload"
  677.   New_game_text = "New game"
  678.   Load_game_text = "Load"
  679.   Quit_game_text = "Exit"
  680.  
  681. end
  682.  
  683. =begin
  684.  
  685. -----COMPATIBILITY----
  686.  
  687. This script is coded in a modular and flexible structure. You can totally
  688. desactivate some of the features to improve compatibility with others scripts.
  689.  
  690. With each option is explained what features and options you will lose.
  691.  
  692. Main_menu_modification:
  693.   -Quicksave entry in main menu and all its options.
  694.   -Revamped style
  695.   -Vocabulary of that scene
  696.  
  697. Title_modification:
  698.   -Quicksave: Must load option
  699.   -Vocabulary of that scene
  700.   -One slot modes
  701.  
  702. =end
  703.  
  704.  
  705. module Wep
  706.   Main_menu_modification = true
  707.   Title_modification = true
  708. end
  709.  
  710.  
  711.  
Expand to see the code.
Script code:

  1. #==============================================================================
  2. # Warning message
  3. # By gerkrt/gerrtunk
  4. # Version: 1
  5. # License: GPL, credits
  6. #==============================================================================
  7. =begin
  8.  
  9. I created this script long ago for one of my menus and any other project. Its very flexible
  10. and can be used for a lot of things. It uses a modified window+sprite combination
  11. because i think that it looks better, anyway you can modify it or do what you want.
  12.  
  13. -The window size and position is based on the text size.
  14. -All other sizes or positions are set automatically.
  15. -It have methods for automatically visible/invisible, dipose,etc, all sprites
  16. and windows.
  17. -You can add a question to it. With this a modified version of a window command
  18. is actived.
  19. -You can changue the text, ask option, x and y in every call.
  20.  
  21. I use it with a variable in the Scene called "Warning_message_type" that defines
  22. the behavior of it.
  23.  
  24. =end
  25. class Warning_Message
  26.   def initialize
  27.     # Default values when refreshing it
  28.     @default_x = 200
  29.     @default_y = 200
  30.     # Back text window
  31.     @text_window = Window_Base.new(120, 136, 400, 64)
  32.     @text_window.z = 252
  33.     @text_window.visible = false
  34.     # Text sprite
  35.     @text_sprite = Sprite.new
  36.     @text_sprite.z = 254
  37.     @text_sprite.x = 120
  38.     @text_sprite.y = 136
  39.     @text_sprite.bitmap = Bitmap.new(400,64)
  40.     # Testing bitmap for size test
  41.     @testing_bitmap =  Bitmap.new(1,1)
  42.     # Question window
  43.     @question_window = Window_Selection.new(80, ["Yes", "No"])
  44.     @question_window.x = 280
  45.     @question_window.y = 200
  46.     @question_window.z = 253
  47.     @question_window.back_opacity = 0
  48.     @question_window.opacity = 0
  49.     @question_window.active = false
  50.     @question_window.visible = false
  51.     # Back question window
  52.     @back_question_window = Window_Base.new(120, 136, 64, 64)
  53.     @back_question_window.x = 280
  54.     @back_question_window.y = 200
  55.     @back_question_window.z = 254
  56.     @back_question_window.visible = false
  57.  
  58.   end
  59.  
  60.   # Make all the sprites/windows visibles
  61.   def visible
  62.     @text_window.visible = true
  63.     @text_sprite.visible = true
  64.     # Question ones only if active
  65.     if @question_window.active
  66.       @question_window.visible = true
  67.       @back_question_window.visible = true
  68.     end
  69.   end
  70.  
  71.   # Make all the sprites/windows invisibles
  72.   def no_visible
  73.     @text_window.visible = false
  74.     @text_sprite.visible = false
  75.     @question_window.visible = false
  76.     @back_question_window.visible = false
  77.   end
  78.  
  79.   # Is question window active?
  80.   def active
  81.     return @question_window.active
  82.   end
  83.  
  84.   # Set question window active
  85.   def active=(value)
  86.     @question_window.active = value
  87.   end
  88.  
  89.   # Update all the sprites/windows visibles
  90.   def update
  91.     @text_window.update
  92.     @text_sprite.update
  93.     @back_question_window.update
  94.     @question_window.update
  95.   end
  96.  
  97.   # Draw the warning message
  98.   # question: called to add a yes/no window.
  99.   def refresh(message, question=false, x=@default_x, y=@default_y)
  100.     # Basic position settings
  101.     @text_window.y = y
  102.     @text_window.x = x
  103.     @text_sprite.x = x
  104.     @text_sprite.y = y
  105.     rect = @testing_bitmap.text_size(message)
  106.     # With question window or not. All the positions auto-setting are done here.
  107.     if question
  108.       @text_window.width = rect.width+26+40
  109.       @question_window.visible = true
  110.       @question_window.active = true
  111.       @back_question_window.visible = true
  112.       @question_window.x = @text_window.x+rect.width+4+6
  113.       @question_window.y = @text_window.y - 16
  114.       @back_question_window.x = @text_window.x+rect.width+4+16
  115.       @back_question_window.y = @text_window.y
  116.     else
  117.       @text_window.width = rect.width+26
  118.     end
  119.     # First update the back window
  120.     @text_window.update
  121.     @text_sprite.bitmap.clear
  122.     # Draw text
  123.     @text_sprite.bitmap.draw_text(0+10,0,400,64,message, 0)
  124.     @text_sprite.update
  125.   end
  126.  
  127.   # Dispose all the sprites/windows visibles
  128.   def dispose
  129.     @text_window.dispose
  130.     @text_sprite.dispose
  131.     @question_window.dispose
  132.     @back_question_window.dispose
  133.   end
  134. end
  135.  
  136.  
  137. class Window_Selection < Window_Command
  138.    #--------------------------------------------------------------------------
  139.   # * Update Cursor Rectangle
  140.   #--------------------------------------------------------------------------
  141.   def update_cursor_rect
  142.     # If cursor position is less than 0
  143.     if @index < 0
  144.       self.cursor_rect.empty
  145.       return
  146.     end
  147.     # Get current row
  148.     row = @index / @column_max
  149.     # If current row is before top row
  150.     if row < self.top_row
  151.       # Scroll so that current row becomes top row
  152.       self.top_row = row
  153.     end
  154.     # If current row is more to back than back row
  155.     if row > self.top_row + (self.page_row_max - 1)
  156.       # Scroll so that current row becomes back row
  157.       self.top_row = row - (self.page_row_max - 1)
  158.     end
  159.     # Calculate cursor width
  160.     cursor_width = (self.width / @column_max - 32)+11
  161.     # Calculate cursor coordinates
  162.     x = @index % @column_max * (cursor_width + 32)
  163.     y = @index / @column_max * 32 - self.oy
  164.     # Update cursor rectangle
  165.     self.cursor_rect.set(x-4, y, cursor_width, 32)
  166.   end
  167.  
  168. end
  169.  
  170.  
  171. module Wep
  172.   Save_windows_size = [640,104]
  173. end
  174.  
  175. #--------------------------------------------------------------------------
  176. # * Compatibility check: Main menu modification
  177. #--------------------------------------------------------------------------
  178. if Wep::Main_menu_modification
  179.  
  180. # Main menu quicksave addittion
  181. if Wep::Main_menu_quicksave and Wep::Quicksave
  182.  
  183. #==============================================================================
  184. # ** Window_PlayTime
  185. #------------------------------------------------------------------------------
  186. #  Modified
  187. #==============================================================================
  188.  
  189. class Window_PlayTime < Window_Base
  190.   #--------------------------------------------------------------------------
  191.   # * Object Initialization
  192.   #--------------------------------------------------------------------------
  193.   def initialize
  194.     super(0, 0, 160, 50)
  195.     self.contents = Bitmap.new(width - 32, height - 32)
  196.     refresh
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # * Refresh
  200.   #--------------------------------------------------------------------------
  201.   def refresh
  202.     self.contents.clear
  203.     @total_sec = Graphics.frame_count / Graphics.frame_rate
  204.     hour = @total_sec / 60 / 60
  205.     min = @total_sec / 60 % 60
  206.     sec = @total_sec % 60
  207.     text = sprintf("%02d:%02d:%02d", hour, min, sec)
  208.     self.contents.font.color = normal_color
  209.     self.contents.draw_text(4, -5, 120, 32, text, 2)
  210.   end
  211.   #--------------------------------------------------------------------------
  212.   # * Frame Update
  213.   #--------------------------------------------------------------------------
  214.   def update
  215.     super
  216.     if Graphics.frame_count / Graphics.frame_rate != @total_sec
  217.       refresh
  218.     end
  219.   end
  220. end
  221. end
  222.  
  223.  
  224. #================================================================="=============
  225. # ** Scene_Menu
  226. #------------------------------------------------------------------------------
  227. #  This class performs menu screen processing.
  228. #==============================================================================
  229.  
  230. class Scene_Menu
  231.   #--------------------------------------------------------------------------
  232.   # * Object Initialization
  233.   #     menu_index : command cursor's initial position
  234.   #--------------------------------------------------------------------------
  235.   def initialize(menu_index = 0)
  236.     @menu_index = menu_index
  237.     @warning_message_active = false # Used to check for warning message active or not
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # * Main Processing
  241.   #--------------------------------------------------------------------------
  242.   def main
  243.    # Create warning window
  244.    @warning_window = Warning_Message.new
  245.    # If main menu quicksave are active all the initialitzation is modified
  246.    if Wep::Main_menu_quicksave and  Wep::Quicksave and not Wep::One_slot_mode_quicksaving
  247.     # Make command window
  248.     s1 = $data_system.words.item
  249.     s2 = $data_system.words.skill
  250.     s3 = $data_system.words.equip
  251.     s4 = Wep::Main_menu_status_text
  252.     s5 = Wep::Main_menu_save_text
  253.     s6 = Wep::Main_menu_quicksave_text
  254.     s7 = Wep::Main_menu_quit_text
  255.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
  256.     @command_window.index = @menu_index
  257.     # If number of party members is 0
  258.     if $game_party.actors.size == 0
  259.       # Disable items, skills, equipment, and status
  260.       @command_window.disable_item(0)
  261.       @command_window.disable_item(1)
  262.       @command_window.disable_item(2)
  263.       @command_window.disable_item(3)
  264.     end
  265.     # If save is forbidden
  266.     if $game_system.save_disabled
  267.       # Disable save
  268.       @command_window.disable_item(4)
  269.     end
  270.    
  271.    if $game_system.disabled_quicksave != nil
  272.     # If quick save is forbidden
  273.     if $game_system.disabled_quicksave
  274.       # Disable save
  275.       @command_window.disable_item(6)
  276.     end
  277.    end
  278.  
  279.     # Resize windows and changue positions to give space to quicksave entry
  280.     @command_window.height+= 14
  281.     # Make play time window
  282.     @playtime_window = Window_PlayTime.new
  283.     @playtime_window.x = 0
  284.     @playtime_window.y = 366
  285.     # Make steps window
  286.     @steps_window = Window_Steps.new
  287.     @steps_window.x = 0
  288.     @steps_window.y = 270
  289.     # Crear ventana de lugares
  290.     # Make gold window
  291.     @gold_window = Window_Gold.new
  292.     @gold_window.x = 0
  293.     @gold_window.y = 416
  294.     # Make status window
  295.     @status_window = Window_MenuStatus.new
  296.     @status_window.x = 160
  297.     @status_window.y = 0
  298.    
  299.    
  300.    else
  301.     # Make command window
  302.     s1 = $data_system.words.item
  303.     s2 = $data_system.words.skill
  304.     s3 = $data_system.words.equip
  305.     s4 = Wep::Main_menu_status_text
  306.     s5 = Wep::Main_menu_save_text
  307.     s6 = Wep::Main_menu_quit_text
  308.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
  309.     @command_window.index = @menu_index
  310.     # If number of party members is 0
  311.     if $game_party.actors.size == 0
  312.       # Disable items, skills, equipment, and status
  313.       @command_window.disable_item(0)
  314.       @command_window.disable_item(1)
  315.       @command_window.disable_item(2)
  316.       @command_window.disable_item(3)
  317.     end
  318.     # If save is forbidden
  319.     if $game_system.save_disabled
  320.       # Disable save
  321.       @command_window.disable_item(4)
  322.     end
  323.     # Make play time window
  324.     @playtime_window = Window_PlayTime.new
  325.     @playtime_window.x = 0
  326.     @playtime_window.y = 224
  327.     # Make steps window
  328.     @steps_window = Window_Steps.new
  329.     @steps_window.x = 0
  330.     @steps_window.y = 320
  331.     # Make gold window
  332.     @gold_window = Window_Gold.new
  333.     @gold_window.x = 0
  334.     @gold_window.y = 416
  335.     # Make status window
  336.     @status_window = Window_MenuStatus.new
  337.     @status_window.x = 160
  338.     @status_window.y = 0
  339.    
  340.    
  341.    end
  342.     # Execute transition
  343.     Graphics.transition
  344.     # Main loop
  345.     loop do
  346.       # Update game screen
  347.       Graphics.update
  348.       # Update input information
  349.       Input.update
  350.       # Frame update
  351.       update
  352.       # Abort loop if screen is changed
  353.       if $scene != self
  354.         break
  355.       end
  356.     end
  357.     # Prepare for transition
  358.     Graphics.freeze
  359.     # Dispose of windows
  360.     @command_window.dispose
  361.     @playtime_window.dispose
  362.     @steps_window.dispose
  363.     @gold_window.dispose
  364.     @status_window.dispose
  365.     @warning_window.dispose
  366.   end
  367.   #--------------------------------------------------------------------------
  368.   # * Frame Update
  369.   #--------------------------------------------------------------------------
  370.   def update
  371.     # Update windows
  372.     @command_window.update
  373.     @playtime_window.update
  374.     @steps_window.update
  375.     @gold_window.update
  376.     @status_window.update
  377.     @warning_window.update
  378.     # If warning message active
  379.     if @warning_message_active
  380.       update_advertencia
  381.       return
  382.     end
  383.     # If command window is active: call update_command
  384.     if @command_window.active
  385.       update_command
  386.       return
  387.     end
  388.     # If status window is active: call update_status
  389.     if @status_window.active
  390.       update_status
  391.       return
  392.     end
  393.   end
  394.   #--------------------------------------------------------------------------
  395.   # * Frame Update (Advertencia)
  396.   #--------------------------------------------------------------------------
  397.   def update_advertencia
  398.     # If any key is press, exit game checking for after quicksyve stle
  399.     if Input.trigger?(Input::B) or Input.trigger?(Input::C) or Input.trigger?(Input::Z) or Input.trigger?(Input::B)
  400.         if not Wep::One_slot_mode_quicksaving
  401.           if Wep::After_quicksave == 0
  402.             # End game
  403.             Audio.bgm_fade(800)
  404.             Audio.bgs_fade(800)
  405.             Audio.me_fade(800)
  406.             $scene = nil
  407.           elsif Wep::After_quicksave == 1
  408.             # To title
  409.             $scene = Scene_Title.new
  410.           end
  411.         else
  412.            if Wep::After_quicksaving == 0
  413.             # End game
  414.             Audio.bgm_fade(800)
  415.             Audio.bgs_fade(800)
  416.             Audio.me_fade(800)
  417.             $scene = nil
  418.           elsif Wep::After_quicksaving == 1
  419.             # To title
  420.             $scene = Scene_Title.new
  421.           end
  422.  
  423.         end
  424.     return
  425.     end
  426.   end
  427.   #--------------------------------------------------------------------------
  428.   # * Frame Update (when command window is active)
  429.   #--------------------------------------------------------------------------
  430.   def update_command
  431.     # If B button was pressed
  432.     if Input.trigger?(Input::B)
  433.       # Play cancel SE
  434.       $game_system.se_play($data_system.cancel_se)
  435.       # Switch to map screen
  436.       $scene = Scene_Map.new
  437.       return
  438.     end
  439.     # If C button was pressed
  440.     if Input.trigger?(Input::C)
  441.       # If command other than save or end game, and party members = 0
  442.       if $game_party.actors.size == 0 and @command_window.index < 4
  443.         # Play buzzer SE
  444.         $game_system.se_play($data_system.buzzer_se)
  445.         return
  446.       end
  447.       # Branch by command window cursor position
  448.       case @command_window.index
  449.       when 0  # item
  450.         # Play decision SE
  451.         $game_system.se_play($data_system.decision_se)
  452.         # Switch to item screen
  453.         $scene = Scene_Item.new
  454.       when 1  # skill
  455.         # Play decision SE
  456.         $game_system.se_play($data_system.decision_se)
  457.         # Make status window active
  458.         @command_window.active = false
  459.         @status_window.active = true
  460.         @status_window.index = 0
  461.       when 2  # equipment
  462.         # Play decision SE
  463.         $game_system.se_play($data_system.decision_se)
  464.         # Make status window active
  465.         @command_window.active = false
  466.         @status_window.active = true
  467.         @status_window.index = 0
  468.       when 3  # status
  469.         # Play decision SE
  470.         $game_system.se_play($data_system.decision_se)
  471.         # Make status window active
  472.         @command_window.active = false
  473.         @status_window.active = true
  474.         @status_window.index = 0
  475.        
  476.       when 4  # save
  477.         # If its one slot mode save directly in selected slot
  478.       if Wep::One_slot_mode
  479.           # If saving is forbidden
  480.           if $game_system.save_disabled
  481.             # Play buzzer SE
  482.             $game_system.se_play($data_system.buzzer_se)
  483.             return
  484.           end
  485.           # Play decision SE
  486.           $game_system.se_play($data_system.decision_se)
  487.          
  488.           slot = Wep::One_slot_mode_slot
  489.           guard_rap = false
  490.           temp = Scene_Save.new
  491.           file = File.open(Wep::Save_folder+"\\"+Wep::File_name+slot.to_s+Wep::Saves_extension, "wb")
  492.           temp.write_save_data(file, guard_rap)
  493.           file.close
  494.  
  495.         # If its one slot quicksaving mode save directly in selected slot and exit
  496.       elsif Wep::One_slot_mode_quicksaving
  497.          
  498.          
  499.         # If saving is forbidden
  500.         if $game_system.save_disabled
  501.           # Play buzzer SE
  502.           $game_system.se_play($data_system.buzzer_se)
  503.           return
  504.         end
  505.        
  506.         # Play decision SE
  507.         $game_system.se_play($data_system.decision_se)
  508.         $game_system.se_play($data_system.save_se)
  509.        
  510.         $game_system.save_slot(Wep::One_slot_mode_slot)
  511.        
  512.         if Wep::Quicksaving_warning_message
  513.           @warning_message_active = true
  514.           @command_window.active = false
  515.           @warning_window.visible
  516.          
  517.           @warning_window.refresh(Wep::Warning_message_one_slot_text, question=false, Wep::Warning_message_position[0], Wep::Warning_message_position[1])      
  518.         else
  519.           if Wep::After_quicksaving == 0
  520.             # Termina el programa
  521.             Audio.bgm_fade(800)
  522.             Audio.bgs_fade(800)
  523.             Audio.me_fade(800)
  524.             $scene = nil
  525.           elsif Wep::After_quicksaving == 1
  526.             # Vuelve al titulo
  527.             $scene = Scene_Title.new
  528.           end
  529.         end
  530.        
  531.         # Normal save
  532.       else
  533.           # If saving is forbidden
  534.           if $game_system.save_disabled
  535.             # Play buzzer SE
  536.             $game_system.se_play($data_system.buzzer_se)
  537.             return
  538.           end
  539.           # Play decision SE
  540.           $game_system.se_play($data_system.decision_se)
  541.        
  542.           # Switch to save screen
  543.           $scene = Scene_Save.new
  544.       end
  545.        
  546.       when 5 # quicksave or end
  547.        # Depending on menu configuration
  548.        if Wep::Main_menu_quicksave and Wep::Quicksave and not Wep::One_slot_mode_quicksaving
  549.         # If quick saving is forbidden
  550.        if $game_system.disabled_quicksave != nil
  551.         if $game_system.disabled_quicksave
  552.           # Play buzzer SE
  553.           $game_system.se_play($data_system.buzzer_se)
  554.           return
  555.         end
  556.        end
  557.         # Play decision SE
  558.         $game_system.se_play($data_system.decision_se)
  559.         $game_system.map_quicksave
  560.         $game_system.se_play($data_system.save_se)
  561.         if Wep::Quicksave_warning_message and Wep::Quicksave
  562.           @warning_message_active = true
  563.           @command_window.active = false
  564.           @warning_window.visible
  565.           @warning_window.refresh(Wep::Warning_message_text, question=false, Wep::Warning_message_position[0], Wep::Warning_message_position[1])        
  566.         else
  567.           if Wep::After_quicksave == 0
  568.             # Termina el programa
  569.             Audio.bgm_fade(800)
  570.             Audio.bgs_fade(800)
  571.             Audio.me_fade(800)
  572.             $scene = nil
  573.           elsif Wep::After_quicksave == 1
  574.             # Vuelve al titulo
  575.             $scene = Scene_Title.new
  576.  
  577.            
  578.           end  
  579.         end
  580.        
  581.        
  582.       else
  583.         # Play decision SE
  584.         $game_system.se_play($data_system.decision_se)
  585.         # Switch to end game screen
  586.         $scene = Scene_End.new
  587.      
  588.        
  589.       end
  590.      
  591.      
  592.       when 6 # end game in quicksave mode
  593.         # Play decision SE
  594.         $game_system.se_play($data_system.decision_se)
  595.         # Switch to end game screen
  596.         $scene = Scene_End.new
  597.       end
  598.       return
  599.     end
  600.   end
  601.  
  602. end
  603.  
  604.  
  605. end
  606.  
  607.  
  608. class Game_System
  609.     attr_accessor :disabled_quicksave    
  610.     attr_accessor :disabled_autosave  
  611.     attr_accessor :save_description
  612.     attr_accessor :autosave_count
  613.     attr_accessor :autosave_running
  614.    alias old_initialize initialize
  615.    def initialize
  616.      @disabled_autosave = false
  617.      @disabled_quicksave = false
  618.      @save_description =  "Chapter I"
  619.      @autosave_count = Wep::Autosave_time
  620.      @autosave_running = Wep::Autosave && Wep::Autosave_type == 0 ? true : false
  621.      old_initialize
  622.    end
  623.    
  624.   #--------------------------------------------------------------------------
  625.   # * Autosave count restart
  626.   #--------------------------------------------------------------------------
  627.   def restart_auto_save_count
  628.       # Restart timer
  629.       @autosave_count = Wep::Autosave_time
  630.   end
  631.  
  632.   #--------------------------------------------------------------------------
  633.   # * Autosave check
  634.   #--------------------------------------------------------------------------
  635.  
  636.   def auto_save_update  
  637.     # Reduces time if enabled
  638.     if Wep::Autosave_type == 0 and @autosave_count > 0 and @autosave_running and not @disabled_autosave
  639.       @autosave_count -= 1
  640.     end
  641.     if Wep::Autosave_type == 0 and @autosave_count == 0 and @autosave_running
  642.       # Check for save
  643.       map_autosave
  644.       # Inform player
  645.       $game_switches[Wep::Switch_info] = true
  646.       # Restart timer
  647.       @autosave_count = Wep::Autosave_time
  648.     end
  649.   end
  650.  
  651.   #--------------------------------------------------------------------------
  652.   # * Update timer. Modded: Also updates autosave timer.
  653.   #--------------------------------------------------------------------------
  654.   def update
  655.    
  656.     if @timer_working and @timer > 0
  657.       @timer -= 1
  658.     end
  659.     auto_save_update
  660.   end
  661.  
  662. end
  663.  
  664. class Game_System
  665.   #--------------------------------------------------------------------------
  666.   # * Map autosave
  667.   #--------------------------------------------------------------------------
  668.   def map_autosave
  669.         temp = Scene_Save.new
  670.         file = File.open(Wep::Save_folder+"\\"+Wep::File_name+(Wep::Autosave_slot).to_s+Wep::Saves_extension, "wb")
  671.         temp.write_save_data(file)
  672.         file.close
  673.   end  
  674.  
  675.   #--------------------------------------------------------------------------
  676.   # * Map quicksave
  677.   #--------------------------------------------------------------------------  
  678.   def map_quicksave
  679.         temp = Scene_Save.new
  680.         file = File.open(Wep::Save_folder + "\\" + Wep::File_name + Wep::Quicksave_slot.to_s + Wep::Saves_extension, "wb")
  681.         temp.write_save_data(file)
  682.         file.close
  683.   end
  684.      
  685.   #--------------------------------------------------------------------------
  686.   # * Load slot
  687.   #--------------------------------------------------------------------------
  688.   def load_slot(slot)
  689.     $scene = Transfer_Scene.new(slot)
  690.   end  
  691.  
  692.   #--------------------------------------------------------------------------
  693.   # * Save slot
  694.   #--------------------------------------------------------------------------  
  695.   def save_slot(slot)
  696.         temp = Scene_Save.new
  697.         file = File.open(Wep::Save_folder+"\\"+Wep::File_name+slot.to_s+Wep::Saves_extension, "wb")
  698.         temp.write_save_data(file)
  699.         file.close
  700.   end    
  701.      
  702.   #--------------------------------------------------------------------------
  703.   # * Erase slot
  704.   #--------------------------------------------------------------------------
  705.   def erase_slot(slot)
  706.     if FileTest.exist?( Wep::Save_folder+ "\\"+ Wep::File_name + slot.to_s + Wep::Saves_extension)
  707.       File.delete( Wep::Save_folder+ "\\"+ Wep::File_name + slot.to_s + Wep::Saves_extension)
  708.     end
  709.   end
  710.  
  711.   #--------------------------------------------------------------------------
  712.   # * Slot exist?
  713.   #--------------------------------------------------------------------------
  714.   def slot_exist(slot)
  715.     if FileTest.exist?( Wep::Save_folder+ "\\"+ Wep::File_name + slot.to_s + Wep::Saves_extension)
  716.        $game_switches[Wep::Sw_file_exist] = true
  717.        return true
  718.      else
  719.        return false
  720.     end
  721.   end
  722.  
  723.   #--------------------------------------------------------------------------
  724.   # * Slot info
  725.   #--------------------------------------------------------------------------
  726.   def slot_info(slot)
  727.      if FileTest.exist?( Wep::Save_folder+ "\\"+ Wep::File_name + slot.to_s + Wep::Saves_extension)    
  728.         file = File.open( Wep::Save_folder+ "\\"+ Wep::File_name + slot.to_s + Wep::Saves_extension, "r")
  729.         timestamp = file.mtime
  730.         characters = Marshal.load(file)
  731.         guard_rap = Marshal.load(file)
  732.         psj = Marshal.load(file)
  733.         dinero = Marshal.load(file)
  734.         frame_count = Marshal.load(file)
  735.         game_system = Marshal.load(file)
  736.         game_switches = Marshal.load(file)
  737.         game_variables = Marshal.load(file)
  738.         game_self_switches = Marshal.load(file)
  739.         game_screen = Marshal.load(file)
  740.         game_actors = Marshal.load(file)
  741.         game_party = Marshal.load(file)
  742.         total_sec = frame_count / Graphics.frame_rate
  743.         file.close
  744.         i=0
  745.        
  746.         # Actors levels and ids
  747.         for actor in game_party.actors
  748.           $game_variables[Wep::Vars_actors_ids[i]] = actor.id      
  749.           $game_variables[Wep::Vars_actors_levels[i]] = actor.level    
  750.           i+=1
  751.         end
  752.         # Date
  753.         $game_variables[Wep::Vars_date[0]] = timestamp.year
  754.         $game_variables[Wep::Vars_date[1]] = timestamp.month
  755.         $game_variables[Wep::Vars_date[2]] = timestamp.day
  756.         $game_variables[Wep::Vars_date[3]] = timestamp.hour
  757.         $game_variables[Wep::Vars_date[4]] = timestamp.min
  758.         $game_variables[Wep::Vars_date[5]] = timestamp.sec
  759.         # Time
  760.         hour = total_sec / 60 / 60
  761.         min = total_sec / 60 % 60
  762.         sec = total_sec % 60
  763.         $game_variables[Wep::Vars_time[0]] = hour
  764.         $game_variables[Wep::Vars_time[1]] = min
  765.         $game_variables[Wep::Vars_time[2]] = sec
  766.         # Gold and steps
  767.         $game_variables[Wep::Vars_money] = game_party.gold
  768.         $game_variables[Wep::Vars_steps] = game_party.steps
  769.         return true
  770.     end  
  771.   end
  772. end
  773.  
  774.  
  775.  
  776. #================================================================="=============
  777. # ** Transfer_Scene
  778. #------------------------------------------------------------------------------
  779. #  This scene is used as an intermediate scene to load games
  780. #  slot: slot to load
  781. #==============================================================================
  782.  
  783. class Transfer_Scene
  784.   def initialize(slot)
  785.     @slot = slot
  786.   end
  787.  
  788.   def main
  789.  
  790.   # Normal load process
  791.    
  792.   file = File.open(Wep::Save_folder+ "\\"+ Wep::File_name+ @slot.to_s + Wep::Saves_extension, "rb")
  793.  
  794.   # One sp/hp
  795.   onehp = Marshal.load(file)
  796.   onesp = Marshal.load(file)
  797.   # Description
  798.   description = Marshal.load(file)
  799.   # % completed game
  800.   comp = Marshal.load(file)
  801.   # Map
  802.   map = Marshal.load(file)
  803.   # Steps
  804.   steps = Marshal.load(file)
  805.  
  806.   # Make medium levels for ordering save file
  807.   medium_level=Marshal.load(file)
  808.  
  809.   # Read character data for drawing save file
  810.   characters = Marshal.load(file)
  811.   # Cargar personajes
  812.   @psj = Marshal.load(file)
  813.   # Cargar dinero
  814.   @dinero = Marshal.load(file)
  815.   # Read frame count for measuring play time
  816.   Graphics.frame_count = Marshal.load(file)
  817.   # Read each type of game object
  818.   $game_system = Marshal.load(file)
  819.   $game_switches = Marshal.load(file)
  820.   $game_variables = Marshal.load(file)
  821.   $game_self_switches = Marshal.load(file)
  822.   $game_screen = Marshal.load(file)
  823.   $game_actors = Marshal.load(file)
  824.   $game_party = Marshal.load(file)
  825.   $game_troop = Marshal.load(file)
  826.   $game_map = Marshal.load(file)
  827.   $game_player = Marshal.load(file)
  828.  
  829.   $game_temp = Game_Temp.new
  830.   $game_system.bgm_stop
  831.  
  832.   # If magic number is different from when saving
  833.   # (if editing was added with editor)
  834.   if $game_system.magic_number != $data_system.magic_number
  835.     # Load map
  836.     $game_map.setup($game_map.map_id)
  837.     $game_player.center($game_player.x, $game_player.y)
  838.   end
  839.   # Refresh party members
  840.   $game_party.refresh
  841.  
  842.   file.close
  843.  
  844.   # Check to erase save slots with some modes
  845.   if Wep::Quicksave and @slot == Wep::Quicksave_slot
  846.       $game_system.erase_slot(Wep::Quicksave_slot)
  847.   end
  848.   if Wep::One_slot_mode_quicksaving  and @slot == Wep::One_slot_mode_slot
  849.       $game_system.erase_slot(Wep::One_slot_mode_slot)
  850.   end
  851.   # Switch to map screen
  852.     $scene = Scene_Map.new
  853.   end
  854. end
  855.  
  856.  
  857. #================================================================="=============
  858. # ** Window_HelpSave
  859. #------------------------------------------------------------------------------
  860. #  Modified to that can be configurated by the player
  861. #==============================================================================
  862.  
  863. class Window_HelpSave < Window_Help
  864.   #--------------------------------------------------------------------------
  865.   # * Object Initialization
  866.   #--------------------------------------------------------------------------
  867.   def initialize
  868.     super
  869.     self.contents = Bitmap.new(width - 32, height - 32)
  870.     self.opacity = Wep::Help_windows_opacity
  871.     self.back_opacity = Wep::Help_windows_back_opacity
  872.     if Wep::Help_window_font_name != ""
  873.       self.contents.font.name = Wep::Help_window_font_name
  874.     end
  875.   end
  876. end
  877.  
  878. #================================================================="=============
  879. # ** Slot_Window
  880. #------------------------------------------------------------------------------
  881. #  This a window+sprite combined class. It enables to use very small
  882. #  windows.
  883. #  i: position multiplier
  884. #==============================================================================
  885.  
  886.  
  887. class Slot_Window
  888.   def initialize(i)
  889.     # Back window
  890.     @ventana = Window_Base.new(0,104*i+64, 100,24)
  891.     @ventana.visible = true
  892.     @ventana.z = 249
  893.     # Text sprite
  894.     @sprite = Sprite.new
  895.     @sprite.bitmap = Bitmap.new(@ventana.width, @ventana.height)
  896.     @sprite.bitmap.font.size = 14
  897.     # Font setting
  898.     if Wep::Slot_window_font_name != ""
  899.       @sprite.bitmap.font.name = Wep::Slot_window_font_name
  900.     end
  901.     @sprite.z = 250
  902.     @sprite.x = 0
  903.     @sprite.y = 104*i+64
  904.     @sprite.visible = true
  905.   end  
  906.  
  907.   # Draw the text
  908.   def refresh(text)
  909.     @ventana.update
  910.     @sprite.bitmap.clear
  911.     # Font setting
  912.     @sprite.bitmap.font.color = Wep::Basic_color
  913.     @sprite.bitmap.draw_text(0,-2,@ventana.width,32, text.to_s, 1)
  914.   end
  915.  
  916.   # Dispose all
  917.   def dispose
  918.     @ventana.dispose
  919.     @sprite.dispose
  920.   end
  921. end
  922.  
  923.  
  924. #==============================================================================
  925. # ** Scene_File
  926. #------------------------------------------------------------------------------
  927. #  This is a superclass for the save screen and load screen.
  928. #==============================================================================
  929.  
  930. class Scene_File
  931.   #--------------------------------------------------------------------------
  932.   # * Object Initialization
  933.   #     help_text : text string shown in the help window
  934.   #     type : true=save false=load scene
  935.   #--------------------------------------------------------------------------
  936.   def initialize(help_text, file_index, tipo)
  937.  
  938.     @help_text = help_text
  939.     @file_index = file_index
  940.     @type = tipo
  941.  
  942.     # Create Folder for Save file
  943.     if Wep::Save_folder  != ""
  944.       Dir.mkdir(Wep::Save_folder) if !FileTest.directory?(Wep::Save_folder)
  945.     end
  946.   end
  947.  
  948.   #--------------------------------------------------------------------------
  949.   # * Main Processing
  950.   #--------------------------------------------------------------------------
  951.   def main
  952.     # If quicksave and it must load it...
  953.     # Make help window
  954.     @help_window = Window_HelpSave.new
  955.     @help_window.set_text(@help_text)
  956.     @help_window.visible = Wep::Help_window_visible
  957.    
  958.     # Background sprite
  959.     @backgrounds = Sprite.new
  960.     @backgrounds.bitmap = Bitmap.new(640,480)
  961.     @backgrounds.z = 1
  962.     @backgrounds.visible = true
  963.     # Faces sprite
  964.     @faces = Sprite.new
  965.     @faces.bitmap = Bitmap.new(640,480)
  966.     @faces.z = 101
  967.     @faces.visible = true
  968.    
  969.     # Check and load Scene background
  970.     if Wep::Scene_background != ""
  971.       bitmap = RPG::Cache.picture(Wep::Scene_background)
  972.       @backgrounds.bitmap.blt(0, 0, bitmap, Rect.new(0, 0, 640, 480), 255)
  973.     end
  974.     # Check and load Help background
  975.     if Wep::Help_window_background != ""
  976.       bitmap = RPG::Cache.picture(Wep::Help_window_background)
  977.       @backgrounds.bitmap.blt(0, 0, bitmap, Rect.new(0, 0, 640, 64), 255)
  978.     end
  979.     # Check and load Save background
  980.     if Wep::Save_windows_background != ""
  981.       for i in 0...3
  982.         bitmap = RPG::Cache.picture(Wep::Save_windows_background)
  983.         @backgrounds.bitmap.blt(0, 64 + i % 4 * 104, bitmap, Rect.new(0, 0, 640, 104), 255)
  984.       end
  985.     end
  986.    
  987.  
  988.    
  989.     # Make array of save slots info
  990.     @save_slots = []
  991.     for i in 0...Wep::Max_slots
  992.       # Check if exist and put base info and ordered one
  993.       if FileTest.exist?(make_filename(i))
  994.         file = File.open(make_filename(i), "r")  
  995.         # One sp/hp
  996.         onehp = Marshal.load(file)
  997.         onesp = Marshal.load(file)
  998.         # Description
  999.         description = Marshal.load(file)
  1000.         # % completed game
  1001.         comp = Marshal.load(file)
  1002.         # Map
  1003.         map = Marshal.load(file)
  1004.         # Steps
  1005.         steps = Marshal.load(file)
  1006.  
  1007.         # Make medium levels for ordering save file
  1008.         medium_level=Marshal.load(file)
  1009.  
  1010.         # Read character data for drawing save file
  1011.         characters = Marshal.load(file)
  1012.         # Cargar personajes
  1013.         psj = Marshal.load(file)
  1014.         # Cargar dinero
  1015.         dinero = Marshal.load(file)
  1016.         # Read frame count for measuring play time
  1017.         frame_count = Marshal.load(file)
  1018.         time_stamp = file.mtime
  1019.         total_sec = frame_count / Graphics.frame_rate
  1020.         file.close  
  1021.         @save_slots[i] = file_index=i, time_stamp, frame_count, medium_level
  1022.       else
  1023.         @save_slots[i] = [file_index=i]
  1024.       end
  1025.     end
  1026.    
  1027.     @file_index = 2
  1028.  
  1029.     # Make save file and slots windows
  1030.     @savefile_windows = []
  1031.     @slot_windows = []
  1032.    
  1033.     for i in 0..3
  1034.       @savefile_windows.push(Window_SaveFile.new(i))
  1035.       @slot_windows.push(Slot_Window.new(i))
  1036.     end
  1037.         # Refresh the windows
  1038.         for i in 0..3
  1039.           # Checks if its beyond the limit
  1040.           if i+@file_index > Wep::Max_slots-1
  1041.             @savefile_windows[i].refresh(@save_slots[Wep::Max_slots-i][0])
  1042.             @slot_windows[i].refresh(Wep::Slot+(@save_slots[Wep::Max_slots-i][0]+1).to_s)
  1043.             if Wep::Quicksave and Wep::Max_slots-i == Wep::Quicksave_slot-1
  1044.               @slot_windows[i].refresh(Wep::Quicksave_slot_text)
  1045.             end  
  1046.             if Wep::Autosave and Wep::Max_slots-i == Wep::Autosave_slot-1
  1047.               @slot_windows[i].refresh(Wep::Autosave_slot_text)
  1048.             end  
  1049.           else
  1050.             @savefile_windows[i].refresh(@save_slots[@file_index+i-2][0])
  1051.             @slot_windows[i].refresh(Wep::Slot+(@save_slots[@file_index+i-2][0]+1).to_s)
  1052.             if Wep::Quicksave and @file_index+i-2 == Wep::Quicksave_slot-1
  1053.               @slot_windows[i].refresh(Wep::Quicksave_slot_text)
  1054.             end  
  1055.             if Wep::Autosave and @file_index+i-2 == Wep::Autosave_slot-1
  1056.               @slot_windows[i].refresh(Wep::Autosave_slot_text)
  1057.             end  
  1058.           end  
  1059.         end
  1060.          # Select slot 2
  1061.          @savefile_windows[@file_index].selected = true
  1062.          # Draw faces if enabled
  1063.          if Wep::Show_faces or Wep::Quick_actors_info.include?('face')
  1064.            if not Wep::Quick_actors_info
  1065.             draw_faces
  1066.           end
  1067.          end
  1068.  
  1069.     @file_index = 0
  1070.    
  1071.    
  1072.     # Execute transition
  1073.     Graphics.transition
  1074.     # Main loop
  1075.     loop do
  1076.       # Update game screen
  1077.       Graphics.update
  1078.       # Update input information
  1079.       Input.update
  1080.       # Frame update
  1081.       update
  1082.       # Abort loop if screen is changed
  1083.       if $scene != self
  1084.         break
  1085.       end
  1086.     end
  1087.     # Prepare for transition
  1088.     Graphics.freeze
  1089.     # Dispose of windows
  1090.     @help_window.dispose
  1091.     for i in @savefile_windows
  1092.       i.dispose
  1093.     end
  1094.     @backgrounds.dispose
  1095.     @faces.dispose
  1096.     for i in 0..3
  1097.       @slot_windows[i].dispose
  1098.     end
  1099.  
  1100.   end
  1101.  
  1102.   #--------------------------------------------------------------------------
  1103.   # * Frame Update
  1104.   #--------------------------------------------------------------------------
  1105.   def update
  1106.     # Update windows
  1107.     @help_window.update
  1108.     @backgrounds.update
  1109.    
  1110.     for i in @savefile_windows
  1111.       i.update
  1112.     end
  1113.    
  1114.     # If C button was pressed
  1115.     if Input.trigger?(Input::C)
  1116.      
  1117.       # Check that it isnt in autosave or quicksave protected slots
  1118.         if Wep::Quicksave and @type and @save_slots[@file_index+2][0] == 0 and Wep::Quicksave_sep_slot
  1119.           # Play cursor SE
  1120.           $game_system.se_play($data_system.buzzer_se)
  1121.           return
  1122.         end
  1123.         if Wep::Autosave and @type  and @save_slots[@file_index+2][0] == 1 and Wep::Autosave_sep_slot
  1124.            # Play cursor SE
  1125.             $game_system.se_play($data_system.buzzer_se)
  1126.           return
  1127.         end
  1128.  
  1129.       # Call method: on_decision (defined by the subclasses)
  1130.       on_decision(make_filename(@save_slots[@file_index+2][0]))
  1131.      
  1132.       if Wep::Quicksave and Wep::Quicksave_slot == @save_slots[@file_index+2][0] and @type == false
  1133.         $game_system.erase_slot(Wep::Quicksave_slot)
  1134.       end
  1135.  
  1136.       $game_temp.last_file_index = @file_index
  1137.       return
  1138.     end
  1139.    
  1140.    
  1141.     # If B button was pressed
  1142.     if Input.trigger?(Input::B)
  1143.       # Call method: on_cancel (defined by the subclasses)
  1144.       on_cancel
  1145.       return
  1146.     end
  1147.    
  1148.     # If the down directional button was pressed
  1149.     if Input.repeat?(Input::DOWN)
  1150.       # If the down directional button pressed down is not a repeat,
  1151.       # or cursor position is more in front than 3
  1152.       if Input.trigger?(Input::DOWN)
  1153.        
  1154.         # Check and correct list limit
  1155.         if  @file_index+1 > Wep::Max_slots-1-2
  1156.           # Play cursor SE
  1157.           $game_system.se_play($data_system.buzzer_se)
  1158.           return
  1159.         end
  1160.         #p @file_index
  1161.         # Play cursor SE
  1162.         $game_system.se_play($data_system.cursor_se)
  1163.         # Move cursor down
  1164.         @file_index +=1
  1165.         # Refresh the widows
  1166.         for i in 0..3
  1167.            # Checks if its beyond the limit
  1168.            if @file_index+i > Wep::Max_slots-1
  1169.             @savefile_windows[i].refresh(1001)
  1170.             @slot_windows[i].refresh(Wep::Slot_dont_exist)
  1171.           else                
  1172.             @savefile_windows[i].refresh(@save_slots[@file_index+i][0])
  1173.             @slot_windows[i].refresh(Wep::Slot+(@save_slots[@file_index+i][0]+1).to_s)
  1174.             if Wep::Quicksave and @file_index+i == Wep::Quicksave_slot-1
  1175.               @slot_windows[i].refresh(Wep::Quicksave_slot_text)
  1176.             end
  1177.             if Wep::Autosave and @file_index+i == Wep::Autosave_slot-1
  1178.               @slot_windows[i].refresh(Wep::Autosave_slot_text)
  1179.             end              
  1180.            end
  1181.          end
  1182.          # Draw faces if enabled
  1183.          if Wep::Show_faces or Wep::Quick_actors_info.include?('face')
  1184.            if not Wep::Quick_actors_info
  1185.             draw_faces
  1186.           end
  1187.          end
  1188.          return  
  1189.        end
  1190.     end
  1191.    
  1192.    
  1193.    
  1194.    
  1195.     # If the up directional button was pressed
  1196.     if Input.repeat?(Input::UP)
  1197.       # If the up directional button pressed down is not a repeat、
  1198.       # or cursor position is more in back than 0
  1199.       if Input.trigger?(Input::UP)
  1200.        
  1201.         # # Check and correct list limit
  1202.         if  @file_index-1 < 0-2
  1203.             # Play cursor SE
  1204.             $game_system.se_play($data_system.buzzer_se)
  1205.           return
  1206.         end
  1207.        
  1208.         # Play cursor SE
  1209.         $game_system.se_play($data_system.cursor_se)
  1210.         # Move cursor up
  1211.         @file_index -=1
  1212.         # Refresh the widows
  1213.         for i in 0..3
  1214.            # Checks if its beyond the limit
  1215.            if @file_index+i < 0
  1216.             @savefile_windows[i].refresh(1001)
  1217.             @slot_windows[i].refresh(Wep::Slot_dont_exist)
  1218.            else    
  1219.             @savefile_windows[i].refresh(@save_slots[@file_index+i][0])
  1220.             @slot_windows[i].refresh(Wep::Slot+(@save_slots[@file_index+i][0]+1).to_s)
  1221.             if Wep::Quicksave and @file_index+i == Wep::Quicksave_slot-1
  1222.               @slot_windows[i].refresh(Wep::Quicksave_slot_text)
  1223.             end
  1224.             if Wep::Autosave and @file_index+i == Wep::Autosave_slot-1
  1225.               @slot_windows[i].refresh(Wep::Autosave_slot_text)
  1226.             end
  1227.            end  
  1228.          end
  1229.          # Draw faces if enabled
  1230.          if Wep::Show_faces or Wep::Quick_actors_info.include?('face')
  1231.            if not Wep::Quick_actors_info
  1232.             draw_faces
  1233.           end
  1234.          end
  1235.          return
  1236.       end
  1237.     end
  1238.    
  1239.   end
  1240.  
  1241.  
  1242.   #--------------------------------------------------------------------------
  1243.   # * Draw Faces
  1244.   #--------------------------------------------------------------------------
  1245.   def draw_faces
  1246.   # Clear bitmap each time
  1247.   @faces.bitmap.clear
  1248.    for i in 0..3
  1249.       # If the window dont have actors info skip it
  1250.       next if @savefile_windows[i].psj == nil
  1251.       # Draw the faces
  1252.       for j in 0...@savefile_windows[i].psj.size
  1253.         bitmap = RPG::Cache.picture('Saveface_'+@savefile_windows[i].psj[j].name+'.png')
  1254.         cw = bitmap.rect.width
  1255.         ch = bitmap.rect.height
  1256.         src_rect = Rect.new(0, 0, cw, ch)
  1257.         # Quick config option
  1258.         if not Wep::Quick_actors_info
  1259.           @faces.bitmap.blt(Wep::Face_position[0]+Wep::Face_separation*j, Wep::Face_position[1] + i % 4 * 104, bitmap, Rect.new(0, 0, 640, 104), Wep::Face_transparency)
  1260.         else
  1261.           @faces.bitmap.blt(0+Wep::Face_separation*j, 68 + i % 4 * 104, bitmap, Rect.new(0, 0, 640, 104), Wep::Face_transparency)
  1262.         end
  1263.       end  
  1264.    end
  1265.   end
  1266.  
  1267.   #--------------------------------------------------------------------------
  1268.   # * Make File Name
  1269.   #     file_index : save file index (0-3)
  1270.   #--------------------------------------------------------------------------
  1271.   def make_filename(file_index)
  1272.     return Wep::Save_folder+"\\"+Wep::File_name+ "#{file_index + 1}"+Wep::Saves_extension
  1273.   end
  1274. end
  1275.  
  1276. #==============================================================================
  1277. # ** Scene_Load
  1278. #------------------------------------------------------------------------------
  1279. # This class performs load screen processing.
  1280. #==============================================================================
  1281.  
  1282. class Scene_Load < Scene_File
  1283. #--------------------------------------------------------------------------
  1284. # * Object Initialization
  1285. #--------------------------------------------------------------------------
  1286. def initialize(de_mapa=false)
  1287.  
  1288.   @de_mapa = de_mapa
  1289.   # Remake temporary object
  1290.   $game_temp = Game_Temp.new
  1291.   # Timestamp selects new file
  1292.   $game_temp.last_file_index = 0
  1293.   latest_time = Time.at(0)
  1294.   for i in 0...Wep::Max_slots
  1295.     filename = make_filename(i)
  1296.       if FileTest.exist?(filename)
  1297.         file = File.open(filename, "r")
  1298.           if file.mtime > latest_time
  1299.             latest_time = file.mtime
  1300.             $game_temp.last_file_index = i
  1301.           end
  1302.         file.close
  1303.       end
  1304.     end
  1305.   super(Wep::Load_description_text, @file_index = 0, @tipo = false)
  1306. end
  1307.  
  1308. #--------------------------------------------------------------------------
  1309. # * Decision Processing
  1310. #--------------------------------------------------------------------------
  1311. def on_decision(filename)
  1312.   # If file doesn't exist
  1313.   unless FileTest.exist?(filename)
  1314.     # Play buzzer SE
  1315.     $game_system.se_play($data_system.buzzer_se)
  1316.     return
  1317.   end
  1318.   # Play load SE
  1319.   $game_system.se_play($data_system.load_se)
  1320.   # Read save data
  1321.   file = File.open(filename, "rb")
  1322.   read_save_data(file)
  1323.  
  1324.   file.close
  1325.  
  1326.   # Restore BGM and BGS
  1327.   $game_system.bgm_play($game_system.playing_bgm)
  1328.   $game_system.bgs_play($game_system.playing_bgs)
  1329.  
  1330.   # Update map (run parallel process event)
  1331.   $game_map.update
  1332.  
  1333.   # Switch to map screen
  1334.   $scene = Scene_Map.new
  1335.  
  1336. end
  1337. #--------------------------------------------------------------------------
  1338. # * Cancel Processing
  1339. #--------------------------------------------------------------------------
  1340. def on_cancel
  1341.   # Play cancel SE
  1342.   $game_system.se_play($data_system.cancel_se)
  1343.   if not @de_mapa
  1344.     # Switch to title screen
  1345.     $scene = Scene_Title.new
  1346.   else
  1347.     $scene = Scene_Map.new
  1348.   end
  1349. end
  1350.  
  1351.  
  1352. #--------------------------------------------------------------------------
  1353. # * Read Save Data
  1354. # file : file object for reading (opened)
  1355. #--------------------------------------------------------------------------
  1356. def read_save_data(file)
  1357.    
  1358.   # One sp/hp
  1359.   onehp = Marshal.load(file)
  1360.   onesp = Marshal.load(file)
  1361.   # Description
  1362.   description = Marshal.load(file)
  1363.   # % completed game
  1364.   comp = Marshal.load(file)
  1365.   # Map
  1366.   map = Marshal.load(file)
  1367.   # Steps
  1368.   steps = Marshal.load(file)
  1369.  
  1370.   # Make medium levels for ordering save file
  1371.   medium_level=Marshal.load(file)
  1372.  
  1373.   # Read character data for drawing save file
  1374.   characters = Marshal.load(file)
  1375.   # Cargar personajes
  1376.   @psj = Marshal.load(file)
  1377.   # Cargar dinero
  1378.   @dinero = Marshal.load(file)
  1379.   # Read frame count for measuring play time
  1380.   Graphics.frame_count = Marshal.load(file)
  1381.   # Read each type of game object
  1382.   $game_system = Marshal.load(file)
  1383.   $game_switches = Marshal.load(file)
  1384.   $game_variables = Marshal.load(file)
  1385.   $game_self_switches = Marshal.load(file)
  1386.   $game_screen = Marshal.load(file)
  1387.   $game_actors = Marshal.load(file)
  1388.   $game_party = Marshal.load(file)
  1389.   $game_troop = Marshal.load(file)
  1390.   $game_map = Marshal.load(file)
  1391.   $game_player = Marshal.load(file)
  1392.  
  1393.   # If magic number is different from when saving
  1394.   # (if editing was added with editor)
  1395.   if $game_system.magic_number != $data_system.magic_number
  1396.     # Load map
  1397.     $game_map.setup($game_map.map_id)
  1398.     $game_player.center($game_player.x, $game_player.y)
  1399.   end
  1400.   # Refresh party members
  1401.   $game_party.refresh
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407. end
  1408. end
  1409.  
  1410.  
  1411. #==============================================================================
  1412. # ** Scene_Save
  1413. #------------------------------------------------------------------------------
  1414. # This class performs save screen processing.
  1415. #==============================================================================
  1416.  
  1417. class Scene_Save < Scene_File
  1418. #--------------------------------------------------------------------------
  1419. # * Object Initialization
  1420. #--------------------------------------------------------------------------
  1421.   def initialize
  1422.     super(Wep::Save_description_text, @file_index = 1, @tipo = true)
  1423.   end
  1424. #--------------------------------------------------------------------------
  1425. # * Decision Processing
  1426. #--------------------------------------------------------------------------
  1427.   def on_decision(filename)
  1428.   # Play save SE
  1429.   $game_system.se_play($data_system.save_se)
  1430.   # Write save data
  1431.     file = File.open(filename, "wb")
  1432.     write_save_data(file)
  1433.     file.close
  1434.   # If called from event
  1435.   if $game_temp.save_calling
  1436.     # Clear save call flag
  1437.     $game_temp.save_calling = false
  1438.     # Switch to map screen
  1439.     $scene = Scene_Map.new
  1440.     return
  1441.   end
  1442.   # Switch to menu screen
  1443.   $scene = Scene_Menu.new(4)
  1444. end
  1445. #--------------------------------------------------------------------------
  1446. # * Cancel Processing
  1447. #--------------------------------------------------------------------------
  1448. def on_cancel
  1449.   # Play cancel SE
  1450.   $game_system.se_play($data_system.cancel_se)
  1451.   # If called from event
  1452.   if $game_temp.save_calling
  1453.     # Clear save call flag
  1454.     $game_temp.save_calling = false
  1455.     # Switch to map screen
  1456.     $scene = Scene_Map.new
  1457.     return
  1458.   end
  1459.   # Switch to menu screen
  1460.   $scene = Scene_Menu.new(4)
  1461. end
  1462.  
  1463. #--------------------------------------------------------------------------
  1464. # * Write Save Data
  1465. # file : write file object (opened)
  1466. #--------------------------------------------------------------------------
  1467. def write_save_data(file)
  1468.  
  1469.   one_pv = $game_party.actors[0].hp, $game_party.actors[0].maxhp
  1470.  
  1471.   one_sp = $game_party.actors[0].sp, $game_party.actors[0].maxsp
  1472.  
  1473.   # One actor mode info
  1474.  
  1475.   Marshal.dump(one_pv, file)
  1476.   Marshal.dump(one_sp, file)
  1477.  
  1478.   # Description
  1479.   if $game_system.save_description == nil
  1480.       Marshal.dump("", file)
  1481.   else
  1482.     description = $game_system.save_description
  1483.     Marshal.dump(description, file)
  1484.   end
  1485.   # % completed game
  1486.   comp = $game_variables[Wep::Variable_completed_game]
  1487.   Marshal.dump(comp, file)
  1488.   # Map
  1489.   map = $game_map.map_id
  1490.   Marshal.dump(map, file)
  1491.   # Steps
  1492.   steps = $game_party.steps
  1493.   Marshal.dump(steps, file)
  1494.   # Make medium levels for ordering save file
  1495.   medium_level=0
  1496.  
  1497.   for i in 0...$game_party.actors.size
  1498.     medium_level += $game_party.actors[i].level
  1499.   end
  1500.   medium_level/=$game_party.actors.size
  1501.  
  1502.   Marshal.dump(medium_level, file)
  1503.   # Make character data for drawing save file
  1504.   characters = []
  1505.   for i in 0...$game_party.actors.size
  1506.     actor = $game_party.actors[i]
  1507.     characters.push([actor.character_name, actor.character_hue])
  1508.   end
  1509.  
  1510.   # Write character data for drawing save file
  1511.   Marshal.dump(characters, file)
  1512.   # Preparar archivo de personajes
  1513.   psj = []
  1514.   for i in 0...$game_party.actors.size
  1515.   wep = $game_party.actors[i].id
  1516.   psj[i] = $game_actors[wep]
  1517.   end
  1518.   # Guardar archivo de personajes
  1519.   Marshal.dump(psj, file)
  1520.   # Preparar dinero
  1521.   dinero = $game_party.gold
  1522.  # Guardar archivo de dinero
  1523.   Marshal.dump(dinero, file)
  1524.   # Wrire frame count for measuring play time
  1525.   Marshal.dump(Graphics.frame_count, file)
  1526.   # Increase save count by 1
  1527.   $game_system.save_count += 1
  1528.   # Save magic number
  1529.   # (A random value will be written each time saving with editor)
  1530.   $game_system.magic_number = $data_system.magic_number
  1531.   # Write each type of game object
  1532.   Marshal.dump($game_system, file)
  1533.   Marshal.dump($game_switches, file)
  1534.   Marshal.dump($game_variables, file)
  1535.   Marshal.dump($game_self_switches, file)
  1536.   Marshal.dump($game_screen, file)
  1537.   Marshal.dump($game_actors, file)
  1538.   Marshal.dump($game_party, file)
  1539.   Marshal.dump($game_troop, file)
  1540.   Marshal.dump($game_map, file)
  1541.   Marshal.dump($game_player, file)
  1542.  
  1543. end
  1544. end
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550. #==============================================================================
  1551. # ** Window_SaveFile
  1552. #------------------------------------------------------------------------------
  1553. # This window displays save files on the save and load screens.
  1554. #==============================================================================
  1555.  
  1556. class Window_SaveFile < Window_Base
  1557. #--------------------------------------------------------------------------
  1558. # * Public Instance Variables
  1559. #--------------------------------------------------------------------------
  1560. attr_reader :filename # file name
  1561. attr_reader :selected # selected
  1562. attr_reader :file_index
  1563. attr_reader :exist
  1564. attr_reader :psj      # Actors info for drawing faces
  1565. #--------------------------------------------------------------------------
  1566. # * Object Initialization
  1567. # file_index : save file index (0-3)
  1568. # filename : file name
  1569. #--------------------------------------------------------------------------
  1570. def initialize(i)
  1571.   super(0, 64 + i % 4 * 104, Wep::Save_windows_size[0], Wep::Save_windows_size[1])
  1572.   self.contents = Bitmap.new(width - 32, height - 32)
  1573.   self.opacity = Wep::Save_windows_opacity
  1574.   self.back_opacity = Wep::Save_windows_back_opacity
  1575.   @selected = false
  1576.   @position = i
  1577.   @psj = nil
  1578. end
  1579.  
  1580. #--------------------------------------------------------------------------
  1581. # * Refresh
  1582. #--------------------------------------------------------------------------
  1583. def refresh(file_index)
  1584.   self.contents = Bitmap.new(width - 32, height - 32)
  1585.   # Font setting
  1586.   if Wep::Save_window_font_name != ""
  1587.     self.contents.font.name = Wep::Save_window_font_name
  1588.   end
  1589.   # Open and check file
  1590.   if file_index != nil
  1591.    
  1592.     filename = Wep::Save_folder+"\\"+Wep::File_name+ "#{file_index + 1}"+Wep::Saves_extension
  1593.     file_exist = FileTest.exist?(filename)
  1594.   else
  1595.     file_exist = false
  1596.     @psj= nil
  1597.   end
  1598.  
  1599.   # If file exist
  1600.   if file_exist
  1601.   # Make normal load
  1602.   file = File.open(filename, "r")
  1603.        
  1604.   # One sp/hp
  1605.   onehp = Marshal.load(file)
  1606.   onesp = Marshal.load(file)
  1607.   # Description
  1608.   description = Marshal.load(file)
  1609.   # % completed game
  1610.   comp = Marshal.load(file)
  1611.   # Map
  1612.   map = Marshal.load(file)
  1613.   # Steps
  1614.   steps = Marshal.load(file)
  1615.  
  1616.   # Make medium levels for ordering save file
  1617.   medium_level=Marshal.load(file)
  1618.  
  1619.   # Read character data for drawing save file
  1620.   @characters = Marshal.load(file)
  1621.  
  1622.   # Cargar personajes
  1623.   @psj = Marshal.load(file)
  1624.  
  1625.   # Cargar dinero
  1626.   @dinero = Marshal.load(file)
  1627.   # Read frame count for measuring play time
  1628.   @frame_count = Marshal.load(file)
  1629.    
  1630.   @time_stamp = file.mtime
  1631.   @total_sec = @frame_count / Graphics.frame_rate
  1632.   file.close
  1633.  
  1634.     # Testing bitmap
  1635.     tb = Bitmap.new(1,1)
  1636.     # Check for newbie option
  1637.     if Wep::Quick_actors_info
  1638.       self.contents.font.size = 22
  1639.  
  1640.      # Quick actors info with graphics
  1641.      if Wep::Quick_actors_info.include?('graphic')
  1642.      
  1643.       for i in [email hidden]
  1644.       if Wep::Quick_actors_info.include?('graphic')
  1645.         bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
  1646.         cw = bitmap.rect.width / 4
  1647.         ch = bitmap.rect.height / 4
  1648.         src_rect = Rect.new(0, 0, cw, ch)
  1649.         x = 160- @characters.size * 34 + i * 105 - cw / 2
  1650.         self.contents.blt(x, 54 - ch, bitmap, src_rect)
  1651.       end
  1652.         if Wep::Quick_actors_info.include?('name')
  1653.           self.contents.draw_text(i*108, 48, Wep::Save_windows_size[0]-32, 32, @psj[i].name)
  1654.         end
  1655.  
  1656.        if Wep::Quick_actors_info.include?('level')
  1657.         rect = tb.text_size(Wep::Level_text)
  1658.         self.contents.font.color = Wep::Description_color
  1659.         self.contents.font.bold = Wep::Description_bold
  1660.         self.contents.draw_text(i*108, 30, Wep::Save_windows_size[0]-32, 32, Wep::Level_text)
  1661.         self.contents.font.color = Wep::Basic_color
  1662.         self.contents.font.bold = false
  1663.         self.contents.draw_text(i*108+rect.width, 30, Wep::Save_windows_size[0]-32, 32, @psj[i].level.to_s)
  1664.  
  1665.        end
  1666.    
  1667.  
  1668.      end
  1669.      
  1670.      
  1671.     # Quick actors info with faces
  1672.     else  
  1673.        for i in [email hidden]
  1674.         if Wep::Quick_actors_info.include?('name')
  1675.           self.contents.draw_text(i*108, 48, Wep::Save_windows_size[0]-32, 32, @psj[i].name)
  1676.         end
  1677.  
  1678.        if Wep::Quick_actors_info.include?('level')
  1679.         rect = tb.text_size(Wep::Level_text)
  1680.         self.contents.font.color = Wep::Description_color
  1681.         self.contents.font.bold = Wep::Description_bold
  1682.         self.contents.draw_text(i*108, 30, Wep::Save_windows_size[0]-32, 32, Wep::Level_text)
  1683.         self.contents.font.color = Wep::Basic_color
  1684.         self.contents.font.bold = false
  1685.         self.contents.draw_text(i*108+rect.width, 30, Wep::Save_windows_size[0]-32, 32, @psj[i].level.to_s)
  1686.  
  1687.        end
  1688.  
  1689.        if Wep::Quick_actors_info.include?('graphic')
  1690.         bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
  1691.         cw = bitmap.rect.width / 4
  1692.         ch = bitmap.rect.height / 4
  1693.         src_rect = Rect.new(0, 0, cw, ch)
  1694.         x = Wep::Graphic_position[0] - @characters.size * 32 + i * 64 - cw / 2
  1695.         self.contents.blt(x, Wep::Graphic_position[1] - ch, bitmap, src_rect)
  1696.        end
  1697.    
  1698.      end
  1699.  
  1700.      
  1701.    end
  1702.    
  1703.       # Quick actors info without graphic or face
  1704.       if not Wep::Quick_actors_info.include?('face') and not Wep::Quick_actors_info.include?('graphic')
  1705.         if Wep::Quick_actors_info.include?('name')
  1706.           self.contents.draw_text(i*Wep::Name_position[0], Wep::Name_position[1], Wep::Save_windows_size[0], 32, @psj[i].name)
  1707.         end
  1708.  
  1709.        if Wep::Quick_actors_info.include?('level')
  1710.         rect = tb.text_size(Wep::Level_text)        
  1711.         self.contents.font.color = Wep::Description_color
  1712.         self.contents.font.bold = Wep::Description_bold
  1713.         self.contents.draw_text(i*108, 30, Wep::Save_windows_size[0]-32, 32, Wep::Level_text)
  1714.         self.contents.font.color = Wep::Basic_color
  1715.         self.contents.font.bold = false
  1716.         self.contents.draw_text(i*108+rect.width, 30, Wep::Save_windows_size[0]-32, 32, @psj[i].level.to_s)
  1717.  
  1718.        end
  1719.      end
  1720.     end
  1721.    
  1722.     # Check for newbie option
  1723.     if Wep::Quick_general_info
  1724.       self.contents.font.size = 22
  1725.       i=0
  1726.        for option in Wep::Quick_general_info
  1727.          # The y is manually defined for each postion
  1728.          if i == 0
  1729.            y = -9
  1730.          elsif i == 1
  1731.            y = 11
  1732.          elsif i == 2
  1733.            y = 30
  1734.          elsif i == 3
  1735.            y = 46
  1736.          end
  1737.          
  1738.          if option == 'time'
  1739.             hour = @total_sec / 60 / 60
  1740.             min = @total_sec / 60 % 60
  1741.             sec = @total_sec % 60
  1742.             time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  1743.             self.contents.font.color = normal_color
  1744.             self.contents.draw_text(0, y, Wep::Save_windows_size[0]-32, 32, time_string, 2)
  1745.  
  1746.          elsif option == 'map_description'
  1747.            for group in Wep::Map_descriptions
  1748.  
  1749.              if group == Wep::Map_descriptions[0]
  1750.                next
  1751.              end
  1752.               if group[0].include?(map)
  1753.                   map_description = group[1]
  1754.               end
  1755.             end
  1756.             map_description = Wep::Map_descriptions[0] if map_description == nil
  1757.            self.contents.draw_text(0, y, Wep::Save_windows_size[0]-32, 32,  map_description, 2)
  1758.  
  1759.          elsif option == 'description'
  1760.              self.contents.draw_text(0, y, Wep::Save_windows_size[0]-32, 32, description, 2)
  1761.          
  1762.          elsif option == 'steps'
  1763.              
  1764.              rect = tb.text_size(steps.to_s)
  1765.              self.contents.draw_text(0, y, Wep::Save_windows_size[0]-32, 32, steps.to_s, 2)
  1766.              self.contents.font.color = Wep::Description_color
  1767.              self.contents.font.bold = Wep::Description_bold
  1768.              self.contents.draw_text(0-rect.width, y, Wep::Save_windows_size[0]-32, 32, Wep::Steps_text, 2)
  1769.              self.contents.font.color = Wep::Basic_color
  1770.              self.contents.font.bold = false
  1771.  
  1772.          elsif option == 'money'
  1773.              rect = tb.text_size(dinero.to_s)
  1774.              self.contents.draw_text(0, y, Wep::Save_windows_size[0]-32, 32, @dinero.to_s, 2)
  1775.              self.contents.font.color = Wep::Description_color
  1776.              self.contents.font.bold = Wep::Description_bold
  1777.              self.contents.draw_text(0-rect.width, y, Wep::Save_windows_size[0]-32, 32, Wep::Money_text, 2)
  1778.              self.contents.font.color = Wep::Basic_color
  1779.              self.contents.font.bold = false
  1780.  
  1781.  
  1782.          elsif option == 'map_name'
  1783.              # Load mapinfo for map name
  1784.              mapinfos = load_data("Data/MapInfos.rxdata")
  1785.              self.contents.draw_text(0, y, Wep::Save_windows_size[0]-32, 32, mapinfos[map].name, 2)
  1786.        
  1787.          elsif option == 'completed_game'
  1788.              rect = tb.text_size(comp.to_s+"%")
  1789.              self.contents.draw_text(0, y, Wep::Save_windows_size[0]-32, 32, comp.to_s+"%", 2)
  1790.              self.contents.font.color = Wep::Description_color
  1791.              self.contents.font.bold = Wep::Description_bold
  1792.              self.contents.draw_text(0-rect.width, y, Wep::Save_windows_size[0]-32, 32, Wep::Completed_game_text, 2)
  1793.              self.contents.font.color = Wep::Basic_color
  1794.              self.contents.font.bold = false
  1795.              
  1796.          elsif option == 'date'
  1797.              time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
  1798.              self.contents.draw_text(0, y, Wep::Save_windows_size[0]-32, 32, time_string, 2)
  1799.          end
  1800.          
  1801.          i+=1
  1802.        end
  1803.        
  1804.     end
  1805.    
  1806.    
  1807.     # Advanced settings
  1808.    
  1809.     # Font setting
  1810.     if not Wep::Quick_actors_info
  1811.       self.contents.font.size = Wep::Actors_info_font_size
  1812.     end
  1813.     for i in [email hidden]
  1814.      
  1815.      # Draw names
  1816.      if Wep::Show_name and not Wep::Quick_actors_info
  1817.       self.contents.draw_text(i*Wep::Name_position[0], Wep::Name_position[1], Wep::Save_windows_size[0], 32, @psj[i].name)
  1818.     end
  1819.     # Draw level
  1820.      if Wep::Show_level and not Wep::Quick_actors_info
  1821.         rect = tb.text_size(Wep::Level_text)
  1822.         self.contents.font.color = Wep::Description_color
  1823.         self.contents.font.bold = Wep::Description_bold
  1824.         self.contents.draw_text(i*Wep::Level_position[0], Wep::Level_position[1], Wep::Save_windows_size[0]-32, 32, Wep::Level_text)
  1825.         self.contents.font.color = Wep::Basic_color
  1826.         self.contents.font.bold = false
  1827.         self.contents.draw_text(i*Wep::Level_position[0]+rect.width, Wep::Level_position[1], Wep::Save_windows_size[0]-32, 32, @psj[i].level.to_s)
  1828.      end
  1829.      
  1830.      # Draw graphic
  1831.      if Wep::Show_graphic and not Wep::Quick_actors_info
  1832.       bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
  1833.       cw = bitmap.rect.width / 4
  1834.       ch = bitmap.rect.height / 4
  1835.       src_rect = Rect.new(0, 0, cw, ch)
  1836.       x = Wep::Graphic_position[0] - @characters.size * 32 + i * 64 - cw / 2
  1837.       self.contents.blt(x, Wep::Graphic_position[1] - ch, bitmap, src_rect)
  1838.     end
  1839.    
  1840.   end
  1841.  
  1842.   # General info
  1843.  
  1844.     if not Wep::Quick_general_info
  1845.       self.contents.font.size = Wep::General_info_font_size
  1846.     end
  1847.    
  1848.   # Draw time
  1849.   if Wep::Show_time and not Wep::Quick_general_info
  1850.     hour = @total_sec / 60 / 60
  1851.     min = @total_sec / 60 % 60
  1852.     sec = @total_sec % 60
  1853.     time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  1854.     self.contents.font.color = normal_color
  1855.     self.contents.draw_text(Wep::Time_position[0], Wep::Time_position[1], Wep::Save_windows_size[0], 32, time_string, 2)
  1856.   end
  1857.  
  1858.  # Draw money
  1859.  if Wep::Show_money and not Wep::Quick_general_info
  1860.     rect = tb.text_size(dinero.to_s)
  1861.     self.contents.draw_text(Wep::Gold_position[0], Wep::Gold_position[1], Wep::Save_windows_size[0]-32, 32, @dinero.to_s, 2)
  1862.     self.contents.font.color = Wep::Description_color
  1863.     self.contents.font.bold = Wep::Description_bold
  1864.     self.contents.draw_text(Wep::Gold_position[0]-rect.width, Wep::Gold_position[1], Wep::Save_windows_size[0]-32, 32, Wep::Money_text, 2)
  1865.     self.contents.font.color = Wep::Basic_color
  1866.     self.contents.font.bold = false
  1867.  end
  1868.  
  1869.  # Draw map name
  1870.  if Wep::Show_map_name and not Wep::Quick_general_info
  1871.     # Load mapinfo for map name
  1872.     mapinfos = load_data("Data/MapInfos.rxdata")
  1873.     self.contents.draw_text(Wep::Map_name_position[0], Wep::Map_name_position[1], Wep::Save_windows_size[0]-32, 32, mapinfos[map].name, 2)
  1874.   end
  1875.  
  1876.   # Draw map description
  1877.   if Wep::Show_map_description and not Wep::Quick_general_info
  1878.            for group in Wep::Map_descriptions
  1879.  
  1880.              if group == Wep::Map_descriptions[0]
  1881.                next
  1882.              end
  1883.               if group[0].include?(map)
  1884.                   map_description = group[1]
  1885.               end
  1886.             end
  1887.             map_description = Wep::Map_descriptions[0] if map_description == nil
  1888.  
  1889.     self.contents.draw_text(Wep::Map_description_position[0], Wep::Map_description_position[1], Wep::Save_windows_size[0], 32,  map_description, 2)
  1890.   end
  1891.  
  1892.   # Draw description
  1893.    if Wep::Show_description and not Wep::Quick_general_info
  1894.     self.contents.draw_text(Wep::Description_position[0], Wep::Description_position[1], Wep::Save_windows_size[0]-32, 32, description, 2)
  1895.   end
  1896.  
  1897.   # Draw steps
  1898.    if Wep::Show_steps and not Wep::Quick_general_info
  1899.       rect = tb.text_size(steps.to_s)
  1900.       self.contents.draw_text(Wep::Steps_position[0], Wep::Steps_position[1], Wep::Save_windows_size[0]-32, 32, steps.to_s, 2)
  1901.       self.contents.font.color = Wep::Description_color
  1902.       self.contents.font.bold = Wep::Description_bold
  1903.       self.contents.draw_text(Wep::Steps_position[0]-rect.width, Wep::Steps_position[1], Wep::Save_windows_size[0]-32, 32, Wep::Steps_text, 2)
  1904.       self.contents.font.color = Wep::Basic_color
  1905.       self.contents.font.bold = false
  1906.     end
  1907.    
  1908.     # Draw completed game
  1909.    if Wep::Show_completed_game and not Wep::Quick_general_info
  1910.       rect = tb.text_size(comp.to_s+"%")
  1911.       self.contents.draw_text(Wep::Completed_game_position[0], Wep::Completed_game_position[1], Wep::Save_windows_size[0]-32, 32, comp.to_s+"%", 2)
  1912.       self.contents.font.color = Wep::Description_color
  1913.       self.contents.font.bold = Wep::Description_bold
  1914.       self.contents.draw_text(Wep::Completed_game_position[0]-rect.width, Wep::Completed_game_position[1], Wep::Save_windows_size[0]-32, 32, Wep::Completed_game_text, 2)
  1915.       self.contents.font.color = Wep::Basic_color
  1916.       self.contents.font.bold = false
  1917.    end
  1918.  
  1919.  
  1920.   # Draw date
  1921.  if Wep::Show_date and not Wep::Quick_general_info
  1922.   time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
  1923.   self.contents.draw_text(Wep::Date_position[0], Wep::Date_position[1], Wep::Save_windows_size[0], 32, time_string, 2)
  1924.  end
  1925.  
  1926. else
  1927.   # If the file didnt exist, make psj nil and draw empty slot text
  1928.   if file_exist == false
  1929.  
  1930.     @psj= nil
  1931.     if file_index == Wep::Quicksave_slot-1 and  Wep::Quicksave
  1932.       name = Wep::Empty_quicksave_slot_text
  1933.     elsif file_index == Wep::Autosave_slot-1 and  Wep::Autosave
  1934.       name = Wep::Empty_autosave_slot_text
  1935.     else
  1936.       name = Wep::Empty_slot
  1937.     end
  1938.     @name_width = contents.text_size(name).width
  1939.     self.contents.draw_text(Wep::Identifier_text_position[0],Wep::Identifier_text_position[1], Wep::Save_windows_size[0], 32, name)
  1940.   end
  1941. end
  1942.  
  1943.  
  1944. end
  1945. #--------------------------------------------------------------------------
  1946. # * Set Selected
  1947. # selected : new selected (true = selected, false = unselected)
  1948. #--------------------------------------------------------------------------
  1949. def selected=(selected)
  1950.   @selected = selected
  1951.   update_cursor_rect
  1952. end
  1953.  
  1954.  
  1955. #--------------------------------------------------------------------------
  1956. # * Cursor Rectangle Update
  1957. #--------------------------------------------------------------------------
  1958. def update_cursor_rect
  1959. if @selected
  1960.  
  1961. self.cursor_rect.set(-14, -14, 640, 128)
  1962.  
  1963. else
  1964. self.cursor_rect.empty
  1965. end
  1966. end
  1967. end
  1968.  
  1969.  
  1970.  
  1971.  
  1972. #--------------------------------------------------------------------------
  1973. # * Compatibility check: Scene title modification
  1974. #--------------------------------------------------------------------------
  1975. if Wep::Title_modification
  1976.  
  1977.  
  1978. #==============================================================================
  1979. # ** Scene_Title
  1980. #------------------------------------------------------------------------------
  1981. #  This class performs title screen processing.
  1982. #==============================================================================
  1983.  
  1984. class Scene_Title
  1985.   #--------------------------------------------------------------------------
  1986.   # * Main Processing
  1987.   #--------------------------------------------------------------------------
  1988.   def main
  1989.     # If battle test
  1990.     if $BTEST
  1991.       battle_test
  1992.       return
  1993.     end
  1994.     # Load database
  1995.     $data_actors        = load_data("Data/Actors.rxdata")
  1996.     $data_classes       = load_data("Data/Classes.rxdata")
  1997.     $data_skills        = load_data("Data/Skills.rxdata")
  1998.     $data_items         = load_data("Data/Items.rxdata")
  1999.     $data_weapons       = load_data("Data/Weapons.rxdata")
  2000.     $data_armors        = load_data("Data/Armors.rxdata")
  2001.     $data_enemies       = load_data("Data/Enemies.rxdata")
  2002.     $data_troops        = load_data("Data/Troops.rxdata")
  2003.     $data_states        = load_data("Data/States.rxdata")
  2004.     $data_animations    = load_data("Data/Animations.rxdata")
  2005.     $data_tilesets      = load_data("Data/Tilesets.rxdata")
  2006.     $data_common_events = load_data("Data/CommonEvents.rxdata")
  2007.     $data_system        = load_data("Data/System.rxdata")
  2008.    
  2009.  
  2010.     # Make system object
  2011.     $game_system = Game_System.new
  2012.     # Make title graphic
  2013.     @sprite = Sprite.new
  2014.     @sprite.bitmap = RPG::Cache.title($data_system.title_name)
  2015.     # Make command window
  2016.     s1 = Wep::New_game_text
  2017.     s2 = Wep::Load_game_text
  2018.     # Changue Title syntax if quickload enabled
  2019.     if Wep::Must_load and Wep::Quicksave
  2020.        if FileTest.exist?(Wep::Save_folder+ "\\"+ Wep::File_name+ Wep::Quicksave_slot.to_s + Wep::Saves_extension)
  2021.          s2 = Wep::Title_quickload
  2022.        end
  2023.     end  
  2024.     s3 = Wep::Quit_game_text
  2025.    
  2026.     @command_window = Window_Command.new(192, [s1, s2, s3])
  2027.     @command_window.back_opacity = 160
  2028.     @command_window.x = 320 - @command_window.width / 2
  2029.     @command_window.y = 288
  2030.    
  2031.     # Continue enabled determinant
  2032.     # Check if at least one save file exists
  2033.     # If enabled, make @continue_enabled true; if disabled, make it false
  2034.     @continue_enabled = false
  2035.    
  2036.     # Check for one slot slots if one slot modes are active
  2037.     if Wep::One_slot_mode or Wep::One_slot_mode_quicksaving
  2038.       @continue_enabled = FileTest.exist?(Wep::Save_folder+ "\\"+ Wep::File_name+ Wep::One_slot_mode_slot.to_s + Wep::Saves_extension)
  2039.     else
  2040.       for i in 0...Wep::Max_slots
  2041.         if FileTest.exist?(Wep::Save_folder+"\\"+Wep::File_name+ "#{i + 1}"+Wep::Saves_extension)
  2042.           @continue_enabled = true
  2043.         end
  2044.       end
  2045.     end
  2046.    
  2047.     # If continue is enabled, move cursor to "Continue"
  2048.     # If disabled, display "Continue" text in gray
  2049.     if @continue_enabled
  2050.       @command_window.index = 1
  2051.     else
  2052.       @command_window.disable_item(1)
  2053.     end
  2054.     # Play title BGM
  2055.     $game_system.bgm_play($data_system.title_bgm)
  2056.     # Stop playing ME and BGS
  2057.     Audio.me_stop
  2058.     Audio.bgs_stop
  2059.     # Execute transition
  2060.     Graphics.transition
  2061.     # Main loop
  2062.     loop do
  2063.       # Update game screen
  2064.       Graphics.update
  2065.       # Update input information
  2066.       Input.update
  2067.       # Frame update
  2068.       update
  2069.       # Abort loop if screen is changed
  2070.       if $scene != self
  2071.         break
  2072.       end
  2073.     end
  2074.     # Prepare for transition
  2075.     Graphics.freeze
  2076.     # Dispose of command window
  2077.     @command_window.dispose
  2078.     # Dispose of title graphic
  2079.     @sprite.bitmap.dispose
  2080.     @sprite.dispose
  2081.   end
  2082.  
  2083.   #--------------------------------------------------------------------------
  2084.   # * Command: Continue
  2085.   #--------------------------------------------------------------------------
  2086.   def command_continue
  2087.     # If continue is disabled
  2088.     unless @continue_enabled
  2089.       # Play buzzer SE
  2090.       $game_system.se_play($data_system.buzzer_se)
  2091.       return
  2092.     end
  2093.    
  2094.     # Play decision SE
  2095.     $game_system.se_play($data_system.decision_se)
  2096.    
  2097.    # If must load quicksave
  2098.    if Wep::Must_load and Wep::Quicksave and FileTest.exist?(Wep::Save_folder+ "\\"+ Wep::File_name+ Wep::Quicksave_slot.to_s + Wep::Saves_extension)
  2099.       $game_system.load_slot(Wep::Quicksave_slot)
  2100.       return
  2101.    end
  2102.  
  2103.     # If its in one slot mode: NO ANIRA, HA DE CARREGAR
  2104.     if Wep::One_slot_mode and FileTest.exist?(Wep::Save_folder+ "\\"+ Wep::File_name+ Wep::One_slot_mode_slot.to_s + Wep::Saves_extension)
  2105.       $game_system.load_slot(Wep::One_slot_mode_slot)
  2106.       return
  2107.     end
  2108.    
  2109.     # If its in one slot quicksavig mode
  2110.     if Wep::One_slot_mode_quicksaving and FileTest.exist?(Wep::Save_folder+ "\\"+ Wep::File_name+ Wep::One_slot_mode_slot.to_s + Wep::Saves_extension)
  2111.       $game_system.load_slot(Wep::One_slot_mode_slot)
  2112.       return
  2113.      
  2114.     end
  2115.  
  2116.     # Normal switch to load screen
  2117.     $scene = Scene_Load.new
  2118.   end
  2119. end
  2120.  
  2121.  
  2122. end
Expand to see the code.
I cant believe no one has replied to this yet this is a very impressive saving system. Does this have the ability to quick save using the script funcion in the event?
RMXPirate wrote:
I cant believe no one has replied to this yet this is a very impressive saving system. Does this have the ability to quick save using the script funcion in the event?


Yes. And autosave too. You have a total event save control.
you were right ,this is great 🙂
does it have a script(in game) for auto load(the auto save)?
ill test it after back from my trip :shades:
i wanna make mini game that lets you auto save and then if it fail it auto load (save the trouble of going to load menu and so on ) 😀
Quote:

you were right ,this is great 🙂
does it have a script(in game) for auto load(the auto save)?
ill test it after back from my trip :shades:
i wanna make mini game that lets you auto save and then if it fail it auto load (save the trouble of going to load menu and so on ) 😀


Yes. You can do that manually using the script functions i created to control save with events. Exactly, load and save slot. And after de minigame erase the savegame using the erase function(so it dont show in the save menu).

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=72769