Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Scene Won't Change

I'm using Mr. Moo's Window/Scene Wizard to make, well, some windows and some scenes. I'm having problems with this:
Code:
  #--------------------------------------------------------------------------
  # * Update list47136452 
  #--------------------------------------------------------------------------
  def update_list47136452
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
[COLOR=Red]line98--->[/COLOR] case @command_window.index
      when 0 # Slot 1
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Switch to save screen
      $scene = Scene_Save.new
      when 1 # Slot 2
      
      end
    end
  end
I test play, start the script, but when I select Slot 1 it comes up with this error:
Code:
Script 'Scene_Memory' line 98: NoMethodError occurred.
undefined method 'index' for nil:NilClass
The red writing above indicates line 98 of Scene_Memory.
What am I doing wrong please?

If you need to see the rest of the script, then please tell me.
 
Code:
#==============================================================================
# Scene_Memory
#==============================================================================
class Scene_Memory
  #--------------------------------------------------------------------------
  # * Main - Handles drawing/disposing windows and the main loop 
  #--------------------------------------------------------------------------
  def main
    #Draw Windows
    main_draw
    #Execute transition
    Graphics.transition
    #Main Loop
    loop do
      #Main Loop
      main_loop
      break if main_scenechange?
    end
    #Prepare for transition
    Graphics.freeze
    #Dispose Windows
    main_dispose
  end
  #--------------------------------------------------------------------------
  # * Main Draw - Handles drawing windows
  #--------------------------------------------------------------------------
  def main_draw
    #Draw Windows
    # Slot2
    @Slot2 = Slot2.new
    # Slot1
    @Slot1 = Slot1.new
    # Select
    @Select = Select.new
    # List47136452
    @list47136452 = Pre_Command.new(110,['Slot 1','Slot 2',],21)
    @list47136452.windowskin = RPG::Cache.windowskin('001-Blue01')
    @list47136452.x = 10
    @list47136452.y = 16
  end
  #--------------------------------------------------------------------------
  # * Main Scene Change 
  #--------------------------------------------------------------------------
  def main_scenechange?
    # Abort loop if screen is changed
    if $scene != self
      return true
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Main Dispose 
  #--------------------------------------------------------------------------
  def main_dispose
    # Dispose All Windows
    # Dispose Slot2
    @Slot2.dispose
    # Dispose Slot1
    @Slot1.dispose
    # Dispose Select
    @Select.dispose
    # Dispose List47136452
    @list47136452.dispose
  end
  #--------------------------------------------------------------------------
  # * Main Loop 
  #--------------------------------------------------------------------------
  def main_loop
    # Update game screen
    Graphics.update
    # Update input information
    Input.update
    # Frame update
    update
  end
  #--------------------------------------------------------------------------
  # * Update 
  #--------------------------------------------------------------------------
  def update
    # Update Windows
    update_windows
    #Update list47136452
    update_list47136452 if @list47136452.active and @list47136452.visible
  end
  #--------------------------------------------------------------------------
  # * Update list47136452 
  #--------------------------------------------------------------------------
  def update_list47136452
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 0 # Slot 1
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Switch to save screen
      $scene = Scene_Save.new
      when 1 # Slot 2
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Window Update 
  #--------------------------------------------------------------------------
  def update_windows
    # Update Slot2
    @Slot2.update if @Slot2.visible
    # Update Slot1
    @Slot1.update if @Slot1.visible
    # Update Select
    @Select.update if @Select.visible
    # Update List47136452
    @list47136452.update if @list47136452.visible
  end
end
How do you define it?
If you need to see the windows aswell, then I can get those.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top