site consacré a vos création.
 
AccueilFAQRechercherS'enregistrerMembresGroupesConnexion

Partagez | 
 

 New Game +

Aller en bas 
AuteurMessage
Lloyd
Prophete
Prophete
avatar

Nombre de messages : 81
Date d'inscription : 24/06/2007

Fueille de participation
Niveau: 2
points d'Exp:
90/150  (90/150)

MessageSujet: New Game +   Lun 25 Juin - 22:56

Voilà un script super bien qui vous met un new game +, ça sert à recommencer le jeu avec un perso qui l'a deja fini:

Créez un nouveau script se nommant " Scene_New_Game_Plus " au dessus du script " Main " dans l'éditeur de script et collez ceci :

Code:
#==============================================================================
# ¦ Scene_New_Game_Plus
# This purpose of this class is to allow the player to restart the game using saved characters if
# they have completed the game with that party.
#---------------------------------------------------------------------------------------------------------------------------------------------
# A new feature (small one) was added by myself (Dubealex) to enable a
# count of the number of times you finished the game.
# Copy the lines between my comments and paste them in your original script,
# or simply use that full one.

class Scene_New_Game_Plus<Scene_Load
#--------------------------------------------------------------------
def initialize
#You need to add the following line:
@game_completion_count=0
#ENd of the line to copy.
$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
@help_text="Quelle aventure voudriez-vous recommencer"
end

#-----------------------------------------------------------------------------
#This method checks to see if the selected game file has completed the game.
# (A completed game is indicated by turning switch 1 ON.

def game_completed(filename)
file = File.open(filename, "rb")
read_save_data(file)
file.close
return($game_switches[1])
end

#------------------------------------------------------------------------------
#This method is identical to the one of the same name in the Scene_Load class, with the
#the added effect of reseting the maps, switches,...

def on_decision(filename)
unless FileTest.exist?(filename)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.load_se)
file = File.open(filename, "rb")
read_save_data(file)
file.close
if ! game_completed(filename)
$scene=Scene_New_Game_Plus.new
return
end

#New code to copy for the "Game Completion Count" feature.
#Begin copying here, and stop at my other comments.
#You also need to copy line #15, shown by a comment also.
@game_completion_count=$game_variables[1]
$game_variables = Game_Variables.new
$game_temp = Game_Temp.new
#$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
#$game_actors = Game_Actors.new
#$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
#$game_player = Game_Player.new
#$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$game_map.autoplay
$scene = Scene_Map.new
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
$game_map.update
$game_switches[1]=true #Since the switches were all reset, this one need to
#be turned back on to indicate the game was completed.
$game_variables[1]=@game_completion_count
#Stop copying new "Game Completion Count" here.

end

end

script mythology rpg
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
 
New Game +
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Retour à l'auberge au lieu d'un game over
» Marion Game
» [Game Develop] - Texte, collision, sauvegarde et autre...
» Comprendre la logique Game Dev Tycoon
» Game of Thrones (Le Trône de fer)

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
la cité de mérélia :: La forge :: Script-
Sauter vers: