RPG Maker Forums

For a game I'm working on, I have certain menu commands (in this case the Item command) in Scene_Menu open up other command windows with their own choices (which will be referred to in the rest of my question as sub-command windows. I'm having this problem where if I go to a scene from a command on a sub-command window, the game crashes when I return to Scene_Menu with the error 'disposed window'. I have also tested the code in a seperate project with the default scripts and had the same error. Can someone please help?


Here is my source code:

class Window_MenuItem < Window_Command
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0)
    update_placement
    self.openness = 0
    open
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    return 160
  end
  #--------------------------------------------------------------------------
  # * Update Window Position
  #--------------------------------------------------------------------------
  def update_placement
    self.x = (Graphics.width - width) / 2
    self.y = (Graphics.height - height) / 2
  end
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list
    add_command("Party",         :party)
    add_command("Actor",         :actor)
    add_command(Vocab::cancel,   :cancel)
  end
end
class Scene_Menu
  #--------------------------------------------------------------------------
  # * Create Item Window
  #--------------------------------------------------------------------------
  def create_item_window
    @item_window = Window_MenuItem.new
    @item_window.x = 0
    @item_window.y = 216
    @item_window.set_handler:)party,     method:)command_party_items))
    @item_window.set_handler:)actor,     method:)command_personal))
    @item_window.set_handler:)cancel,    method:)on_item_close))
  end
  #--------------------------------------------------------------------------
  # * Close Item Window
  #--------------------------------------------------------------------------
  def close_item_window
    @item_window.close
    update until @item_window.close?
  end
  #--------------------------------------------------------------------------
  # * Item Window Cancel Handling
  #--------------------------------------------------------------------------
  def on_item_close
    @item_window.unselect
    @command_window.activate
    close_item_window
  end
  #--------------------------------------------------------------------------
  # * [Item] Command On Command Window
  #--------------------------------------------------------------------------
  def command_item
    create_item_window
  end
  #--------------------------------------------------------------------------
  # * [Party] Command On Item Window
  #--------------------------------------------------------------------------
  def command_party_items
    SceneManager.call(Scene_Item)
  end
end

Thank you.

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,546
Members
137,835
Latest member
yetisteven
Top