Benji Grand prophète
Nombre de messages : 62 Age : 33 Date d'inscription : 24/06/2007
Fueille de participation Niveau: 2 points d'Exp: (50/150)
| Sujet: Charger une partie en cour de jeu. Mar 26 Juin - 18:08 | |
| Nom : Scene_Load2 Effet(s) sur le jeu : Ce script va permettre au joueur de charger une partie en cours de jeu. Screen : Pas de screen. Mettez-le en dessous du script Scene_Load Code: - Code:
-
#============================================================================== # ¦ Scene_Load2 #------------------------------------------------------------------------------ # ????????????????? #==============================================================================
class Scene_Load2 < Scene_File #-------------------------------------------------------------------------- # ? ????????? #-------------------------------------------------------------------------- def initialize # ??????????????? $game_temp = Game_Temp.new # ?????????????????? $game_temp.last_file_index = 0 latest_time = Time.at(0) for i in 0..3 filename = make_filename(i) if FileTest.exist?(filename) file = File.open(filename, "r") if file.mtime > latest_time latest_time = file.mtime $game_temp.last_file_index = i end file.close end end super("Charger quelle partie?") end #-------------------------------------------------------------------------- # ? ?????? #-------------------------------------------------------------------------- def on_decision(filename) # ???????????? unless FileTest.exist?(filename) # ??? SE ??? $game_system.se_play($data_system.buzzer_se) return end # ??? SE ??? $game_system.se_play($data_system.load_se) # ??????????? file = File.open(filename, "rb") read_save_data(file) file.close # BGM?BGS ??? $game_system.bgm_play($game_system.playing_bgm) $game_system.bgs_play($game_system.playing_bgs) # ?????? (????????) $game_map.update # ?????????? $scene = Scene_Map.new end #-------------------------------------------------------------------------- # ? ????????? #-------------------------------------------------------------------------- def on_cancel # ????? SE ??? $game_system.se_play($data_system.cancel_se) # ??????????? $scene = Scene_Menu.new end #-------------------------------------------------------------------------- # ? ??????????? # file : ??????????????? (??????) #-------------------------------------------------------------------------- def read_save_data(file) # ????????????????????????? characters = Marshal.load(file) # ?????????????????????? Graphics.frame_count = Marshal.load(file) # ???????????????? $game_system = Marshal.load(file) $game_switches = Marshal.load(file) $game_variables = Marshal.load(file) $game_self_switches = Marshal.load(file) $game_screen = Marshal.load(file) $game_actors = Marshal.load(file) $game_party = Marshal.load(file) $game_troop = Marshal.load(file) $game_map = Marshal.load(file) $game_player = Marshal.load(file) # ??????????????????? # (?????????????????) if $game_system.magic_number != $data_system.magic_number # ???????? $game_map.setup($game_map.map_id) $game_player.center($game_player.x, $game_player.y) end # ??????????????? $game_party.refresh end end
Ensuite allez dans Scène_Menu et remplacez : Code: - Code:
-
s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "État" s5 = "Sauvegarder" s6 = "Quitter" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6]) @command_window.index = @menu_index
PAR
Code: s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "État" s5 = "Sauvegarder" s6 = "Quitter" s7 = "Charger" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6,s7]) @command_window.index = @menu_index
Et à la suite du texte : Code: - Code:
-
when 5 # ????? # ?? SE ??? $game_system.se_play($data_system.decision_se) # ???????????? $scene = Scene_End.new
ajoutez :
Code: when 6 # ????? # ?? SE ??? $game_system.se_play($data_system.decision_se) # ???????????? $scene = Scene_Load2.new | |
|