- Joined
- Jun 3, 2013
- Messages
- 74
- Reaction score
- 10
- First Language
- English
- Primarily Uses
Well, I tried to create an event that would call the method "change_value" from Scene_Title. This method should add "1" to the attribute @startup_thing... and depending on what @startup_thing is, it would change @game_restart to either true or false:
when @game_restart == false, show the new_game command
when @game_restart == true, show the new_game_plus command
Does anyone know how I could go about doing this..?
Here are the areas I changed in Scene_Base:
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
@startup_thing = 1
if @startup_thing == 1
@restart_game = false
elsif @startup_thing == 2
@restart_game = true
end
SceneManager.clear
Graphics.freeze
create_background
create_foreground
create_command_window
play_title_music
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_TitleCommand.new
if @restart_game == false
@command_window.set_handler
new_game, method
command_new_game))
elsif @restart_game == true
@command_window.set_handler
new_game_plus, method
command_new_game_plus))
end
@command_window.set_handler
continue, method
command_continue))
@command_window.set_handler
shutdown, method
command_shutdown))
end
#--------------------------------------------------------------------------
# * [Change Value] Command
#--------------------------------------------------------------------------
def change_value
@startup_thing += 1
end
#--------------------------------------------------------------------------
# * [New Game Plus] Command
#--------------------------------------------------------------------------
def command_new_game_plus
DataManager.setup_new_game
close_command_window
fadeout_all
$game_map.autoplay
SceneManager.goto(Scene_Map)
end
This is the error:
And here is how I called the method to add "1" to the @startup_thing counter:
Anyone know what I could try to fix the error? Any help would be greatly appreciated!
when @game_restart == false, show the new_game command
when @game_restart == true, show the new_game_plus command
Does anyone know how I could go about doing this..?
Here are the areas I changed in Scene_Base:
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
@startup_thing = 1
if @startup_thing == 1
@restart_game = false
elsif @startup_thing == 2
@restart_game = true
end
SceneManager.clear
Graphics.freeze
create_background
create_foreground
create_command_window
play_title_music
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_TitleCommand.new
if @restart_game == false
@command_window.set_handler
elsif @restart_game == true
@command_window.set_handler
end
@command_window.set_handler
@command_window.set_handler
end
#--------------------------------------------------------------------------
# * [Change Value] Command
#--------------------------------------------------------------------------
def change_value
@startup_thing += 1
end
#--------------------------------------------------------------------------
# * [New Game Plus] Command
#--------------------------------------------------------------------------
def command_new_game_plus
DataManager.setup_new_game
close_command_window
fadeout_all
$game_map.autoplay
SceneManager.goto(Scene_Map)
end
Last edited by a moderator:
