gerkrt

Improved Save CONFIG

Sep 14th, 2011
678
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 19.66 KB | None | 0 0
  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, my love--> 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
Advertisement
Add Comment
Please, Sign In to add comment