Hi, I'm new to RGSS and am using RMXP. I was wondering if someone could take a look at my modified Scene_Gameover and try to help me diagnose the problem. I'm pretty sure something's missing but I'm not sure what. What happens is that when a game over is triggered, none of the buttons will make the screen go away. As for what I'm trying to achieve by modding the Game Over script is to trigger a list of choices instead of taking the player back to the title screen immediately. If anyone is interested in trying to help, here's the script. Also, if this is in the wrong place, could someone direct me to the proper section of the forum?
#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
# This class performs game over screen processing.
#==============================================================================
class Scene_Gameover
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make game over graphic
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)
# Stop BGM and BGS
$game_system.bgm_play(nil)
$game_system.bgs_play(nil)
# Play game over ME
$game_system.me_play($data_system.gameover_me)
# Execute transition
Graphics.transition(120)
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of game over graphic
@sprite.bitmap.dispose
@sprite.dispose
# Execute transition
Graphics.transition(40)
# Prepare for transition
Graphics.freeze
# If battle test
if $BTEST
$scene = nil
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# If C button was pressed
if Input.trigger?(Input::C)
# Make command window
s1 = "Save and Continue"
s2 = "Save and Quit"
s3 = "Continue without Save"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 240 - @command_window.height / 2
end
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame Update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of window
@command_window.dispose
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update command window
@command_window_update
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window_index
when 0 # Save and Continue
command_save_and_continue
when 1 # Save and Quit
command_save_and_quit
when 2 # Continue without Saving
command_continue_without_saving
end
return
end
end
#--------------------------------------------------------------------------
# * Process When Choosing [Save and Continue] Command
#--------------------------------------------------------------------------
def command_save_and_continue
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
# Transfer player
if player_map_id < 5
if player_map_id > 19
player_new_map_id == 6
else
player_new_map_id == 27
end
end
end
#--------------------------------------------------------------------------
# * Process When Choosing [Save and Quit] Command
#--------------------------------------------------------------------------
def command_save_and_quit
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
# Switch to title screen
$scene = Scene_Title.new
end
#--------------------------------------------------------------------------
# * Process When Choosing [Continue without Saving] Command
#--------------------------------------------------------------------------
def command_continue_without_saving
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Transfer player
if player_map_id < 5
if player_map_id > 19
player_new_map_id == 6
else
player_new_map_id == 27
end
end
end
end
You have two def updates.
The initializing of the selection might be wrong depending on how you want it....
You put it in a trigger which would only show up once the player presses Confirm.
Otherwise it'll be a blank screen.
Also, you assign with = while compare with ==
So when you do player_new_map_id == 6, it's wrong.
(player_new_map_id is a method...right?
If it's a variable, it has the wrong scope)
That's everything I spotted with a quick glance through it.
Quote from: Aqua on December 28, 2010, 12:51:34 am
You put it in a trigger which would only show up once the player presses Confirm.
This is the only thing I don't really understand. What kind of trigger do I use?
# If C button was pressed
if Input.trigger?(Input::C)
# Make command window
s1 = "Save and Continue"
s2 = "Save and Quit"
s3 = "Continue without Save"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 240 - @command_window.height / 2
end
You had that.
You shouldn't have the if
Quote from: demonlord421 on December 28, 2010, 01:32:08 am
Quote from: Aqua on December 28, 2010, 12:51:34 am
You put it in a trigger which would only show up once the player presses Confirm.
This is the only thing I don't really understand. What kind of trigger do I use?
In case you didn't understand, C is short for Confirm :D. I've never really thought about it that way :D.
Cya :urgh:!