Either is fine, and if possible, I need the original artist/source of the Battler.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
#==============================================================================
# ¦ Scene_New_Game_Plus (coded by Deke)
# 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="Which file do you wish to continue?"
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
#==============================================================================
# ¦ Scene_Title
#------------------------------------------------------------------------------
# New Game + EDITION
#==============================================================================
class Scene_Title
def main
if $BTEST
battle_test
return
end
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
$game_system = Game_System.new
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
s1 = "New Game"
s2 = "Continue"
s3 = "Shutdown"
s4 = "New Game Plus"
@command_window = Window_Command.new(192, [s1, s2, s3,s4])
@command_window.opacity = 255
@continue_enabled = true
@new_game_plus_enabled=false
#The next block of code allows some added customization to the title screen.
#---------------------------------------------------------------------------------------------------------------------------------------------
@command_window.x = 250 # distance in pixels from left side of scrren to upper left side of window
@command_window.y = 250 # distance in pixels from top of screen to top of window
@command_window.contents.font.size = $fontsize #Font size for items in the window
#(if letters are cropped increase window width at line 36)
@command_window.contents.font.name = $fontface #font face for window items
@command_text_color=Color.new(255,255,255,255) #custom 32 bit color for the SELECTABLE window items
#(disabled items displayed in the systmes "disabled" color
#---------------------------------------------------------------------------------------------
for i in 0..3
dummy_var=Scene_New_Game_Plus.new
filename = "Save#{i+1}.sav"
if FileTest.exist?(filename)
@continue_enabled = true
if dummy_var.game_completed(filename)
@new_game_plus_enabled=true
end
end
end
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
$game_system.bgm_play($data_system.title_bgm)
Audio.me_stop
Audio.bgs_stop
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@sprite.bitmap.dispose
@sprite.dispose
end
#-----------------------------------------------------------
def update
@command_window.update
if @continue_enabled==true
@command_window.draw_item(1,@command_text_color )
end
if @new_game_plus_enabled==true
@command_window.draw_item(3,@command_text_color )
else
@command_window.disable_item(3)
end
@command_window.draw_item(0,@command_text_color )
@command_window.draw_item(2,@command_text_color)
if Input.trigger?(Input::C)
case @command_window.index
when 0
command_new_game
when 1
command_continue
when 2
command_shutdown
when 3
command_new_game_plus
end
end
end
# ------------------------------------
def command_new_game
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.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
$game_map.update
$scene = Scene_Map.new
end
# ------------------------------------
def command_new_game_plus
unless @new_game_plus_enabled==true
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_New_Game_Plus.new
end
#---------------------------------------------------------------
def command_continue
unless @continue_enabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Load.new
end
# ------------------------------------
def command_shutdown
$game_system.se_play($data_system.decision_se)
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
$scene = nil
end
# ------------------------------------
def battle_test
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.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_battle_test_members
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
$game_system.se_play($data_system.battle_start_se)
$game_system.bgm_play($game_system.battle_bgm)
$scene = Scene_Battle.new
end
end