Group: Member
Posts: 9
Type: Developer
RM Skill: Intermediate
Alright, so here's the deal. Ive edited the script "Scene_Title" so that I could have four options on the main title screen. So now its like this;
New Game Continue Shutdown Credits
And now my problem. Now when I click New game I get this error:
Script 'Spriteset_Map' line 21: NoMethodError Occured. Undefined method `Scene_title' for #<Game_Map:0x2aed820>
When continuing I get the same error except the ending part is #<Game_Map:0x2b53070>
Shutdown works fine of course.
and then Credits part works fine, until the end in which I also get the same error but the bottom line is like this:
Undefined method `Scene_title' for nil:NilClass
I would like for after those credits roll, for it to return to the title screen again. I don't know how to fix this really, there's probably a much easier way to implement my fourth option, but iono.
Group: +Gold Member
Posts: 1,199
Type: Scripter
RM Skill: Undisclosed
Well, that's just it.. See, RGSS(2) is 'case sensitive,' a and A have two different meanings. The supposed desired fix?
Find the line that gives you this error:
CODE
Undefined method `Scene_title' for #<Game_Map:0x2aed820>
Find the text that says Scene_title, and change it to Scene_Title
I cant say that you wont encounter more errors though, or that it will work as desired, because you haven't shown us what edits to the original script you've made.
__________________________
Got 30 minutes? Then you've enough time to play this awesome game: - potentially promising project page - thanks holder
Group: Member
Posts: 9
Type: Developer
RM Skill: Intermediate
CODE
# Make command window s1 = "New Game" s2 = "Continue" s3 = "Shutdown" s4 = "Credits" @command_window = Window_Command.new(192, [s1, s2, s3, s4]) @command_window.back_opacity = 160 @command_window.x = 320 - @command_window.width / 2 @command_window.y = 288 # Continue enabled determinant # Check if at least one save file exists # If enabled, make @continue_enabled true; if disabled, make it false @continue_enabled = false for i in 0..3 if FileTest.exist?("Save#{i+1}.rxdata") @continue_enabled = true end end # If continue is enabled, move cursor to "Continue" # If disabled, display "Continue" text in gray if @continue_enabled @command_window.index = 1 else @command_window.disable_item(1) end # Play title BGM $game_system.bgm_play($data_system.title_bgm) # Stop playing ME and BGS Audio.me_stop Audio.bgs_stop # 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 command window @command_window.dispose # Dispose of title graphic @sprite.bitmap.dispose @sprite.dispose 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 # New game command_new_game when 1 # Continue command_continue when 2 # Shutdown command_shutdown when 3 # Credits command_Credits end end end #-------------------------------------------------------------------------- # * Command: New Game #-------------------------------------------------------------------------- def command_new_game # Play decision SE $game_system.se_play($data_system.decision_se) # Stop BGM Audio.bgm_stop # Reset frame count for measuring play time Graphics.frame_count = 0 # Make each type of game object $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 # Set up initial party $game_party.setup_starting_members # Set up initial map position $game_map.setup($data_system.start_map_id) # Move player to initial position $game_player.moveto($data_system.start_x, $data_system.start_y) # Refresh player $game_player.refresh # Run automatic change for BGM and BGS set with map $game_map.autoplay # Update map (run parallel process event) $game_map.update # Switch to map screen $scene = Scene_Map.new end #-------------------------------------------------------------------------- # * Command: Continue #-------------------------------------------------------------------------- def command_continue # If continue is disabled unless @continue_enabled # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to load screen $scene = Scene_Load.new end #-------------------------------------------------------------------------- # * Command: Shutdown #-------------------------------------------------------------------------- def command_shutdown # Play decision SE $game_system.se_play($data_system.decision_se) # Fade out BGM, BGS, and ME Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # Shutdown $scene = nil end #-------------------------------------------------------------------------- # * Command: Credits #-------------------------------------------------------------------------- def command_Credits # Play credits BGM $game_system.bgm_play($data_system.battle_bgm) # CREDITS $scene = $scene = Scene_Credits.new @backgroundList = ["TitleScreen2"] # Update command window @command_window.update end
Thats from the begining of my changes, to the end.
#============================================================================== # ¦ Scene_Credits #------------------------------------------------------------------------------ # Scrolls the credits you make below. Original Author unknown. Edited by # MiDas Mike (now known as Emily_Konichi) so it doesn't play over the Title, but runs by calling the following: # $scene = Scene_Credits.new #==============================================================================
class Scene_Credits
# This next piece of code is the credits. CREDIT=<<_END_
@sprite = Sprite.new #@sprite.bitmap = RPG::Cache.title($data_system.title_name) @backgroundList = ["titleScreen2"] #Edit this to the title screen(s) you wish to show in the background. They do repeat. @backgroundGameFrameCount = 0 # Number of game frames per background frame. @backgroundG_BFrameCount = 3.4 @sprite.bitmap = RPG::Cache.title(@backgroundList[0])
#Stops all audio but background music. Audio.me_stop Audio.bgs_stop Audio.se_stop
Graphics.transition
loop do
Graphics.update Input.update
update if $scene != self break end end Graphics.freeze @sprite.dispose @credit_sprite.dispose end
##Checks if credits bitmap has reached it's ending point def last? if @frame_index > (@credit_sprite.bitmap.height + 500) $scene = Scene_Map.new Audio.bgm_fade(10000) #aprox 10 seconds return true end return false end
#Check if the credits should be cancelled def cancel? if Input.trigger?(Input::C) $scene = Scene_Map.new return true end return false end def update @backgroundGameFrameCount = @backgroundGameFrameCount + 1 if @backgroundGameFrameCount >= @backgroundG_BFrameCount @backgroundGameFrameCount = 0 # Add current background frame to the end @backgroundList = @backgroundList << @backgroundList[0] # and drop it from the first position @backgroundList.delete_at(0) @sprite.bitmap = RPG::Cache.title(@backgroundList[0]) end return if cancel? return if last? @credit_sprite.oy += 1 #this is the speed that the text scrolls. 1 is default #The fastest I'd recomend is 5, after that it gets hard to read. @frame_index += 1 #This should fix the non-self-ending credits end end
#============================================================================== # ** Scene_Title #------------------------------------------------------------------------------ # This class performs title screen processing. #==============================================================================
class Scene_Title #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make command window s1 = "New Game" s2 = "Continue" s3 = "Shutdown" s4 = "Credits" @command_window = Window_Command.new(192, [s1, s2, s3, s4]) @command_window.back_opacity = 160 @command_window.x = 320 - @command_window.width / 2 @command_window.y = 288 # Continue enabled determinant # Check if at least one save file exists # If enabled, make @continue_enabled true; if disabled, make it false @continue_enabled = false for i in 0..3 if FileTest.exist?("Save#{i+1}.rxdata") @continue_enabled = true end end # If continue is enabled, move cursor to "Continue" # If disabled, display "Continue" text in gray if @continue_enabled @command_window.index = 1 else @command_window.disable_item(1) end # Play title BGM $game_system.bgm_play($data_system.title_bgm) # Stop playing ME and BGS Audio.me_stop Audio.bgs_stop # 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 command window @command_window.dispose # Dispose of title graphic @sprite.bitmap.dispose @sprite.dispose 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 # New game command_new_game when 1 # Continue command_continue when 2 # Shutdown command_shutdown when 3 # Credits command_Credits end end end #-------------------------------------------------------------------------- # * Command: New Game #-------------------------------------------------------------------------- def command_new_game # Play decision SE $game_system.se_play($data_system.decision_se) # Stop BGM Audio.bgm_stop # Reset frame count for measuring play time Graphics.frame_count = 0 # Make each type of game object $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 # Set up initial party $game_party.setup_starting_members # Set up initial map position $game_map.setup($data_system.start_map_id) # Move player to initial position $game_player.moveto($data_system.start_x, $data_system.start_y) # Refresh player $game_player.refresh # Run automatic change for BGM and BGS set with map $game_map.autoplay # Update map (run parallel process event) $game_map.update # Switch to map screen $scene = Scene_Map.new end #-------------------------------------------------------------------------- # * Command: Continue #-------------------------------------------------------------------------- def command_continue # If continue is disabled unless @continue_enabled # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to load screen $scene = Scene_Load.new end #-------------------------------------------------------------------------- # * Command: Shutdown #-------------------------------------------------------------------------- def command_shutdown # Play decision SE $game_system.se_play($data_system.decision_se) # Fade out BGM, BGS, and ME Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # Shutdown $scene = nil end #-------------------------------------------------------------------------- # * Command: Credits #-------------------------------------------------------------------------- def command_Credits # Play credits BGM $game_system.bgm_play($data_system.battle_bgm) # CREDITS $scene = Scene_Credits.new @backgroundList = ["TitleScreen2"] # Update command window @command_window.update end
I fixed all the errors I found so that should work
"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!
If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One